Two values of minima of a function by two methods. 
I had a problem of finding minima of a function
  $$f(x)=2^{x^2}-1+\frac{2}{2^{x^2}+1}$$

I solved it using AM-GM inequality,
$$2^{x^2}-1+\frac{2}{2^{x^2}+1}$$
$$2^{x^2}+1+\frac{2}{2^{x^2}+1}-2$$
$$2^{x^2}+1+\frac{2}{2^{x^2}+1}\ge\ 2\sqrt2$$
$$2^{x^2}-1+\frac{2}{2^{x^2}+1}\ge\ 2\sqrt2-2$$
But in the solution answer was given as 1 and it was solved using differentiation,
$$f'(x)=\frac{2x.ln2.2^{x^2}(2^{x^2}+1-\sqrt2)(2^{x^2}+1+\sqrt2)}{(2^{x^2}+1)^2}$$
$$2^{x^2}\ge1$$
$$2^{x^2}+1-\sqrt2\ge2-\sqrt2>0$$
At $x=0$ ,$f(x)$ is least.
Least value = $f(0)$ $=1$ 
I cannot understand how can there be two values by two different methods,please help me in the problem.

The fact is that the equality by AM-GM
$$2^{x^2}+1+\frac{2}{2^{x^2}+1}=\ 2\sqrt2$$
holds if and only if $\exists x$ such that
$$2^{x^2}+1=\frac{2}{2^{x^2}+1}$$
but


*

*$2^{x^2}+1\ge 2$

*$\frac{2}{2^{x^2}+1}\le 1$
therefore the value $2\sqrt 2$ is never reached and the inequality becomes
$$2^{x^2}+1+\frac{2}{2^{x^2}+1}>\ 2\sqrt2$$
