I want to maximize the following function $$f(x,y)=\frac{(x+y)^2}{x^2+y^2}$$ over $\mathbb{R}$. Equating its gradient to zero gives $$\nabla f(x,y)=0\Rightarrow x=y$$
Then, I used Wolfram to compute its Hessian $H$, here. Substituting $x=y$ into $H$, I saw that $H_{11}=-\frac{1}{x^2}<0$ and that the determinant of $H$ is zero (see previous link). Hence, according to here, the test is inconclusive and the point might be minimum, maximum or saddle point. But again according to Wolfram it is actually a maximum and equals 2 (see here). How can I show this?
HINT: prove that $$\frac{(x+y)^2}{x^2+y^2}\le 2$$ Multiplying by $$x^2+y^2$$ we get $$(x+y)^2\le 2(x^2+y^2)$$ Multiplying out: $$x^2+2xy+y^2\le 2x^2+2y^2$$ subtracting $$x^2+y^2+2xy$$ on both sides: $$0\le x^2+y^2-2xy=(x-y)^2$$ which is true. P.s.: it is $$(x-y)^2\geq 0$$