<s>[INST] Maximum and minimum of $z=\frac{1+x-y}{\sqrt{1+x^2+y^2}}$ Find the maximum and minimum of the function
$$z=\frac{1+x-y}{\sqrt{1+x^2+y^2}}$$
I have calculated 
$\frac{\partial z}{\partial x}=\frac{1+y^2+xy-x}{(1+x^2+y^2)^{\frac{3}{2}}}$
$\frac{\partial z}{\partial y}=\frac{-1-x^2-xy-y}{(1+x^2+y^2)^{\frac{3}{2}}}$
I have problem to solve the system of equations:
$$1+y^2+xy-x=0$$
$$1+x^2+xy+y=0$$
 [/INST] $z^2 = \dfrac{(1+x+(-y))^2}{1+x^2+(-y)^2} \leq 3$ because $(1-x)^2 + (x+y)^2 +(y+1)^2 \geq 0$.
The second inequality becomes $ = $ when $x = 1, y = -1$. From this we have: $z_\text{min} = -\sqrt{3}$, and $z_\text{max} = \sqrt{3}$.
Note: The CS inequality is: $(a_1b_1 + a_2b_2 +a_3b_3)^2 \leq (a_1^2+a_2^2+a_3^2)(b_1^2+b_2^2+b_3^2)$ with equality when $\dfrac{a_1}{b_1} = \dfrac{a_2}{b_2} = \dfrac{a_3}{b_3}$. Apply it with $a_1 = a_2 = a_3 =1$, and $b_1 = 1, b_2 = x, b_3 = -y$.
</s>