<s>[INST] find the maximum of $x+\frac{1}{2y}$ under the condition $(2xy-1)^2=(5y+2)(y-2)$ Assume $x,y \in \mathbb{R}^+$ and satisfy $$\left(2xy-1\right)^2 = (5y+2)(y-2)$$, find the maximum of the expression $x+\frac{1}{2y}$.
$\because (5y+2)(y-2) \geq 0$ , $\therefore y\geq 2$ or $y \leq -\frac{2}{5}$, and we have $$2xy = \sqrt{(5y+2)(y-2)}+1$$
then $f(x,y)=x+\frac{1}{2y}=\frac{2xy+1}{2y}=\frac{\sqrt{(5y+2)(y-2)}+2}{2y}=g(y)$,$$\therefore g'(y) = \frac{2 + 2 y - \sqrt{-4 - 8 y + 5 y^2}}{y^2 \sqrt{-4 - 8 y + 5 y^2}}$$
and $2+2y = \sqrt{5y^2-8y-4} \Rightarrow y = 8+6\sqrt{2}$, with the help of graphing calculator ,i know this is the maximum point.  $$\therefore f_{\text{max}}(x,y)=g(8+6\sqrt{2})=\frac{3\sqrt{2}}{2}-1$$
Is there any other way to work out it?
 [/INST] there is another way to solve it, I copy it from internet, but I don't know how to find this method.
first to deformation the algebraic expression: $$(2xy-1)^2=(5y+2)(y-2)\iff (2xy-1)^2 = 9y^2-4y^2-8y-4\iff (2xy-1)^2+(2y+2)^2=9y^2$$
then we have $$\left(2x-\frac{1}{y}\right)^2+\left(2+\frac{1}{y}\right)^2=9$$
and $$x+\frac{1}{2y}=\frac{1}{2}\left(2x+\frac{1}{y}\right)=\frac{1}{2}\left(2x-\frac{1}{y}+\frac{2}{y}+2\right)-1 \leq \frac{1}{2}\sqrt{2\left[\left(2x-\frac{1}{y}\right)^2+\left(\frac{2}{y}+2\right)^2\right]}-1=\frac{1}{2}\sqrt{2\times 9}-1=\frac{3\sqrt{2}}{2}-1$$
</s>