rootof ???
09-04-2014, 12:44 AM (This post was last modified: 09-04-2014 02:00 AM by Helge Gabert.)
Post: #1
 Helge Gabert Senior Member Posts: 457 Joined: Dec 2013
rootof ???
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().
09-04-2014, 05:46 AM (This post was last modified: 09-04-2014 05:46 AM by parisse.)
Post: #2
 parisse Senior Member Posts: 987 Joined: Dec 2013
RE: rootof ???
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).
09-04-2014, 01:49 PM
Post: #3
 Helge Gabert Senior Member Posts: 457 Joined: Dec 2013
RE: rootof ???
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).
09-04-2014, 02:20 PM (This post was last modified: 09-04-2014 02:24 PM by Tim Wessman.)
Post: #4
 Tim Wessman Senior Member Posts: 2,083 Joined: Dec 2013
RE: rootof ???
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)

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
09-04-2014, 06:48 PM
Post: #5
 parisse Senior Member Posts: 987 Joined: Dec 2013
RE: rootof ???
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.
09-04-2014, 07:08 PM (This post was last modified: 09-04-2014 07:12 PM by phgerin.)
Post: #6
 phgerin Junior Member Posts: 19 Joined: Apr 2014
RE: 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:56 PM
Post: #7
 parisse Senior Member Posts: 987 Joined: Dec 2013
RE: rootof ???
(09-04-2014 07:08 PM)phgerin Wrote:  Hello,
Can you explain what is an "algebraic extension" ? Or a link ?