Tutorials › Calculus I › Variable Powers with Trigonometric Bases

Exponential and Logarithmic Derivatives · Tutorial 548 of 1495

Variable Powers with Trigonometric Bases

Learn to differentiate trigonometric variable powers by taking logarithms, applying the chain rule, and checking the positive-base domain.

Intermediate 9 min read

What You'll Learn

  • Identify where a trigonometric base is positive and the real-valued power is defined.
  • Derive the derivative rule for a positive differentiable base raised to a differentiable exponent.
  • Differentiate powers such as sine raised to cosine using both factor derivatives.
  • Apply the chain rule when trigonometric functions have an inner argument.
  • Recognize and correct the error of ignoring the changing exponent.

Why a Trigonometric Variable Power Needs Care

A function such as \(y=(\sin x)^{\cos x}\) has two changing parts: its base \(\sin x\) varies with \(x\), and its exponent \(\cos x\) varies as well. Differentiating only the base or only the exponent misses part of the change.

There is also a domain condition. For a general real exponent, a real-valued power \(g(x)^{h(x)}\) is defined through the natural logarithm only when \(g(x)>0\). Therefore, the real-valued function \((\sin x)^{\cos x}\) is considered on intervals where \(\sin x>0\), namely \((2k\pi,(2k+1)\pi)\) for integers \(k\).

The central method is to express a positive-base power using the exponential function, take its natural logarithm, and differentiate. This makes the contributions from the changing base and changing exponent visible in a single formula.

The Derivative Rule for a Variable Power

