# Solve returns complicated and wrong solution

I have the following equation

(8 F (D1 + ((D2 - D1) nf)/n)^3)/(G d^4) == H/n


Solving for $$n_f$$ by hand is simple and gives $$n_f=\frac{n}{\text{D2}-\text{D1}} \left(\frac{H G d^4}{8 F n}^{1/3} -\text{D1} \right)$$ When I run this in Mathematica

Solve[(8 F (D1 + ((D2 - D1) nf)/n)^3)/(G d^4) == H/n, nf, Reals]


I get three very complicated solutions, two of which are imaginary. I know that everything in the equation is real and positive so using this solution's code

Solve[(8 F (D1 + ((D2 - D1) nf)/n)^3)/(G d^4) == H/n, nf, Reals] // ToRadicals // FullSimplify


gives me $$\left\{\left\{\text{nf}\to \frac{\sqrt[3]{-d^4 F^2 G H n^2 (\text{D1}-\text{D2})^6}+2 \text{D1} F n (\text{D1}-\text{D2})^2}{2 F (\text{D1}-\text{D2})^3}\right\}\right\}$$ The issue is that that solution is still wrong and I'm not sure if I'm making a mistake or Mathematica is. I tried comparing the two solutions with

(2 D1 (D1 - D2)^2 F n + (-d^4 (D1 - D2)^6 F^2 G H n^2)^(1/3))/(2 (D1 - D2)^3 F) == n/(D2 - D1) (((H G d^4)/(8 F n))^(1/3) - D1)


but they are not the same. This is a simple equation but I need to do the same process for $$\frac{F \left(\frac{n_f (D2-D1)}{n}+D1\right)^2 \sqrt{\pi ^2 \left(\frac{n_f (D2-D1)}{n}+D1\right)^2+P^2}}{GJ}=\frac{H}{n}$$ so I would like to understand what is happening before I attempt it. I also tried quitting the local kernel and following the advice on this other post but to no avail.

• "I get three very complicated solutions, two of which are imaginary." - Are you perhaps aware of casus irreducibilis? – J. M.'s ennui Nov 15 '19 at 9:43
• I was not, so that's why Mathematica was giving me three answers. – enea19 Nov 15 '19 at 10:00

With version 12 I get a single solution

Clear["Global*"]

\$Version

(* "12.0.0 for Mac OS X x86 (64-bit) (April 7, 2019)" *)

eqn = (8 F (D1 + ((D2 - D1) nf)/n)^3)/(G d^4) == H/n;

sol = Solve[eqn, nf, Reals]

(* {{nf -> Root[
d^4 G H n^2 -
8 D1^3 F n^3 + (24 D1^3 F n^2 - 24 D1^2 D2 F n^2) #1 + (-24 D1^3 F n +
48 D1^2 D2 F n - 24 D1 D2^2 F n) #1^2 + (8 D1^3 F - 24 D1^2 D2 F +
24 D1 D2^2 F - 8 D2^3 F) #1^3 &, 1]}} *)


Verifying the solution

eqn /. sol[[1]] // Simplify

(* True *)


The solution is given as a Root object. Low-order Root expressions can be converted to radical expressions using ToRadicals

solr = sol[[1]] // ToRadicals // FullSimplify

(* {nf -> (2 D1 (D1 - D2)^2 F n + (-d^4 (D1 - D2)^6 F^2 G H n^2)^(1/3))/(
2 (D1 - D2)^3 F)} *)


Verifying that solr satisfies eqn

eqn /. solr // Simplify

(* True *)
`
• Working through your solution I realized that I was comparing the solution to only the lhs of eqn. Corrected it and now it works. – enea19 Nov 16 '19 at 3:46