<s>[INST] Solve the equation for x, y and z: $\sqrt{x-y+z}=\sqrt x - \sqrt y + \sqrt z$ I am having some trouble with this problem,

Solve for $x,y,$ and $z$.
  $$\sqrt{x-y+z}=\sqrt x - \sqrt y + \sqrt z$$

Here is my work so far,
$$x - y +z = x+y+z-2\sqrt{xy} + 2\sqrt{xz}- 2\sqrt{zy}$$
$$2y-2\sqrt{xy} + 2\sqrt{xz}- 2\sqrt{zy} = 0 $$
$$2(y-\sqrt{xy} + \sqrt{xz} - \sqrt{zy}) = 0 $$
$$y-\sqrt{xy} + \sqrt{xz} - \sqrt{zy} = 0$$
 [/INST] Your last equation can be written as
$$ \sqrt{zx} = \sqrt{y} \left[ \sqrt{x} - \sqrt{y} + \sqrt{z} \right] = \sqrt{y} \sqrt{ x-y+z} $$
Squaring both sides gives us
$$ zx = xy - y^2 + zy $$
Which simplifies to $$(y-x)(y-z) = 0 $$
Hence, we require $x=y$ or $y=z$. It is clear that in either case, the equation is satisfied.
</s>