x^3 = - 0.008 has 3 solutions, 2 of them are imaginary, 1 is real
and you want especially one of them
see the 'surd' command (which is a bit difficult to follow in the help pages):
"Note the differences among the outputs of the surd, ^, and root commands":
(-8.0)^(1/3); root(-8.0, 3); surd(-8.0, 3);;
1.000000000 + 1.732050807 I
1.000000000 + 1.732050807 I
-2.000000000
For plotting: Maple does not plot imaginary number, if not been explicitely told like
The reason is that Maple computes the principal value of the expression z^(1/3), which, for negative real z, lies in the upper right quadrant of the complex plane. To see that, you may use conformalplot:
My original question stemmed from the fact that Maple wouldn't give me any negative x-points in the graph of y= x^(1/3). It was suggested that I use
plot(Re(x^(1/3)) etc.
and this did give me points when x < 0. But something was still not right since the graph didn't look as I expected. It was only when I tried Tim's suggestion:
1) I gather from the Help files that Real Domain is geared to precalculus math, so the commands available for it are limited. That environment, then, would not be suitable for much of calculus, right?
2) What's the most efficient way to switch out of RealDomain? Exiting the worksheet and re-opening it as well as Restart are options, but they reset a lot of stuff that you might prefer not be reset. Any other options?
Do not load the package if you are only looking for a limited subset of the features. For example, your plot that uses the RealDomain features can be called with the line below. Then you do not have to execute a worksheet restart.
You created your procedure f36() outside of the use of RealDomain. So the `^` bound within f36 is the usual global :-`^` and not the RealDomain:-`^` export. The procedure f36 is getting its binding of `^` when it is created, not when it is used (plotted).
Compare,
restart:
use RealDomain in
f36 := x -> x^(2/5);
plot(f36(x), x = -1..1,y = -1..1);
end use;
plot(f36(x), x = -1..1,y = -1..1);
lprint(eval(f36));
restart:
f36 := x -> x^(2/5);
use RealDomain in
plot(f36(x), x = -1..1,y = -1..1);
end use;
lprint(eval(f36));
restart:
use RealDomain in
plot(:-`^`(x,2/5), x = -1..1,y = -1..1);
end use;
I first tried limit without RealDomain & got the wrong answer. Since using RealDomain had cured other problems in this thread, I decided to try it, but got the same wrong answer. The real question is: How can I get the right answer?
Comments
x^3 = - 0.008
principal value
The reason is that Maple computes the principal value of the expression z^(1/3), which, for negative real z, lies in the upper right quadrant of the complex plane. To see that, you may use conformalplot:
plots[conformalplot](z^(1/3), z = -1..1)
conformal
I guess that you mean
A nice plot of the cubic roots is got with 'DynamicSystems' (not obvious though):
To answer your plot question
All of the aforementioned hopefully helped explained why Maple does what it does...although it does make sense, it's not the most intuitive operation.
To get the plot that you asked for though, use the command plot(surd(x,3),x=-5..5).
Hope that helps.
Successful plot
My original question stemmed from the fact that Maple wouldn't give me any negative x-points in the graph of y= x^(1/3). It was suggested that I use
plot(Re(x^(1/3)) etc.
and this did give me points when x < 0. But something was still not right since the graph didn't look as I expected. It was only when I tried Tim's suggestion:
plot(surd(x,3) etc.
that the plot came out OK.
Alla
RealDomain
Another possibility is
Note that Re(x^(1/3)) is incorrect, as you noticed. It returns the real part of a complex root, which is different from the real root.
Limitations of RealDomain
Two comments on RealDomain:
1) I gather from the Help files that Real Domain is geared to precalculus math, so the commands available for it are limited. That environment, then, would not be suitable for much of calculus, right?
2) What's the most efficient way to switch out of RealDomain? Exiting the worksheet and re-opening it as well as Restart are options, but they reset a lot of stuff that you might prefer not be reset. Any other options?
Alla
unwith
For 2,
To use RealDomain with just a few commands, it is probably better to do so within a use environment
Limitations of RealDomain
Do not load the package if you are only looking for a limited subset of the features. For example, your plot that uses the RealDomain features can be called with the line below. Then you do not have to execute a worksheet restart.
>use RealDomain in plot(x^(1/3), x = -1..1) end;
Regards,
Georgios Kokovidis
Dräger Medical
Plotting inconsistency
I want to plot y = x^(2/5), so I tried
use RealDomain in
plot(x^(2/5), x = -1..1,y = -1..1);
end use;
This works OK.
But if define
f36 := x -> x^(2/5);
Then
use RealDomain in
plot(f36(x), x = -1..1,y = -1..1);
end use;
does not give me x-points for x < 0.
Why?
Alla
because
You created your procedure f36() outside of the use of RealDomain. So the `^` bound within f36 is the usual global :-`^` and not the RealDomain:-`^` export. The procedure f36 is getting its binding of `^` when it is created, not when it is used (plotted).
Compare,
acer
binding
When Maple creates the procedure f36 := x -> x^(2/5), it uses the definition of ^ at that time. To see this do
The solution is as shown above, create the procedure when RealDomain is 'active'. You can then use it outside RealDomain, that is,
does what you want.
Why doesn't limit work here?
Why doesn't this work?
> use RealDomain in
f39 := x -> 4*x^(2/5)-2*x;
limit(f39(x),x=0,real);
end use;
>
I'm getting zero, but answer should be "undefined," no?
Alla
why?
Why do you think that the result should be undefined, when computed under RealDomain?
RealDomain or not
I first tried limit without RealDomain & got the wrong answer. Since using RealDomain had cured other problems in this thread, I decided to try it, but got the same wrong answer. The real question is: How can I get the right answer?
Alla