HP Forums

Full Version: rootof ???
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I recently ran into this (in CAS):

solve(x^2-2*x+((-1-i)*x)/sqrt(2)+(2+2*i)/sqrt(2),x) returns

{2,-1/12*rootof([[1 -3 -5 3] [1 0 -2 0 9]])}

Question: What is rootof? (needless to say, not mentioned in the documentation)

The whole construct seems weird. The argument to rootof (a 2x4.5 matrix?) has four columns in the first row and 5 columns in the second. Indeed, if I try to copy this from the history line, the prime issues an error message.

However, the expression to solve for has, of course, the solution {2, sqrt(i)}, as can be verified by running fsolve or proot on the expression at the top.

By the bye, a similar situation occurs by running collect().
rootof(P,Q) is used for algebraic extension representation, it is P(alpha) where Q(alpha)=0, Q being an irreducible polynomial over the rationals. You can evalf rootofs to get a numeric approximation:
approx(-1/12*rootof([[1,-3,-5,3], [1, 0, -2, 0, 9]])
In other words sqrt(i) is P(alpha) where P(x)=-1/12*(x^3-3x^2-5x+3) and alpha is root of Q(x)=x^4-2x^2+9.
rootof are created when you mix several algebraic extensions of small order (2 of order 2 in your example sqrt(2) and i).
Thank you for the explanation. That is good to know!

So, approx(-1/12*rootof([[1,-3,-5,3], [1, 0, -2, 0, 9]]) should return the numerical equivalent of sqrt(i).
The question in my mind is why does it need the rootof thing and can't solve in a cleaner way. This doesn't seem like such an incredibly out there equation. What capability is missing here?

Even the 50g solves this one down to (1+i)/sqrt(2)
The 50g has a much less general system to handle algebraic extension, it handles square roots only. rootof is the general method to handle exactly roots of irreducible polynomials. For example
l:=csolve(x^3-x^2+x+1); normal(l[1]*l[2]+l[3]*l[1]+l[3]*l[2]);
There is a mechanism to detect some rootofs and rewrite them in a simpler way, that's always the case for real square roots. Perhaps it can be improved to rewrite this one in a more common way. But it's just writing, (1+i)*sqrt(2)/2 is not simpler for further exact computations that the rootof returned and if you need a numeric approximation, approx works on rootof.
Hello,
Can you explain what is an "algebraic extension" ? Or a link ?

also, solve(x^2-2*x+((-1-i)*x)/sqrt(2)+(2+2*i)/2,x) crashes the calculator.
(09-04-2014 07:08 PM)phgerin Wrote: [ -> ]Hello,
Can you explain what is an "algebraic extension" ? Or a link ?
I recommend reading first about algebraic number.

Quote:also, solve(x^2-2*x+((-1-i)*x)/sqrt(2)+(2+2*i)/2,x) crashes the calculator.
Seems to be solved with the patch I'm implementing for rewriting the rootof above.
l:=csolve(x^2-2*x+((-1-i)*x)/sqrt(2)+(2+2*i)/2,x)
giac returns a rather complicated answer
list[1/72*(sqrt(2)*(18+18*i)+18*sqrt(2*sqrt((sqrt(2)*2-3)^2+8)+sqrt(2)*4)*((i)*(sqrt(2)*2592-3888)/(1296*sqrt((sqrt(2)*2-3)^2+8)+sqrt(2)*2592)+1)+72),1/72*(sqrt(2)*(18+18*i)-18*sqrt(2*sqrt((sqrt(2)*2-3)^2+8)+sqrt(2)*4)*((i)*(sqrt(2)*2592-3888)/(1296*sqrt((sqrt(2)*2-3)^2+8)+sqrt(2)*2592)+1)+72)]
Reference URL's