0
$\begingroup$

I have symbolic third and fourth-order polynomials which read.

$F_{3}= x^3+p x +q,$

$F_{4}= x^4+p_{0} x^2 +q_{0} x + r_{0}.$

Using the Mathematica, I can find the roots of these polynomials using

Solve[x^3 + p*x + q == 0, x]

Solve[x^4+p0 x^2 +q0 x + r0 == 0, x]

The solutions for instance for the 3rd order polynomial are \begin{align} \left\{\left\{\lambda \to \frac{\sqrt[3]{\sqrt{3} \sqrt{4 p^3+27 q^2}-9 q}}{\sqrt[3]{2} 3^{2/3}}-\frac{\sqrt[3]{\frac{2}{3}} p}{\sqrt[3]{\sqrt{3} \sqrt{4 p^3+27 q^2}-9 q}}\right\},\left\{\lambda \to \frac{\left(1+i \sqrt{3}\right) p}{2^{2/3} \sqrt[3]{3} \sqrt[3]{\sqrt{3} \sqrt{4 p^3+27 q^2}-9 q}}-\frac{\left(1-i \sqrt{3}\right) \sqrt[3]{\sqrt{3} \sqrt{4 p^3+27 q^2}-9 q}}{2 \sqrt[3]{2} 3^{2/3}}\right\},\left\{\lambda \to \frac{\left(1-i \sqrt{3}\right) p}{2^{2/3} \sqrt[3]{3} \sqrt[3]{\sqrt{3} \sqrt{4 p^3+27 q^2}-9 q}}-\frac{\left(1+i \sqrt{3}\right) \sqrt[3]{\sqrt{3} \sqrt{4 p^3+27 q^2}-9 q}}{2 \sqrt[3]{2} 3^{2/3}}\right\}\right\}. \end{align}

Based on the Cardano's Method, solutions of $F_{3}$ can be also written as \begin{align} x &= u+v ,\\ u^{3} &= -\frac{q}{2} + \sqrt{ \frac{q^2}{4} + \frac{p^3}{27}},\\ v^{3} &= -\frac{q}{2} - \sqrt{ \frac{q^2}{4} + \frac{p^3}{27}} . \end{align}

How can I enforce the final solution of Solve in Mathematica to keep radicals in the nominator?

$\endgroup$

1 Answer 1

3
$\begingroup$

Not that I know a single command that could do such an operation. Here one needs to work a bit. Let us see the example of the cubic equation:

sl = Solve[x^3 + p*x + q == 0, x]


(*  {{x -> -(((2/3)^(1/3) p)/(-9 q + Sqrt[3] Sqrt[4 p^3 + 27 q^2])^(
     1/3)) + (-9 q + Sqrt[3] Sqrt[4 p^3 + 27 q^2])^(1/3)/(
    2^(1/3) 3^(2/3))}, {x -> ((1 + I Sqrt[3]) p)/(
    2^(2/3) 3^(1/3) (-9 q + Sqrt[3] Sqrt[4 p^3 + 27 q^2])^(
     1/3)) - ((1 - I Sqrt[3]) (-9 q + Sqrt[3] Sqrt[4 p^3 + 27 q^2])^(
     1/3))/(2 2^(1/3) 3^(2/3))}, {x -> ((1 - I Sqrt[3]) p)/(
    2^(2/3) 3^(1/3) (-9 q + Sqrt[3] Sqrt[4 p^3 + 27 q^2])^(
     1/3)) - ((1 + I Sqrt[3]) (-9 q + Sqrt[3] Sqrt[4 p^3 + 27 q^2])^(
     1/3))/(2 2^(1/3) 3^(2/3))}}  *)

Let us take the first of its solutions:

sl[[1, 1, 2]]

(*  -(((2/3)^(1/3) p)/(-9 q + Sqrt[3] Sqrt[4 p^3 + 27 q^2])^(
  1/3)) + (-9 q + Sqrt[3] Sqrt[4 p^3 + 27 q^2])^(1/3)/(
 2^(1/3) 3^(2/3))  *)

To better see it I show below the image of the screen:

enter image description here

Here we need to get rid of the radicals in the denominator of the first term.

Step 1:

slA = sl[[1, 1, 2]] // Simplify

(*  (-2 3^(1/3) p + 2^(1/3) (-9 q + Sqrt[12 p^3 + 81 q^2])^(2/3))/(6^(
 2/3) (-9 q + Sqrt[12 p^3 + 81 q^2])^(1/3))   *)

Now we get the radicals in the common denominator.

Step 2:

slB = Hold[Evaluate[Simplify[Numerator[#]*Denominator[#]^2]]]/
   Denominator[#]^3 &[slA]

(*  Hold[6 6^(1/3) (-9 q + Sqrt[12 p^3 + 81 q^2])^(
  2/3) (-2 3^(1/3) p + 
    2^(1/3) (-9 q + Sqrt[12 p^3 + 81 q^2])^(2/3))]/(36 (-9 q + Sqrt[
   12 p^3 + 81 q^2]))  *)

Now we have only the square root (-9 q + Sqrt[12 p^3 + 81 q^2]) in the denominator. Let us separately multiply the numerator and denominator by (9 q + Sqrt[12 p^3 + 81 q^2]):

Step 3:

Hold[Numerator[slB]*(9 q + Sqrt[12 p^3 + 81 q^2])]/
  Simplify[Denominator[slB]*(9 q + Sqrt[12 p^3 + 81 q^2])] // 
  ReleaseHold // ReleaseHold

(*  ((-9 q + Sqrt[12 p^3 + 81 q^2])^(
 2/3) (9 q + Sqrt[12 p^3 + 81 q^2]) (-2 3^(1/3) p + 
   2^(1/3) (-9 q + Sqrt[12 p^3 + 81 q^2])^(2/3)))/(12 6^(2/3) p^3)  *)

yielding this:

enter image description here

You can, of course, transform the obtained expression according to you liking. For example:

Expand[Simplify[ExpandNumerator[slC]]]

(* (-9 q + Sqrt[12 p^3 + 81 q^2])^(1/3)/(
 2^(1/3) 3^(2/3)) - ((3/2)^(2/3) q (-9 q + Sqrt[12 p^3 + 81 q^2])^(
  2/3))/(2 p^2) - (
 Sqrt[12 p^3 + 81 q^2] (-9 q + Sqrt[12 p^3 + 81 q^2])^(2/3))/(
 6 2^(2/3) 3^(1/3) p^2)  *)

returning this:

enter image description here

If you like this expression better, than the initial one then it's done. Have fun!

$\endgroup$
1
  • $\begingroup$ Wonderful! Thank you! $\endgroup$
    – Shasa
    Commented Jan 11, 2022 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.