I have two functions:
$$ f_{-}(x) = \frac{F^2 + P ⋅ Z + Z^2 + (P^2 + P ⋅ Z + (x ⋅ Z)^2) ⋅ \left(1 + \frac{2 ⋅ F}{\sqrt{P^2 + (x ⋅ Z)^2}}\right)}{(A ⋅ Z)^2} - 1, P < 0 $$ $$ f_{+}(x) = \frac{F^2 + P ⋅ Z + Z^2 + (P^2 + P ⋅ Z + (x ⋅ Z)^2) ⋅ \left(1 - \frac{2 ⋅ F}{\sqrt{P^2 + (x ⋅ Z)^2}}\right)}{(A ⋅ Z)^2} - 1, P > 0 $$
where $A$, $F$, and $Z$ are positive real numbers, and $P$ is a nonzero real number whose sign determines which function applies.
Both functions have two real roots when the sign of $P$ fits their condition. I want to find these roots. However, WolframAlpha won't give an answer, and my algebra knowledge hasn't been up to figuring out how to solve this by hand.
Is it possible to find closed-form expressions for the real roots of these functions? If so, how do I go about it?
Edit with complete solution based on Claude Leibovici's answer
First multiply both sides by $(A ⋅ Z)^2$ to clear the outer denominator, giving
$$ F^2 + P ⋅ Z + Z^2 + (P^2 + P ⋅ Z + (x ⋅ Z)^2) ⋅ \left(1 + \frac{2 ⋅ F}{\sqrt{P^2 + (x ⋅ Z)^2}}\right) - (A ⋅ Z)^2 = 0 $$
Next substitute $x^2 = \frac{t^2 - P^2}{Z^2}$, giving
$$ F^2 + P ⋅ Z + Z^2 + (P ⋅ Z + t^2) ⋅ \left(1 + \frac{2 ⋅ F}{t}\right) - (A ⋅ Z)^2 = 0 $$
Multiply both sides by $t$ to clear the remaining denominator, expand, and group $t$s to get
$$ t^3 + (2 ⋅ F) ⋅ t^2 + (F^2 - Z ⋅ (Z ⋅ (A^2 - 1) - 2 ⋅ P)) ⋅ t + 2 ⋅ F ⋅ P ⋅ Z = 0 $$
This is a cubic in standard form $a ⋅ t^3 + b ⋅ t^2 + c ⋅ t + d = 0$ with
- $a = 1$,
- $b = 2 ⋅ F$,
- $c = F^2 + 2 ⋅ P ⋅ Z - (A^2 - 1) ⋅ Z^2$, and
- $d = 2 ⋅ F ⋅ P ⋅ Z$
To solve, first convert it to a depressed cubic $u^3 + p ⋅ u + q = 0$ where
- $u = t + \frac{b}{3 ⋅ a}$
- $p = \frac{3 ⋅ a ⋅ c - b^2}{3 ⋅ a^2}$
- $q = \frac{2 ⋅ b^3 - 9 ⋅ a ⋅ b ⋅ c + 27 ⋅ a^2 ⋅ d}{27 ⋅ a^3}$
Substituting in the values of $a$ through $d$ gives
- $u = t + \frac{2}{3} ⋅ F$
- $p = 3 ⋅ P ⋅ Z - \left(\frac{2}{3} ⋅ F\right)^2 - \left(P ⋅ Z + (A^2 - 1) ⋅ Z^2 - \left(\frac{1}{3} ⋅ F\right)^2\right)$
- $q = \frac{2}{3} ⋅ F ⋅ \left(P ⋅ Z + (A^2 - 1) ⋅ Z^2 - \left(\frac{1}{3} ⋅ F\right)^2\right)$
Using the trigonometric solutions to a depressed cubic, we get
$$ u = \begin{cases} 2 ⋅ \sqrt{-\frac{p}{3}} ⋅ \cos\left(\frac{1}{3} ⋅ \arccos\left(\frac{-\frac{q}{2}}{\sqrt{-\left(\frac{p}{3}\right)^3}}\right)\right) & : \left(\frac{q}{2}\right)^2 + \left(\frac{p}{3}\right)^3 < 0 \\ -2 ⋅ \sqrt[3]{\frac{q}{2}} & : \left(\frac{q}{2}\right)^2 + \left(\frac{p}{3}\right)^3 ≟ 0 \\ -2 ⋅ \operatorname{sgn}(q) ⋅ \sqrt{\operatorname{abs}\left(\frac{p}{3}\right)} ⋅ \cosh\left(\frac{1}{3} ⋅ \operatorname{arcosh}\left(\frac{\operatorname{abs}\left(\frac{q}{2}\right)}{\sqrt{\operatorname{abs}\left(\frac{p}{3}\right)^3}}\right)\right) & : p < 0 \\ -\sqrt[3]{q} & : p ≟ 0 \\ -2 ⋅ \sqrt{\frac{p}{3}} ⋅ \sinh\left(\frac{1}{3} ⋅ \operatorname{arsinh}\left(\frac{\frac{q}{2}}{\sqrt{\left(\frac{p}{3}\right)^3}}\right)\right) & : 0 < p \end{cases} $$
Alternatively, Cardano's formula says that the real solution to this depressed cubic is
$$ u = \sqrt[3]{-\frac{q}{2} + \sqrt{\left(\frac{q}{2}\right)^2 + \left(\frac{p}{3}\right)^3}} + \sqrt[3]{-\frac{q}{2} - \sqrt{\left(\frac{q}{2}\right)^2 + \left(\frac{p}{3}\right)^3}} $$
Defining the new variable $B := P ⋅ Z + (A^2 - 1) ⋅ Z^2 - \left(\frac{1}{3} ⋅ F\right)^2$ for brevity and substituting the definitions of $p$ and $q$, we get
$$ u\,=\,\begin{cases} 2 ⋅ \sqrt{-P ⋅ Z + \frac{\left(\frac{2}{3} ⋅ F\right)^2 - B}{3}} ⋅ \cos\left(\frac{1}{3} ⋅ \arccos\left(\frac{-\frac{F ⋅ B}{3}}{\sqrt{-\left(P ⋅ Z - \frac{\left(\frac{2}{3} ⋅ F\right)^2 - B}{3}\right)^3}}\right)\right) & : \left(\frac{F ⋅ B}{3}\right)^2 + \left(P ⋅ Z - \frac{\left(\frac{2}{3} ⋅ F\right)^2 - B}{3}\right)^3 < 0 \\ -2 ⋅ \sqrt[3]{\frac{F ⋅ B}{3}} & : \left(\frac{F ⋅ B}{3}\right)^2 + \left(P ⋅ Z - \frac{\left(\frac{2}{3} ⋅ F\right)^2 - B}{3}\right)^3 ≟ 0 \\ -2 ⋅ \operatorname{sgn}(\frac{2}{3} ⋅ F ⋅ B) ⋅ \sqrt{\operatorname{abs}\left(P ⋅ Z - \frac{\left(\frac{2}{3} ⋅ F\right)^2 - B}{3}\right)} ⋅ \cosh\left(\frac{1}{3} ⋅ \operatorname{arcosh}\left(\frac{\operatorname{abs}\left(\frac{F ⋅ B}{3}\right)}{\sqrt{\operatorname{abs}\left(P ⋅ Z - \frac{\left(\frac{2}{3} ⋅ F\right)^2 - B}{3}\right)^3}}\right)\right) & : 3 ⋅ P ⋅ Z - \left(\frac{2}{3} ⋅ F\right)^2 - B < 0 \\ -\sqrt[3]{\frac{2}{3} ⋅ F ⋅ B} & : 3 ⋅ P ⋅ Z - \left(\frac{2}{3} ⋅ F\right)^2 - B ≟ 0 \\ -2 ⋅ \sqrt{P ⋅ Z - \frac{\left(\frac{2}{3} ⋅ F\right)^2 - B}{3}} ⋅ \sinh\left(\frac{1}{3} ⋅ \operatorname{arsinh}\left(\frac{\frac{F ⋅ B}{3}}{\sqrt{\left(P ⋅ Z - \frac{\left(\frac{2}{3} ⋅ F\right)^2 - B}{3}\right)^3}}\right)\right) & : 0 < 3 ⋅ P ⋅ Z - \left(\frac{2}{3} ⋅ F\right)^2 - B \end{cases} $$ or $$ u = \sqrt[3]{-\frac{F ⋅ B}{3} + \sqrt{\left(\frac{F ⋅ B}{3}\right)^2 + \left(P ⋅ Z - \frac{\left(\frac{2}{3} ⋅ F\right)^2 - B}{3}\right)^3}}\\ + \sqrt[3]{-\frac{F ⋅ B}{3} - \sqrt{\left(\frac{F ⋅ B}{3}\right)^2 + \left(P ⋅ Z - \frac{\left(\frac{2}{3} ⋅ F\right)^2 - B}{3}\right)^3}} $$
Finally, we get the roots in $x$ with the expression
$$ x = ±\sqrt{\frac{\left(u - \frac{2}{3} ⋅ F\right)^2 - P^2}{Z^2}} $$
The result is the same regardless of the sign of $P$.
Using the expression you gave in comments
(F^2 + ((-Q^2)^2 + (-Q^2)*z + (x*z)^2)*(1 + 2*F/Sqrt[(-Q^2)^2 + (x*z)^2]) + (-Q^2)*z + z^2)/(z*A)^2 - 1reduce to same denominator first.
Now, let $x^2=\frac{t^4-Q^4}{z^2}$ and remove the denominator to end with $$t^6+2 F t^4+ \left(\left(1-A^2\right) z^2+F^2-2 Q^2 z\right)t^2-2 F Q^2 z=0$$ which is a cubic equation in $t^2$ which can be solved explicitly using the trigonometric/hyperbolic solution.