Solving $\sqrt{x^2+ay^2} - \sqrt{x^2+y^2} = z$ for $x$ Suppose I have an expression as follows
$$\sqrt{x^2+ay^2} - \sqrt{x^2+y^2} = z$$
How would I go about rearranging this to deduce a value for x?
Thanks for the help.
 A: You have a system of two equations
$$\begin{cases}\sqrt{x^2+ay^2}-\sqrt{x^2+y^2} = z \\ \sqrt{x^2+ay^2}+\sqrt{x^2+y^2} 
 = \frac{(a-1)y^2}{z}\end{cases}$$
where the second one is a rationalization of the first. Square both equations and add them
$$4x^2 + 2(a+1)y^2 = z^2 + \frac{(a-1)^2y^4}{z^2} \implies x^2 = \frac{z^2}{4} - \frac{(a+1)y^2}{2}+\frac{(a-1)^2y^4}{4z^2}$$
You can take the positive or negative square root as needed.
A: Bring $\sqrt{x^2+y^2}$ to the right
$\sqrt{x^2+ay^2}=z+\sqrt{x^2+y^2}$
Square both sides
$x^2+ay^2= z^2+2z\sqrt{x^2+y^2}+x^2+y^2$
Get rid of $x^2$ on both sides, group together the $y^2$ terms and bring $z^2$ to the left
$(a-1)y^2-z^2=2z\sqrt{x^2+y^2}$
Square both sides again to get rid of the $\sqrt{}$ sign on the right
$\left((a-1)y^2-z^2\right)^2=4z^2(x^2+y^2)$
...at least that’s how Stewart Calculus does it.
A: Here I propose an alternative way to solve it for the sake of curiosity.
More precisely, what about polar coordinates? If we set $x = r\cos(\theta)$ and $y = r\sin(\theta)$, one gets that
\begin{align*}
\sqrt{x^{2} +  ay^{2}} - \sqrt{x^{2}+y^{2}} = z & \Longleftrightarrow r\sqrt{\cos^{2}(\theta) + a\sin^{2}(\theta)} - r = z\\\\
& \Longleftrightarrow r = \frac{z}{\sqrt{\cos^{2}(\theta) + a\sin^{2}(\theta)} - 1}
\end{align*}
Consequently, one has that
\begin{align*}
y = \frac{z\sin(\theta)}{\sqrt{\cos^{2}(\theta) + a\sin^{2}(\theta)} - 1} & \Rightarrow y\sqrt{\cos^{2}(\theta) + a\sin^{2}(\theta)} = y + z\sin(\theta)\\\\
& \Rightarrow y^{2}(\cos^{2}(\theta) + a\sin^{2}(\theta)) = y^{2} + 2yz\sin(\theta) + z^{2}\sin^{2}(\theta)\\\\
& \Rightarrow y^{2}(1 + a\sin^{2}(\theta)) = y^{2}(1 + \sin^{2}(\theta)) + 2yz\sin(\theta) + z^{2}\sin^{2}(\theta)\\\\
& \Rightarrow a\sin^{2}(\theta)y^{2} = y^{2}\sin^{2}(\theta) + 2yz\sin(\theta) + z^{2}\sin^{2}(\theta)\\\\
& \Rightarrow a\sin(\theta)y^{2} = y^{2}\sin(\theta) + 2yz + z^{2}\sin(\theta)\\\\
& \Rightarrow \sin(\theta)(ay^{2} - y^{2} - z^{2}) = 2yz\\\\
& \Rightarrow \sin(\theta) = \frac{2yz}{y^{2}(a-1) - z^{2}}
\end{align*}
Once you know $\sin(\theta)$, you do also know $\cos(\theta)$. Consequently, we obtain the value of $x$.
It is worth emphasizing that one must check for each values of $\theta$ and $a$ the above-mentioned expressions make sense.
