Post Reply 
Exact 3rd degree poly root
02-26-2016, 10:00 AM
Post: #2
RE: Exact 3rd degree poly root
You must make a program if you want a solution expressed in terms of radicals. You can inspire yourself from the following Xcas program:
Code:

cardan(P,x):={
  local b,p,q,d,V,u,v,x1,x2,x3,n,j;
  j:=exp(2*i*pi/3);
  V:=symb2poly(P,x);
  n:=size(V);
  if (n!=4){
    throw(afficher(P)+" n'est pas de degre 3");
  }
  // Reduction de l'equation
  V:=V/V[0];
  b:=V[1];
  V:=ptayl(V,-b/3);
  p:=V[2];
  q:=V[3];
  // on est ramen← ¢ x^3+p*x+q=0
  // x=u+v -> u^3+v^3+(3uv+p)(u+v)+q=0
  // On pose uv=-p/3 donc u^3+v^3=-q et u^3 et v^3 sont solutions
  // de u^3 v^3 = -p^3/27 et u^3+v^3=-q
  // donc de x^2+q*x-p^3/27=0
  d:=q^2/4+p^3/27;
  if (d==0){
    // racine double
    return solve(P,x); 
  }
  d:=sqrt(d);
  u:=(-q/2+d)^(1/3);
  v:=-p/3/u;
  x1:=u+v-b/3;
  x2:=u*j+v*conj(j)-b/3;
  x3:=u*conj(j)+v*j-b/3;
  return [x1,x2,x3];
}:;
This is not done automatically, because further handling nested 3rd/square roots would be too complicated. In fact, Cardan (and Ferrari formulae) are useless: too complicated for symbolic handling, not accurate enough for numeric, unfortunately many math teachers do not know that. The right way to handle symbolically exact solutions of polynomials is algebraic extensions of Q, Xcas will return a "rootof" solution for this polynomial. But rootofs have been disabled on the Prime, perhaps because it is a little more complicated to explain them to highschool students.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Exact 3rd degree poly root - lrdheat - 02-26-2016, 05:40 AM
RE: Exact 3rd degree poly root - parisse - 02-26-2016 10:00 AM
RE: Exact 3rd degree poly root - rhab - 02-26-2016, 03:38 PM
RE: Exact 3rd degree poly root - parisse - 02-26-2016, 07:45 PM



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