Re: cubic polynomial
- To: mathgroup at smc.vnet.net
- Subject: [mg22677] Re: [mg22646] cubic polynomial
- From: Andrzej Kozlowski <andrzej at tuins.ac.jp>
- Date: Sat, 18 Mar 2000 01:27:52 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
on 3/16/00 3:11 PM, E.Carletti1 at E.Carletti1 at lse.ac.uk wrote: > > I have a problem: I want to solve this equation: > > x^3+(3c-1)(x^2)-4cx-4(c^2)=0 with respect to x. > > It has to have a real solution because it is continuous > in x. c is a positive parameter. > If i solve it numerically, plugging numbers for c, then it is fine. But > I would like an analytical solution: in this case i get only one > solution which should give me a real value for x (the other two are > imaginary) but > it has a square root with all negative members (all terms with c, which > is positive, with a sign - in front of it, so immaginary). How is that > possible? What procedure does mathematica use to solve cubic expression? > > How can I express the expression in a nicer way to get rid of these > negative terms? My feeling is that the programm is not able to simplify > the expression for the solution. > Could you please help me? if I write the expression I find in the paper > I am writing, noone will believe it is real! > And even more funny, if I plug number into the solution I find for x, it > comes the same number as I plug numbers directly into the function I > want to solve, except for the last part which is an imaginary number > which shoult tend to zero. > What is going on? > > Thank your for your help > > Elena Carletti > Financial Markets Group > LSE > Houghton Street > London WC2A 2AE > > Tel. 0044 (0)20 7955 7896 > Fax 0044 (0) 20 7242 1006 > > > I am afraid this your problem is as unsolvable as it is typical. Mathematica solves cubic equations using the famous formula attributed to the 16 century Italian mathematician Cardano (though actually it was discovered by another 16th century Italian Tartaglia). This formula (and another one for fourth degree equations discovered by Cardano) inevitably involves complex numbers even when the roots are real. For example consider the following equation: x^3 + x^2 - 12 x - 6 == 0 This has three real roots. You can see this just by looking at the graph Plot[x^3 + x^2 - 12 x - 6, {x, -4, 4}] (I personally prefer a different proof. Just evaluate In[3]:= Experimental`CylindricalAlgebraicDecomposition[x^3 + x^2 - 12 x - 6 == 0, x] Out[3]= 3 2 x == Root[#1 + #1 - 12 #1 - 6 & , 1] || 3 2 x == Root[#1 + #1 - 12 #1 - 6 & , 2] || 3 2 x == Root[#1 + #1 - 12 #1 - 6 & , 3] This shows that all three roots must be real!) Now look at the answer Solve gives In[4]:= Solve[x^3 + x^2 - 12 x - 6 == 0, x] Out[4]= 1 37 {{x -> -(-) + ------------------------- + 3 1/3 3 (26 + 9 I Sqrt[617]) 1 1/3 - (26 + 9 I Sqrt[617]) }, 3 1 37 (1 + I Sqrt[3]) {x -> -(-) - ------------------------- - 3 1/3 6 (26 + 9 I Sqrt[617]) 1 1/3 - (1 - I Sqrt[3]) (26 + 9 I Sqrt[617]) }, 6 1 37 (1 - I Sqrt[3]) {x -> -(-) - ------------------------- - 3 1/3 6 (26 + 9 I Sqrt[617]) 1 1/3 - (1 + I Sqrt[3]) (26 + 9 I Sqrt[617]) }} 6 All roots look complex, though we know they are real. In general it is impossible to give an expression for arbitrary real roots of polynomial equations in terms of radicals without using complex numbers, although one can give such expressions if one does not insist on using radicals. In the above case one can give real expressions for the roots using trigonometric functions: for example the first root above is actually equal to 1 2 1 9 Sqrt[617] -(-) + - Sqrt[37] Cos[- ArcTan[-----------]] 3 3 3 26 and one can find similar real expressions for all of the others. If your equation involves parameters the situation is even more confusing. You may get roots which seem to involve complex numbers and others which appear to be real. But actually which one is real and which is not will depend on the values of the parameters, and in fact for certain values the roots that look complex may turn out to be real while those which look real may result in complex values. The moral is that if you want to use algebraic solutions of equations you simply can't avoid complex numbers. This is exactly what Tartaglia and Cardano discovered and this is the reason why they invented what they called "imaginary" numbers. -- Andrzej Kozlowski Toyama International University JAPAN http://sigma.tuins.ac.jp