Hi! I am trying to have students factor a random rational expression (I’m limiting it to a binomial for the numerator and a binomial for the denominator with a common factor).
I would then like to be able to check the student 's factors (all four) with the correct factors.
I am currently stuck with parsing the student’s factored function into its four factors. My eyes are crossed and I am now completely doubting what I am doing.
Slide 2 is my edit.
I used parsefraction, and checked that the factored form of the numerator evaluated at 2.5 was equal to the original numerator evalauated at 2.5 (den as well)
and then used a pattern check for either binXbin or x(bin) or (bin)^2..as long as coef is one (a=1).
I make slides like that all the time. Just for the heck of it, I made an addition (slide 2) that changes the variable. It’s just a list of latex variables that you can just add another letter to the list, with no other edits.(After changing ALL the x’s to ${v}) Use more x’s on the list if you want that to be the more prevalent variable.
The code that chooses the variable (two lines) is useful for other things as well. I use it all the time. For example, coefficient lists that skip zero.