From: Simon W. <si...@ge...> - 2011-07-27 12:46:54
|
Hi there, is it possible to get only the real solutions of an equation from solve? (Such that solve(x^4=1,x) returns only {x=1, x=-1}) Thank you, Simon |
From: Arthur N. <ac...@ca...> - 2011-07-27 13:40:18
|
On Wed, 27 Jul 2011, Simon Weitzhofer wrote: > Hi there, > > is it possible to get only the real solutions of an equation from solve? (Such > that solve(x^4=1,x) returns only {x=1, x=-1}) > > Thank you, > Simon > You may wish to investigate realroots(x^2 + 1) {} realroots(x^2 - 1) {x = -1 , x = 1} for cases where you KNOW that you will be getting numeric roots...? In terms of an objection to "i", I note that at present the simplification of sqrt reads symbolic procedure simpsqrt u; if u=0 then nil ./ 1 else if null !*keepsqrts then simpexpt1(car u, simpexpon '(quotient 1 2), nil) else begin scalar x,y; x := xsimp car u; return if null numr x then nil ./ 1 else if denr x=1 and domainp numr x and !:minusp numr x then if numr x=-1 then simp 'i else multsq(simp 'i, simpsqrt list prepd !:minus numr x) else if y := domainvalchk('sqrt,list x) then y else simprad(x,2) end; so "sqrt(-1)" is turned into "i" at a fairly low level. Arthur |