<s>[INST] 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.
 [/INST] 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.
</s>