[Math] Maximum value of a function. I am not able to check double derivative.

calculusmaxima-minima

Can someone explain me how $\sin^p x \cos^q x$ attains maximum at $\tan^2 x = \frac pq$.

I am not able to check whether double derivative is positive or negative.

Question

Show that $$\sin^p\theta\cos^q\theta$$ attains a maximum when $$\theta=\tan^{-1}\sqrt{(p/q)}$$

Solution

Ley $y=\sin^p\theta\cos^q\theta$. For a maximum or minimum of $y$, we have $\frac{\text dy}{\text dx}=0$

\begin{align}p\sin^{p-1}\theta\cos^{q+1}\theta-q\sin^{p+1}\theta\cos^{q-1}\theta&=0\\
\sin^{p-1}\theta\cos^{q-1}\theta(p\cos^2\theta-q\sin^2\theta)&=0\end{align}

Therefore \begin{align}\sin\theta&=0\\
&\Downarrow\\
\theta&=0\\
\text{or } \cos\theta&=0\\
&\Downarrow\\
\theta&=\frac \pi 2\\
\text{or }\tan^2\theta&=\frac pq\\
&\Downarrow\\
\theta&=\tan^{-1}\sqrt{p/q}\end{align}

Now $y=0$ at $\theta=0$ and also at $\theta=\frac\pi2$

When $0<\theta<\frac\pi2$, $y$ is positive

Also, $\tan^{-1}\sqrt{p/q}$ is the only value of $\theta$ lying between $0$ and $\frac \pi2$ at which $\frac{\text d}{\text dx}=0$.

Hence $y$ is maximum when $$\theta=\tan^{-1}\sqrt{p/q}$$

This can be seen from the graph of $y$

Best Answer

This is a nice application of logarithmic differentiation.

Consider $$f=\sin^p(x) \cos^q(x)\implies \log(f)=p \log(\sin(x))+q \log(\cos(x))$$ Differentiate both sides $$\frac{f'}f=p \cot(x)-q \tan(x)=\frac{p-q \tan^2(x)}{\tan(x)}$$ and then the conditions for an extremum as already given in answers.

But, we need to check the second derivative : start with $$f'=f \left(\frac{f'}f \right)$$ and differentiate using the product rule $$f''=f'\left(\frac{f'}f\right)+f \left(\frac{f'}f \right)'$$ But, at the extremum $f'=0$ which reduces the problem to the sign of $$f \left(\frac{f'}f \right)'=-f\,(p \csc ^2(x)+q \sec ^2(x))$$

Edit

If you want to continue with some fun, using $$\sin(\tan^{-1}(t))=\frac{t}{\sqrt{t^2+1}}\qquad \cos(\tan^{-1}(t))=\frac{1}{\sqrt{t^2+1}}$$ and replacing $t$ by $\sqrt{\frac{p}{q}}$ the maximum value of $f$ is given by $$f_{max}=\sqrt{\frac{p^p \, q^q}{(p+q)^{(p+q)}}}$$

As said in comments, this works for any value of $p>0$, $q>0$, $p$ and $q$ being integers, rational or non rational numbers.

Considering the case where $p+q=k$, using again logarithmic differentiation we should find that $$\frac{f'_{max}}{f_{max}}=\frac 12 \log \left(\frac{p}{k-p}\right)$$ which is positive if $p>\frac k 2$ and negative otherwise.

Related Question