As per me the answer should be $26$.
But when we apply AM-GM inequality it gives $24$ as the least value but as per the graph 24 can never come.
What I think is that in AM-GM, it gives $8 \cos^2 x = 18 \sec^2 x$ which gives $\cos x > 1$ which is not possible and because of this, AM-GM is giving a wrong minimum value.
If we had $18 \cos^2 x + 8 \sec^2 x$, then AM-GM would have worked and $24$ would be a right answer since $18 \cos^2 x = 8 \sec^2 x$, which gives $\cos x < 1$ which is true.
Is this reason correct?
$$8\cos^2(x)+18\sec^2(x)=8\cos^2(x)+8\sec^2(x)+10\sec^2(x)$$
Now, apply $AM-GM$ on the first two terms.
$$\frac{8\cos^2(x)+8\sec^2(x)}{2}\ge\sqrt{8\cos^2(x)\cdot8\sec^2(x)}$$
$$\implies {8\cos^2(x)+8\sec^2(x)}\ge 16$$ at $x=0$
And min of $10\sec^2(x)$ is $10$ at $x=0$. So, the minimum of the net function is $26$ at $x=0$