STACK - Negative sign, fractions and intervals not being handled correctly

Re: STACK - Negative sign, fractions and intervals not being handled correctly

by Luiz Gustavo Cordeiro -
Number of replies: 0

Good points. Here is "Question variables" part:

a: rand([-4,-3,-2]);
b: rand([0,1,2]);
o: rand([-2, -3/2,-1,-1/2]);
f: lambda([x],o*(x-a)*(x-b));
min: rationalize(-(o*(b-a)^2)/4);
res1: expand(f(x));

c: rand([-2,-1,0]);
d: rand([2,3,4]);
e: rand([2, 3/2,1,1/2]);
g: lambda([x],e*(x-c)*(x-d));
max: rationalize(-(e*(d-c)^2)/4);
res2: expand(g(x));

sol: solve([f(x)-g(x)=0]);
respre3: sol[1];
respre4: sol[2];
res3:subst(respre3,x);
res4:subst(respre4,x);
res5: cc(res3,res4);

and here is an example  with "res5" printed (right below "Incorrect answer"). The inputted answer, which should be equivalent, is not being accepted

image should be here