Ask Your Question

Revision history [back]

Hello,

Here is what I get

sage: a, x= var('a,x')
sage: p = x^2 - 7*a*x + 5+2*I
sage: (p == 0).solve([x])
[x == 7/2*a - 1/2*sqrt(49*a^2 - 8*I - 20), x == 7/2*a + 1/2*sqrt(49*a^2 - 8*I - 20)]

For the last step, note that you can also do

sage: solve(p == 0, [x])
[x == 7/2*a - 1/2*sqrt(49*a^2 - 8*I - 20), x == 7/2*a + 1/2*sqrt(49*a^2 - 8*I - 20)]

But you will not obtain this expression through factor (whose signification is somehow ambiguous).

Vincent