<s>[INST] What is the minimum value of $a+b+\frac{1}{ab}$ if $a^2 + b^2 = 1$? For the case when $a,b>0,$ I used AM-GM Inequality as follows that:
$\frac{(a+b+\frac{1}{ab})}{3} \geq (ab\frac{1}{ab})^\frac{1}{3}$
This implies that $(a+b+\frac{1}{ab})\geq 3$. Hence, the minimum value of $(a+b+\frac{1}{ab})$ is 3
But the answer is $2+\sqrt{2}$ ... how is it ?
 [/INST] Constrant:
$$q=x^2 +y^2-1=0$$
Goal:
$$ c= x+ y + \frac{1}{xy}$$
Now, by LaGrange multipliers , we can say that:
$$ \nabla q =  \lambda \nabla c$$
Hence,
$$2x  = 1 - \frac{1}{x^2y} \tag{1}$$
$$ 2y = 1- \frac1{y^2 x} \tag{2}$$
By multiplication of $x$ in eqtn (1) and $y$ in eqtn (2):
$$ 2x^2 = x - \frac{1}{xy} \tag{3}$$
$$ 2y^2 = y - \frac{1}{yx} \tag{4}$$
Substract the two equations:
$$ 2(x^2 - y^2) = (x-y)$$
Now, either $x=y$ or $x+y = \frac12$, substitute this into the equation $(x+y)^2 -2xy -1 = 0$ while considering the constraints
$$ 2y^2 =1 \to (x, y)=\{(\frac{1}{\sqrt{2} }, \frac{1}{\sqrt{2} }) \}\tag5$$
$$ (\frac12)^2 -2xy -1 = 0 \to \frac{1}{xy}=-\frac83 \tag6$$
We can check that it is indeed eqtn (5) where the function extremizes with $2+ \sqrt{2}$
</s>