## Thursday, June 24, 2021

### [lomggtez] solving one solvable quintic with Mathematica

https://en.wikipedia.org/w/index.php?title=Quintic_function&oldid=1020016831#Roots_of_a_solvable_quintic gives the following solvable quintic equation:

g[x_] := x^5 - 5x^4 + 30x^3 - 50x^2 + 55x - 21

this fails to automatically solve, giving results in terms of Root:

Solve[g[x]==0, Cubics->True, Quartics->True]

(unsurprisingly, there is no Quintics option.)

however, the Wikipedia article gives a formula for x1, the sole real root:

e5=2^(1/5)

x1 = 1 + e5 - e5^2 + e5^3 - e5^4

x1 = 1 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5)

x1 ~= 0.603806

confirming algebraically:

g[x1]//FullSimplify
0

next, factor out the given root and solve the resulting quartic equation for the complex roots, which Mathematica can normally do.  however, we need to wrap with the magic function Apart.  without it, Solve fails, giving a result in terms of Root.

Solve[Apart[g[x]/(x-x1)]==0, Cubics->True, Quartics->True]

{{x -> -Sqrt[(5*(-4 + 5/2^(3/5) - 2^(-1/5) - 2^(1/5) + 2*2^(3/5)))/2]/2 + (4 - 2^(1/5) + 2^(2/5) - 2^(3/5) + 2^(4/5))/4 - Sqrt[10 + 5/2^(4/5) - 25/(2*2^(3/5)) + 5/(2*2^(1/5)) - 5*2^(3/5) + (3*(-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))^2)/4 - 6*(6 + 2^(1/5) - 2^(3/5) + 2*2^(4/5)) - (-8*(-20 + 3*2^(1/5) + 3*2^(2/5) - 12*2^(4/5)) + (-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))* (-(-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))^2 + 12*(6 + 2^(1/5) - 2^(3/5) + 2*2^(4/5))))/ (2*Sqrt[10*(-4 + 5/2^(3/5) - 2^(-1/5) - 2^(1/5) + 2*2^(3/5))])]/2},
{x -> -Sqrt[(5*(-4 + 5/2^(3/5) - 2^(-1/5) - 2^(1/5) + 2*2^(3/5)))/2]/2 + (4 - 2^(1/5) + 2^(2/5) - 2^(3/5) + 2^(4/5))/4 + Sqrt[10 + 5/2^(4/5) - 25/(2*2^(3/5)) + 5/(2*2^(1/5)) - 5*2^(3/5) + (3*(-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))^2)/4 - 6*(6 + 2^(1/5) - 2^(3/5) + 2*2^(4/5)) - (-8*(-20 + 3*2^(1/5) + 3*2^(2/5) - 12*2^(4/5)) + (-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))* (-(-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))^2 + 12*(6 + 2^(1/5) - 2^(3/5) + 2*2^(4/5))))/ (2*Sqrt[10*(-4 + 5/2^(3/5) - 2^(-1/5) - 2^(1/5) + 2*2^(3/5))])]/2},
{x -> Sqrt[(5*(-4 + 5/2^(3/5) - 2^(-1/5) - 2^(1/5) + 2*2^(3/5)))/2]/2 + (4 - 2^(1/5) + 2^(2/5) - 2^(3/5) + 2^(4/5))/4 - Sqrt[10 + 5/2^(4/5) - 25/(2*2^(3/5)) + 5/(2*2^(1/5)) - 5*2^(3/5) + (3*(-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))^2)/4 - 6*(6 + 2^(1/5) - 2^(3/5) + 2*2^(4/5)) + (-8*(-20 + 3*2^(1/5) + 3*2^(2/5) - 12*2^(4/5)) + (-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))* (-(-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))^2 + 12*(6 + 2^(1/5) - 2^(3/5) + 2*2^(4/5))))/ (2*Sqrt[10*(-4 + 5/2^(3/5) - 2^(-1/5) - 2^(1/5) + 2*2^(3/5))])]/2},
{x -> Sqrt[(5*(-4 + 5/2^(3/5) - 2^(-1/5) - 2^(1/5) + 2*2^(3/5)))/2]/2 + (4 - 2^(1/5) + 2^(2/5) - 2^(3/5) + 2^(4/5))/4 + Sqrt[10 + 5/2^(4/5) - 25/(2*2^(3/5)) + 5/(2*2^(1/5)) - 5*2^(3/5) + (3*(-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))^2)/4 - 6*(6 + 2^(1/5) - 2^(3/5) + 2*2^(4/5)) + (-8*(-20 + 3*2^(1/5) + 3*2^(2/5) - 12*2^(4/5)) + (-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))* (-(-4 + 2^(1/5) - 2^(2/5) + 2^(3/5) - 2^(4/5))^2 + 12*(6 + 2^(1/5) - 2^(3/5) + 2*2^(4/5))))/ (2*Sqrt[10*(-4 + 5/2^(3/5) - 2^(-1/5) - 2^(1/5) + 2*2^(3/5))])]/2}}

confirming the roots:

m4=Solve[Apart[g[x]/(x-x1)]==0,Cubics->True,Quartics->True]

g[x/.m4[]]//FullSimplify
0

g[x/.m4[]]//FullSimplify
0

g[x/.m4[]]//FullSimplify
0

g[x/.m4[]]//FullSimplify
0

/. is syntactic sugar for the ReplaceAll function, applicable because Solve returns solutions in the form of substitutions x -> y.  double square brackets are syntactic sugar for the Part function.  // is syntactic sugar for postfix function application.

solving for x, extracting solutions with Part, then doing ReplaceAll back into x is a Mathematica idiom.

one can decode syntactic sugar, getting function names that are googleable, with FullForm and Hold:

FullForm[Hold[g[x/.m4[]]//FullSimplify]]

numerically, the solutions are

0.6038058841422905
0.6582013391271546 - 1.0818594930660892*I
0.6582013391271546 + 1.0818594930660892*I
1.5398957188016997 - 4.395040231640411*I
1.5398957188016997 + 4.395040231640411*I