Two different answers by applying AM GM Inequality Find minimum value of $f(x)=\sec^2 x+\csc ^2x$
We have $$f(x)=2+\tan^2 x+\cot ^2 x$$
Method $1.$ we have $$\frac{\tan^2 x+\cot^2 x}{2} \ge 1$$  $\implies$
$$f(x) \ge 4$$
Method $2.$  
We have $$\frac{2+\tan^2 x+\cot^2 x}{3} \ge 2^{\frac{1}{3}}$$  $\implies$
$$f(x) \ge 3(2^{\frac{1}{3}})-2$$
But whats wrong in method $2$?

Because in your second AM-GM the equality should be occur for $2=\tan^2x=\cot^2x,$ which is impossible.
The right way is the following.
By AM-GM
$$f(x)\geq2+2\sqrt{\tan^2x\cot^2x}=2+2=4.$$
The equality occurs for $x=45^{\circ},$ which says that $4$ is a minimal value.
