Solving 3rd order equation by solve.
- Subject: Solving 3rd order equation by solve.
- From: Jaime Villate
- Date: Tue, 26 Feb 2013 15:12:04 +0000
Hi,
and yet another variant of Pepe's and Rupert's solutions:
(%i1) chop (x, eps) := if is (imagpart (x) < eps) then realpart (x) else x$
(%i2) chop_solve ([args]) := map (lambda ([eq], lhs (eq) = chop (rhs (eq), 1e-8)), float (rectform (apply (solve, args))))$
(%i3) chop_solve(x^3-3*x^2-2*x+1, x);
(%o3) [x = .3433795689528897, x = - .8342431843139217, x = 3.490863615361032]
Regards,
Jaime