Maxima 5.10.0 release candidate 4



On 9/15/06, Marco Ciampa <ciampix at libero.it> wrote:

> plot2d([sqrt(x-2) * sqrt(x-4)], [x,-5,5]);
>
> you get a graph with a positive and a negative part. The positive is ok
> since the function is defined for values x>=4 but the negative part (for
> x<=2) is't defined since the product reset the 2 imaginary components but
> the function is't defined for the 2 sqrt.

Well, what I see when I try to plot plot2d([sqrt(x-2) * sqrt(x-4)], [x,-5,5])
is a piece for x <= 2, a gap, and a piece for x >= 4.
The x <= 2 piece is negative and the x >= 4 piece is positive,
but that seems to follow from the form of the expression -- for x < 2
sqrt(x - 2) * sqrt(x - 4) => product of pure imaginaries w/ i.p. > 0
so the final result is real and negative. That seems OK to me.

> The solution (but I do not know how to apply it to maxima) is to calculate
> the value of result_imaginary variable for every part of the equation.
>
> When the calc is started result_imaginary is set to 0.
> Whatever part of the function creates a complex number this variable must be
> set to 1 to flag that the equation is _not_ defined even if the imaginary part
> is zeroed before the end of the calc.

I'm not sure I understand, but this appears to be a proposal to treat
an expression as undefined for the purpose of plotting if any part of
it is complex. I guess I don't see what is the purpose of that.
If the final result is real, then it is OK for plotting, right?
Also, we could introduce spurious terms + %i - %i into any
expression without changing it mathematically, but then the
proposed test would reject it for plotting.

> Perhaps this go too deep into maxima to make it into this version but this
> behaviour of the plot_realpart variable IMHO _must_ be documented!

Agreed, plot_realpart should be documented. If you have not already
done so, please feel free to submit a bug report about it.
Bugs reported to the mailing list are handled sooner, if ever,
but they can easily get lost.

All the best,
Robert Dodier