Re: Exact real solutions of cubic equations

• To: mathgroup at smc.vnet.net
• Subject: [mg46960] Re: Exact real solutions of cubic equations
• From: Paul Abbott <paul at physics.uwa.edu.au>
• Date: Wed, 17 Mar 2004 02:53:40 -0500 (EST)
• Organization: The University of Western Australia
• References: <c387p7\$bij\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```In article <c387p7\$bij\$1 at smc.vnet.net>, JonasB at iui.se wrote:

> I would like to find the _exact_ real roots of some cubic polynomials.
> Mathematica seems to have problems determining that a root is real
>
> Solve[1 + a s + b s^2 + s^3 == 0, s]
>
> results in three complex solutions for a = -4 and b = 3. FullSimplify does
> not help, either it does nothing or it gets stuck, depending on the values
> of a and b.

Use ComplexExpand:

Solve[s^3 + 3 s^2 - 4 s + 1 == 0, s] /.
(a_ -> b_) :> a -> ComplexExpand[b] // Simplify

> Does anyone know of a package that can simplify expressions
> with complex numbers?

Physics 52 (3), 269 (1984)), a cubic of the form  x^3 - a x + b has
three real roots when a > 0 and 27 b^2 < 4 a^3. In this case, the roots
can be written as

r[n_] = 2 Sqrt[a/3] Cos[Pi (2n - 1)/3 + ArcCos[(b/2)/(a/3)^(3/2)]/3]

where n = 1,2,3. This is easily verified:

Simplify[x^3 - a x + b == 0 /. x ->  r[n], Element[n,Integers]]

True

Your cubic reduces to the form x^3 - a x + b by a linear transformation:

Simplify[s^3 + 3 s^2 - 4 s + 1 /. s -> s - 1]

s^3 - 7 s + 7

Clearly a = 7 > 0 and 27 7^2 < 4 7^3 ==> 27 < 28 so the three roots are

2 Sqrt[7/3] Cos[Pi (2n - 1)/3 + ArcCos[(7/2)/(7/3)^(3/2)]/3] - 1

where n = 1,2,3.

However, when all is said and done, I still do not see that these exact
solutions are all that useful. Instead, why not express the solutions
exactly in terms of Root objects

SetOptions[Roots, Cubics -> False, Quartics -> False]

Then,

Solve[1 + a s + b s^2 + s^3 == 0, s]

gives the three roots as exact root objects, as functions of the
parameters a and b. You will see that this representation is useful if
you need to compute a derivate with respect to either or both of these
parameters. For example, computing the partial derivative of the first
root with respect to a,

Simplify[D[Root[#1^3 + b*#1^2 + a*#1 + 1 & , 1], a]]

one obtains a simple function of the root as the result.

Cheers,
Paul

--
Paul Abbott                                   Phone: +61 8 9380 2734
School of Physics, M013                         Fax: +61 8 9380 1014
The University of Western Australia      (CRICOS Provider No 00126G)
35 Stirling Highway
Crawley WA 6009                      mailto:paul at physics.uwa.edu.au
AUSTRALIA                            http://physics.uwa.edu.au/~paul

```

• Prev by Date: RE: Exact real solutions of cubic equations
• Next by Date: Re: Typesetting: ?Big Sigmas and Little Sigmas?
• Previous by thread: RE: Exact real solutions of cubic equations
• Next by thread: new DSolve feature