Find $a^2+b^2+2(a+b)$ minimum if $ab=2$ Let $a,b\in R$,and such 
$$ab=2$$
Find the minimum of the $a^2+b^2+2(a+b)$.
I have used $a=\dfrac{2}{b}$, then
$$a^2+b^2+2(a+b)=\dfrac{4}{b^2}+b^2+\dfrac{4}{b}+2b=f'(b)$$
Let $$f'(b)=0,\,b=-\sqrt{2}$$
So $$a^2+b^2+2(a+b)\ge 4-4\sqrt{2}$$
I wanted to know if there is other way to simplify the function and find the required value without using messy methods. Can we cleanly use AM-GM inequality?

AM-GM inequality is (at least usually) only applied to positive real numbers.
Therefore I first consider the region $a>0,b>0$.
You can also write
$$
\begin{aligned}
f(a,b)&=a^2+b^2+2(a+b)\\
&=(a+b)^2+2(a+b)-2ab\\
&=s^2+2s-4,
\end{aligned}
$$
where $s=a+b$.
By the AM-GM inequality $s\ge 2\sqrt2$ with equality only when $a=b=\sqrt2$.
Here
$$
g(s)=s^2+2s-4
$$
is an increasing function of $s$ in the interval $s\in[2\sqrt2,\infty)$ (this is kinda obvious, but you can also check that $g'(s)>0$ in this interval). Therefore its smallest value is attained at $s=2\sqrt2$.
So if $a$ and $b$ are positive, the smallest value of $f$ is
$$
f(a,b)=f(\sqrt2,\sqrt2)=g(2\sqrt2)=4+4\sqrt2.
$$
The other possibility is that $a<0,b<0$. In that case AM-GM inequality (applied to $-a$ and $-b$) gives that $a+b\le-2\sqrt2$. Because the function
$g(s)$ is decreasing in the interval $s\in(-\infty,-2\sqrt2]$ it attains its smallest value at $s=-2\sqrt2$, i.e. at the point $a=b=-\sqrt2$. So if you allow negative values for $a$ and $b$, then the minimum is 
$$
f(-\sqrt2,-\sqrt2)=4-4\sqrt2
$$