Theorem: Suppose \(g\) and \(h\) are differentiable on an open interval and \(g(x)>0\) throughout that interval. Define \(y=g(x)^{h(x)}\) as a real-valued function. Then $$ y'=g(x)^{h(x)} \left(h'(x)\ln(g(x))+h(x)\frac{g'(x)}{g(x)}\right). $$ The positivity condition is required so that \(\ln(g(x))\) is defined; differentiability of \(g\) and \(h\) supplies the derivatives in the formula.

The formula contains two terms inside the parentheses. The term \(h'(x)\ln(g(x))\) accounts for the changing exponent. The term \(h(x)g'(x)/g(x)\) accounts for the changing base. Neither term can generally be omitted.

Why the Rule Works

Because \(g(x)>0\), the power can be rewritten using the identity \(a^b=\exp(b\ln a)\) for \(a>0\). Thus

$$ y=g(x)^{h(x)}=\exp\bigl(h(x)\ln(g(x))\bigr). $$

Take the natural logarithm of both sides. Then differentiate both sides, using the chain rule and the product rule on \(h(x)\ln(g(x))\):

$$ \begin{aligned} \ln y&=h(x)\ln(g(x)),\\ \frac{y'}{y} &=h'(x)\ln(g(x)) +h(x)\frac{g'(x)}{g(x)}. \end{aligned} $$

Here, the derivative of \(\ln y\) is \(y'/y\), since \(y>0\). Multiplying by \(y\), and then substituting \(y=g(x)^{h(x)}\), gives the stated rule. This derivation also explains the two terms: differentiating the product \(h(x)\ln(g(x))\) produces one term from each factor.

Applying the Rule to Sine Raised to Cosine

For \(y=(\sin x)^{\cos x}\), take \(g(x)=\sin x\) and \(h(x)=\cos x\). On any interval where \(\sin x>0\), we have \(g'(x)=\cos x\) and \(h'(x)=-\sin x\). The general rule gives

$$ \begin{aligned} y' &=(\sin x)^{\cos x} \left(-\sin x\ln(\sin x) +\cos x\frac{\cos x}{\sin x}\right)\\ &=(\sin x)^{\cos x} \left(-\sin x\ln(\sin x) +\frac{\cos^2 x}{\sin x}\right). \end{aligned} $$

Every logarithm in this expression has a positive argument because the formula is being used only where \(\sin x>0\). The factor \(-\sin x\ln(\sin x)\) comes from differentiating the exponent \(\cos x\); the fraction comes from differentiating the base \(\sin x\).

Worked Example: Differentiate \((\sin x)^{\cos x}\) at \(x=\pi/6\)

First, \(\sin(\pi/6)=1/2>0\), so this point lies in the domain interval \((0,\pi)\). The function value is

$$ y\left(\frac{\pi}{6}\right) =\left(\frac12\right)^{\sqrt3/2}. $$

Use the derivative formula. At \(x=\pi/6\), the needed values are \(\sin x=1/2\), \(\cos x=\sqrt3/2\), and \(\ln(\sin x)=\ln(1/2)=-\ln 2\). Therefore, the bracket in the derivative is

$$ \begin{aligned} -\sin x\ln(\sin x)+\frac{\cos^2 x}{\sin x} &=-\frac12(-\ln 2) +\frac{(\sqrt3/2)^2}{1/2}\\ &=\frac12\ln 2+\frac{3/4}{1/2}\\ &=\frac12\ln 2+\frac32. \end{aligned} $$

Hence

$$ y'\left(\frac{\pi}{6}\right) =\left(\frac12\right)^{\sqrt3/2} \left(\frac12\ln 2+\frac32\right). $$

Check by differentiating the logarithmic form: \(\ln y=\cos x\ln(\sin x)\). Its derivative at \(\pi/6\) is \(\frac12\ln 2+\frac32\), exactly the bracket above. Since \(y'/y\) equals this derivative, multiplying by \(y(\pi/6)=(1/2)^{\sqrt3/2}\) gives the same result.

A Different Trigonometric Base

The method is not specific to sine as the base. For \(y=(\cos x)^{\sin x}\), the base must satisfy \(\cos x>0\). This holds on intervals \((-\pi/2+2k\pi,\pi/2+2k\pi)\), where \(k\) is an integer. Taking \(g(x)=\cos x\) and \(h(x)=\sin x\) gives \(g'(x)=-\sin x\) and \(h'(x)=\cos x\), so

$$ y'=(\cos x)^{\sin x} \left(\cos x\ln(\cos x)-\sin x\tan x\right). $$

The minus sign in the second term comes from the derivative of the cosine base. Keeping track of that sign is part of applying the rule correctly.

Worked Example: Differentiate \((\cos x)^{\sin x}\) at \(x=\pi/3\)

Since \(\cos(\pi/3)=1/2>0\), the function is defined there. Its value is

$$ y\left(\frac{\pi}{3}\right) =\left(\frac12\right)^{\sqrt3/2}. $$

At this point, \(\cos x=1/2\), \(\sin x=\sqrt3/2\), \(\ln(\cos x)=-\ln 2\), and \(\tan x=\sqrt3\). Substitute these values into the bracket:

$$ \begin{aligned} \cos x\ln(\cos x)-\sin x\tan x &=\frac12(-\ln 2)-\frac{\sqrt3}{2}\sqrt3\\ &=-\frac12\ln 2-\frac32. \end{aligned} $$

Thus

$$ y'\left(\frac{\pi}{3}\right) =\left(\frac12\right)^{\sqrt3/2} \left(-\frac12\ln 2-\frac32\right). $$

For a check, \(\ln y=\sin x\ln(\cos x)\). Differentiating gives \(\cos x\ln(\cos x)-\sin x\tan x\), whose value at \(\pi/3\) is \(-\frac12\ln 2-\frac32\), as calculated. Multiplying by the function value recovers the derivative above.

When the Trigonometric Argument Is Not Just \(x\)

If a sine or cosine has an inner function, the chain rule applies to both the base and the exponent. For \(y=(\sin(2x))^{\cos(2x)}\), the base is positive wherever \(\sin(2x)>0\). In the general formula, \(g'(x)=2\cos(2x)\) and \(h'(x)=-2\sin(2x)\). Therefore, on any interval where \(\sin(2x)>0\),

$$ y'=(\sin(2x))^{\cos(2x)} \left(-2\sin(2x)\ln(\sin(2x)) +2\cos(2x)\frac{\cos(2x)}{\sin(2x)}\right). $$

The factors of \(2\) arise from differentiating the inner argument \(2x\). Omitting them would ignore the chain rule.

Worked Example: Differentiate \((\sin(2x))^{\cos(2x)}\) at \(x=\pi/12\)

Here \(2x=\pi/6\), so \(\sin(2x)=1/2>0\), and the function value is

$$ y\left(\frac{\pi}{12}\right) =\left(\frac12\right)^{\sqrt3/2}. $$

The bracket in the derivative formula becomes

$$ \begin{aligned} -2\sin(2x)\ln(\sin(2x)) +2\cos(2x)\frac{\cos(2x)}{\sin(2x)} &=-2\left(\frac12\right)(-\ln 2) +2\left(\frac{\sqrt3}{2}\right) \frac{\sqrt3/2}{1/2}\\ &=\ln 2+\sqrt3\cdot\sqrt3\\ &=\ln 2+3. \end{aligned} $$

Consequently,

$$ y'\left(\frac{\pi}{12}\right) =\left(\frac12\right)^{\sqrt3/2}(\ln 2+3). $$

Check using \(\ln y=\cos(2x)\ln(\sin(2x))\). Differentiation gives the same bracket, and at \(x=\pi/12\) its value is \(\ln 2+3\). Multiplying by the original function value confirms the derivative.

A Useful Special Check

At \(x=\pi/2\), \(\sin x=1>0\), so \((\sin x)^{\cos x}\) is defined on a neighborhood of that point. The general derivative formula yields a quick consistency check: \(\ln(\sin(\pi/2))=\ln 1=0\), and \(\cos(\pi/2)=0\). Both terms in the bracket vanish, so the derivative is \(0\). This is consistent with the logarithmic form \(\ln y=\cos x\ln(\sin x)\), whose derivative also vanishes there.

Common Mistake: Differentiating Only the Base

A tempting but incorrect calculation is to treat \((\sin x)^{\cos x}\) as though the exponent were constant. That would give only the base-change term:

$$ \text{Incorrect:}\qquad y'=(\sin x)^{\cos x}\cos x\frac{\cos x}{\sin x}. $$

This leaves out the derivative of the exponent. For example, at \(x=\pi/6\), this incorrect expression gives \((1/2)^{\sqrt3/2}(3/2)\). The correct derivative is \((1/2)^{\sqrt3/2}(3/2+\frac12\ln 2)\), so the omitted term is nonzero.

Correction: For a positive base \(g(x)\) and variable exponent \(h(x)\), differentiate the logarithm \(h(x)\ln(g(x))\) using the product rule. The resulting bracket must include both \(h'(x)\ln(g(x))\) and \(h(x)g'(x)/g(x)\).

Domain and Sign Checks

Before applying the formula, check that the base is positive on the interval under consideration. For \((\sin x)^{\cos x}\), this means restricting to intervals where \(\sin x>0\); for \((\cos x)^{\sin x}\), it means \(\cos x>0\). A formula containing \(\ln(\sin x)\) or \(\ln(\cos x)\) cannot be used where its logarithm has a nonpositive argument.

Also differentiate the exponent carefully. The derivative of \(\cos x\) is \(-\sin x\), while the derivative of \(\sin x\) is \(\cos x\). If the argument is \(u(x)\), then the chain rule supplies the additional factor \(u'(x)\). Keeping the base derivative, exponent derivative, and domain condition visible makes the calculation reliable.

Check Your Understanding

For each problem, first state the condition on the base, then apply the variable-power rule.

  1. On what intervals is \((\sin x)^{\cos x}\) real-valued by the positive-base definition?
  2. Write the derivative of \((\sin x)^{\cos x}\) at an \(x\) where \(\sin x>0\).
  3. For \(y=(\cos x)^{\sin x}\), which term in the derivative contains the derivative of the exponent?
  4. Differentiate \((\sin(3x))^{\cos(3x)}\) on an interval where its base is positive.
  5. Explain why the derivative formula for a positive-base variable power cannot be applied at a point where the base is zero.

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon