Here's another example of an equation that produces roots that I can't simplify properly: cis(theta) := %i*sin(theta) + cos(theta); eq: y^4 - 4*y + 3*cis(2*%pi/3); roots: solve(eq); zero: rhs(roots[2]-roots[3]); Now, float(rectform(zero)) shows that zero is, in fact, zero, but I can't find any Maxima combination that can simplify it to 0. I haven't looked at the solve() code to see how it computes multiplicities, but I suspect that an inability to simplify things to zero lies at the heart of this...
It definitely doesn't get the multiplicities right.
Yeah, I see that rectform() cleans up those answers nicely.
Here's a cubic that doesn't solve() right, even with radcan(): eq : y^3 + 3y - 2%i; radcan(solve(eq)); Maxima branch_5_40_base_61_g09d6e16 gives me 1/(-1)^(1/6) and -2/(-1)^(1/6). Wolfram Alpha reports that the roots are i and -2i, since the polynomial factors as (y-i)^2 (y+2i).
Here's a cubic that doesn't solve() right, even with radcan(): eq : y^3 + 3y - 2%i; radcan(solve(eq)); Maxima branch_5_40_base_61_g09d6e16 gives me 1/(-1)^(1/6) and -2/(-1)^(1/6). Wolfram Alpha reports that the actual roots are i and -2i, since the polynomial factors as (y-i)^2 (y+2i).
I've found that the roots can be simplified by applying radcan to them. Also, running these commands: radcan(subst(roots[1], eq)); radcan(subst(roots[2], eq)); radcan(subst(roots[3], eq)); shows that the roots returned by solve() actually do solve the equation. But the multiplicities returned by solve() still aren't right. Applying radcan() to roots shows that two of them are actually identical. Should solve() use radcan() on its solutions before returning them?
Cubic equation that can't be solve()'d
derivatives don't format correctly using alt-display TeX