For $x, y \in \mathbb R$, find the maximum of $$P=\frac{2xy(xy+1)+(x+y)(xy-1)}{(1+x^2)(1+y^2)}$$
This is my attempt:
We set $(u;v)=(x+y;xy)$ with condition $u^2\ge 4v$.
So we have $P=\frac{2v(v+1)+u(v-1)}{u^2+(v-1)^2}$
but I don't know how we can go to the last solution
The hint.
If $x=y$ we obtain a value $\frac{4+3\sqrt3}{4},$ where the equality occurs for $x=2+\sqrt3.$
Thus, it's enough to prove that $$\frac{2xy(xy+1)+(x+y)(xy-1)}{(1+x^2)(1+y^2)}\leq\frac{4+3\sqrt3}{4},$$ which is a quadratic inequality of $y$