I'm using Maxima 5.44. In the taylor expansion of a radical, Maxima introduce an unnecessary imaginary unit.
I'm trying the following calculation:
rr:sqrt(1-a*cos(θ)^2);
taylor(rr, θ, 0, 2);
The result is:
sqrt(a-1)*%i-(sqrt(a-1)*%i*a*θ^2)/(2*a-2)+...
Even though it's correct the imaginary unit is annoying as everything will be computed in the real line. I would have preferred:
sqrt(1-a)-(sqrt(1-a)*a*θ^2)/(2*a-2)+...
as it will be shorter and more clear.
Is there a way to force maxima not to insert the imaginary unit?
I tried with assume(a<1)
but it didn't work.
For example sympy don't introduce this additional imaginary unit.
This is part to a larger calculation, of course. Thanks in advance.
This is the best solution I have found so far. (I recognize that even this is imperfect.) Credit to Barton Willis for this.
EDIT: Another way I found, via the flag
radexpand
.