Post Reply 
rootof ???
09-04-2014, 12:44 AM (This post was last modified: 09-04-2014 02:00 AM by Helge Gabert.)
Post: #1
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().
Find all posts by this user
Quote this message in a reply
09-04-2014, 05:46 AM (This post was last modified: 09-04-2014 05:46 AM by parisse.)
Post: #2
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).
Find all posts by this user
Quote this message in a reply
09-04-2014, 01:49 PM
Post: #3
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).
Find all posts by this user
Quote this message in a reply
09-04-2014, 02:20 PM (This post was last modified: 09-04-2014 02:24 PM by Tim Wessman.)
Post: #4
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.
Find all posts by this user
Quote this message in a reply
09-04-2014, 06:48 PM
Post: #5
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.
Find all posts by this user
Quote this message in a reply
09-04-2014, 07:08 PM (This post was last modified: 09-04-2014 07:12 PM by phgerin.)
Post: #6
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.
Find all posts by this user
Quote this message in a reply
09-04-2014, 07:56 PM
Post: #7
RE: rootof ???
(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)]
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)