On 3/04/2011 3:51 PM, Daniel Dalton wrote:
> 4) Finally, I'm having trouble solving some more complicated equations
> with maxima. According to my text book there is real solutions. How can
> I find the real solution for the below equation? Input/output is
> below. (Note, I'm not familiar with complex numbers.)
Hi Dan,
There are at least two ways to attack 4)
1. Float isn't always sufficient with complex numbers. Try
rectform(float(expression))). You are left with a small imaginary part
due to rounding errors.
2. Use the realroots() function to extract the real roots. It returns
rational approximations to the real solution, which can be converted to
floating point using float(). Try realroots(x^2-2=0). Do you
understand that maxima approximating the irrational number sqrt(2)?
(%i1) display2d:false;
(%o1) false
(%i2) expr:x^3-17*x^2-56*x+1153=0;
(%o2) x^3-17*x^2-56*x+1153 = 0
(%i3) rectform(float(solve(expr,x)));
(%o3) [x = 1.7763568394002505E-15*%i+9.008409308902849,
x = -8.8817841970012523E-16*%i-8.002450376978054,
x = 15.99404106807521-8.8817841970012523E-16*%i]
(%i4) realroots(expr);
(%o4) [x = -268517677/33554432,x = 302272057/33554432,x =
536670963/33554432]
(%i5) float(%);
(%o5) [x = -8.002450376749039,x = 9.008409291505814,x = 15.9940410554409]
David