Alexandru Cardaniuc cardaniuc at gmail.com
Sun Apr 27 22:16:03 CDT 2008

```I have the following polynomial: e^x - 3*x^2

I am trying to find real roots. I use solve.

(%i7) p: (%e)^x - 3*x^2;
x      2
(%o7)                             %e  - 3 x
(%i8) p;
(%i14) solve(p,x);
x/2          x/2
%e           %e
(%o14)                   [x = - -------, x = -------]
sqrt(3)      sqrt(3)
(%i15) solve(p,x),numer;

`rat' replaced 0.33333333333333 by 1/3 = 0.33333333333333

`rat' replaced -0.5773502691896 by -2911/5042 = -0.5773502578342

`rat' replaced 1.0 by 1/1 = 1.0

`rat' replaced -2.449293598294706E-16 by -1/4082809838298842 = -2.449293598294706E-16

`rat' replaced 0.5 by 1/2 = 0.5

`rat' replaced -0.5773502578342 by -2911/5042 = -0.5773502578342

`rat' replaced 1.0 by 1/1 = 1.0

`rat' replaced -2.449293598294706E-16 by -1/4082809838298842 = -2.449293598294706E-16

`rat' replaced 3.4490250987489918E-18 by 1/289937002883137472 = 3.4490250987489918E-18

`rat' replaced 0.5 by 1/2 = 0.5

`rat' replaced 0.5 by 1/2 = 0.5

`rat' replaced 0.5 by 1/2 = 0.5

`rat' replaced -0.5773502691896 by -2911/5042 = -0.5773502578342

`rat' replaced -1.0 by -1/1 = -1.0

`rat' replaced 1.2246467991473532E-16 by 1/8165619676597685 = 1.2246467991473532E-16

`rat' replaced 0.5 by 1/2 = 0.5

`rat' replaced -0.5773502578342 by -2911/5042 = -0.5773502578342

`rat' replaced -1.0 by -1/1 = -1.0

`rat' replaced 1.2246467991473532E-16 by 1/8165619676597685 = 1.2246467991473532E-16

`rat' replaced -2.428890914611966E-20 by -1/41171054409405521920 = -2.428890914611966E-20

`rat' replaced 0.5 by 1/2 = 0.5

`rat' replaced 0.5 by 1/2 = 0.5

`rat' replaced 0.5 by 1/2 = 0.5
0.5 x
(%o15) [x = 2.4288909146119663E-20 (2911 %i - 23770118878575861035) %e     ,
0.5 x
x = - 3.4490250987489918E-18 (41 %i - 167395203370252522) %e     ]

So, I get two roots, which don't make sense to me. Using newton's method
I get approximations for 3 real roots below:

(%o17)        /usr/share/maxima/5.13.0/share/numeric/newton1.mac

(%i21) newton(p,x,4,10^-5);

(%o21)                         3.733079028654685

(%i22) newton(p,x,0,10^-5);

(%o22)                        - 0.45896227419484

(%i24) newton(p,x,2,10^-5);

(%o24)                         0.91000757254889

Am I doing something wrong? Am I not supposed to use solve to find the
roots of this polynomial? Why do I get 2 roots instead of three? And 2
wrong ones?

I probably don't see something obvious. I am new to maxima. Just started
using it...

--
"When I was a kid I used to pray every night for a new bicycle. Then I
realised that the Lord doesn't work that way so I stole one and asked
Him to forgive me."
- Emo Philips.
```