I was solving a question which required me to find the value of $\theta$ for which the expression $\frac{a}{\cos\theta}+\frac{b}{\sin\theta}$ has its minimum value. Given that, $a=3\sqrt3, b=1$.
Note: It was a fault from my end for not including the values of $a,b$ which were given in the question. I apologize for that.
Since this is a fairly trivial task, I proceeded by using AM-GM inequality which yields the following:
Using AM-GM inequality
$$\frac{a}{\cos\theta}+\frac{b}{\sin\theta} \ge 2\sqrt{\frac{ab}{\cos\theta\sin\theta}}\\ \implies \frac{a}{\cos\theta}+\frac{b}{\sin\theta} \ge 2\sqrt{\frac{2ab}{\sin2\theta}}$$ Since, we're minising the given expression, therefore $\sin2\theta$ should have maximum value, i.e. $\sin2\theta=1$. Therefore, $\theta=\dfrac{\pi}{4}$.
Using calculus
$$\text{Let }f(\theta)=a\sec\theta+b\csc\theta \\ \therefore f'(\theta)=a\sec\theta\tan\theta-b\csc\theta\cot\theta \\ \text{For mininma, }f(\theta)=0, \implies a\sec\theta\tan\theta=b\csc\theta\cot\theta \\ \text{or, }\tan^3\theta=\frac{b}{a}=\frac{1}{3\sqrt3} \\ \implies \theta=\frac{\pi}{6}$$ Why does solving this problem using derivatives yield $\theta=\dfrac{\pi}{6}$. Why is this happening? What should I look out for in the future while deciding whether to use AM-GM or calculus?
Let $y=a\sec t+b\csc t$
$\dfrac{dy}{dt}=a\sec t\tan t-b\csc t\cot t=\dfrac{a\sin^3t-b\cos^3t}{\cos^2t\sin^2t} $
For extreme values of $y,f'(t)=0$
$\implies\tan^3t=\dfrac ba\iff\dfrac a{\cos^3t}=\dfrac b{\sin^3t}=\pm\sqrt{a^{2/3}+b^{2/3}}$
How have you found $t=\dfrac\pi8?$