Calculus · real student question

Use logarithmic differentiation to find the derivative of y = (sin x)^(cos x).

Question

Use logarithmic differentiation to find the derivative of

y=(sinx)cosxy = (\sin x)^{\cos x}

Step-by-step solution

  1. See why the ordinary rules fail. The power rule ddxun=nun1u\frac{d}{dx}u^n = nu^{n-1}u' needs a constant exponent, and the exponential rule ddxau=aulnau\frac{d}{dx}a^u = a^u \ln a \cdot u' needs a constant base. Here both base and exponent vary, so neither applies and logarithmic differentiation is the right tool.

  2. Take the natural logarithm of both sides. The log turns the exponent into a factor:

    lny=cosxln(sinx)\ln y = \cos x \cdot \ln(\sin x)

    This is valid on intervals where sinx>0\sin x > 0, for example 0<x<π0 < x < \pi, which is also where the original expression is defined for arbitrary real exponents.

  3. Differentiate both sides implicitly. On the left, the chain rule gives yy\dfrac{y'}{y}. On the right, use the product rule on cosx\cos x and ln(sinx)\ln(\sin x):

    yy=(sinx)ln(sinx)+cosxcosxsinx\frac{y'}{y} = (-\sin x)\ln(\sin x) + \cos x \cdot \frac{\cos x}{\sin x}

    The derivative of ln(sinx)\ln(\sin x) is cosxsinx=cotx\dfrac{\cos x}{\sin x} = \cot x by the chain rule — this is the term most often dropped.

  4. Tidy the right-hand side.

    yy=cos2xsinxsinxln(sinx)\frac{y'}{y} = \frac{\cos^2 x}{\sin x} - \sin x \ln(\sin x)

  5. Multiply back by yy. Replace yy by the original expression — leaving the answer in terms of yy is incomplete:

    y=(sinx)cosx(cos2xsinxsinxln(sinx))y' = (\sin x)^{\cos x}\left(\frac{\cos^2 x}{\sin x} - \sin x \ln(\sin x)\right)

    Equivalently, y=(sinx)cosx(cosxcotxsinxlnsinx)y' = (\sin x)^{\cos x}\bigl(\cos x \cot x - \sin x \ln \sin x\bigr).

  6. Verify at a convenient point. At x=π4x = \tfrac{\pi}{4}: sinx=cosx=22=0.707107\sin x = \cos x = \tfrac{\sqrt2}{2} = 0.707107, so (sinx)cosx=0.7071070.707107=0.782100(\sin x)^{\cos x} = 0.707107^{0.707107} = 0.782100. The bracket is 0.50.7071070.707107ln(0.707107)=0.707107+0.245095=0.952202\dfrac{0.5}{0.707107} - 0.707107\ln(0.707107) = 0.707107 + 0.245095 = 0.952202. Their product is 0.7447160.744716. A symbolic derivative evaluated at π4\tfrac{\pi}{4} gives 0.7452210.745221 — the small gap is only the rounding in the hand figures above; carrying more digits (0.7821020×0.95284820.7821020 \times 0.9528482) reproduces 0.74522070.7452207 ✓.

Answer

y=(sinx)cosx(cos2xsinxsinxln(sinx))y' = (\sin x)^{\cos x}\left(\frac{\cos^2 x}{\sin x} - \sin x \ln(\sin x)\right)

Need to solve a different problem like this? Open the solver →