Class 12 Maths, Worked in Full Past papersGet updates
Chapter 5 · Continuity and Differentiability

Example 41: f′(x)f'(x) for f(x)=(sin⁡x)sin⁡xf(x) = (\sin x)^{\sin x}⁠, 0<x<π0 < x < \pi

ExamplesLogarithmic differentiation · Miscellaneous Examples
The question

Find f′(x)f'(x) if f(x)=(sin⁡x)sin⁡xf(x) = (\sin x)^{\sin x} for all 0<x<π0 < x < \pi⁠.

Exam answer

Let y=(sin⁡x)sin⁡xy = (\sin x)^{\sin x}⁠, 0<x<π0 < x < \pi⁠.

Taking log on both sides,

log⁡y=sin⁡x log⁡(sin⁡x)\log y = \sin x\,\log(\sin x)

Differentiating both sides w.r.t. xx⁠,

1ydydx=cos⁡xlog⁡(sin⁡x)+sin⁡x⋅cos⁡xsin⁡x=(1+log⁡(sin⁡x))cos⁡x\begin{aligned} \frac1y\frac{dy}{dx} &= \cos x\log(\sin x) \\ &\quad + \sin x\cdot\frac{\cos x}{\sin x} \\ &= (1 + \log(\sin x))\cos x \end{aligned} ∴ dydx=y (1+log⁡(sin⁡x))cos⁡x\therefore\ \frac{dy}{dx} = y\,(1 + \log(\sin x))\cos x

∴ f′(x)=(sin⁡x)sin⁡x\therefore\ f'(x) = (\sin x)^{\sin x} × (1+log⁡(sin⁡x))cos⁡x\times\,(1 + \log(\sin x))\cos x⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Here both the base and the exponent change with xx. Neither the power rule (fixed exponent) nor the rule for axa^x (fixed base) applies. Taking logarithms brings the exponent down as a factor, log⁡y=sin⁡x log⁡(sin⁡x)\log y = \sin x\,\log(\sin x)⁠, and that product can be differentiated with ordinary rules. This is logarithmic differentiation, and it is allowed because sin⁡x>0\sin x > 0 on (0,π)(0,\pi)⁠.

Given, to find, and the plan
Given
y=f(x)=(sin⁡x)sin⁡xy = f(x) = (\sin x)^{\sin x} for 0<x<π0 < x < \pi⁠.
To find
f′(x)=dydxf'(x) = \dfrac{dy}{dx}⁠.
Plan
Check that the base is positive; take natural logarithms; differentiate both sides (chain rule on the left, product and chain rules on the right); multiply by yy⁠.

Basics you need

1Logarithm of a power

For p>0p > 0⁠: log⁡(pq)=qlog⁡p\log(p^q) = q\log p⁠. The logarithm turns an exponent into a multiplier (Section 5.4). Basics: exponentials and logarithms

2Logarithmic differentiation

For y=[u(x)]v(x)y = [u(x)]^{v(x)} with u>0u > 0⁠: log⁡y=vlog⁡u\log y = v\log u⁠, then differentiate both sides with respect to xx (Section 5.5). Lesson: logarithmic differentiation

3Differentiating log⁡y\log y when yy depends on xx

By the chain rule, ddx(log⁡y)=1y⋅dydx\frac{d}{dx}(\log y) = \frac{1}{y}\cdot\frac{dy}{dx}⁠. Lesson: the chain rule

4Product rule

(uv)′=u′v+uv′(uv)' = u'v + uv' (rule (2), Section 5.3). Basics: derivative rules

Solution

  1. Check that the base is positive

    For 0<x<π0 < x < \pi⁠, 0<sin⁡x≤10 < \sin x \le 1⁠. So the base sin⁡x\sin x is positive, y=(sin⁡x)sin⁡xy = (\sin x)^{\sin x} is a well-defined positive number, and log⁡y\log y and log⁡(sin⁡x)\log(\sin x) both exist.

    A real power pqp^q with a non-integer exponent is defined only for p>0p > 0⁠, and the logarithm needs a positive input. The interval 0<x<π0 < x < \pi in the question is exactly what makes the method legal. (The textbook says the function "is defined for all positive real numbers". What matters is that the base sin⁡x\sin x is positive; that holds on (0,π)(0,\pi) but not for every positive xx⁠: on (π,2π)(\pi, 2\pi)⁠, for example, sin⁡x<0\sin x < 0 and the logarithm step fails.)
    sin⁡x>0\sin x > 0 for 0<x<π0 < x < \pi (the upper half of the unit circle). Basics: trigonometric identities
  2. Take logarithms

    log⁡y=log⁡[(sin⁡x)sin⁡x]=sin⁡x log⁡(sin⁡x).\begin{aligned} \log y &= \log\left[(\sin x)^{\sin x}\right] \\ &= \sin x\,\log(\sin x). \end{aligned}
    The exponent sin⁡x\sin x moves down in front of the logarithm. The right side is now a product of two functions of xx⁠, which the product rule can handle.
    log⁡(pq)=qlog⁡p\log(p^q) = q\log p for p>0p > 0⁠, here with p=q=sin⁡xp = q = \sin x⁠. Basics: exponentials and logarithms
  3. Differentiate the left side

    ddx(log⁡y)=1y dydx.\frac{d}{dx}(\log y) = \frac{1}{y}\,\frac{dy}{dx}.
    log⁡y\log y is a composite: yy is a function of xx and log⁡\log is applied to it. Chain rule: (derivative of log⁡\log at yy⁠) times dydx\frac{dy}{dx}⁠.
    Theorem 5 (2), Section 5.4: (log⁡y)′=1y(\log y)' = \frac1y with respect to yy⁠; chain rule, Theorem 4. Lesson: the chain rule
  4. Differentiate the right side (product rule)

    Let u=sin⁡xu = \sin x and w=log⁡(sin⁡x)w = \log(\sin x)⁠. Then u′=cos⁡xu' = \cos x⁠, and by the chain rule w′=1sin⁡x⋅cos⁡xw' = \frac{1}{\sin x}\cdot\cos x⁠. So

    ddx(sin⁡xlog⁡(sin⁡x))=u′w+uw′=cos⁡xlog⁡(sin⁡x)+sin⁡x⋅cos⁡xsin⁡x=cos⁡xlog⁡(sin⁡x)+cos⁡x=(1+log⁡(sin⁡x))cos⁡x.\begin{aligned} \frac{d}{dx}\big(\sin x\log(\sin x)\big) &= u'w + uw' \\ &= \cos x\log(\sin x) + \sin x\cdot\frac{\cos x}{\sin x} \\ &= \cos x\log(\sin x) + \cos x \\ &= (1 + \log(\sin x))\cos x. \end{aligned}
    The product rule differentiates one factor at a time. In the second term sin⁡x\sin x cancels (allowed, since sin⁡x≠0\sin x \ne 0 on (0,π)(0,\pi)⁠). Finally cos⁡x\cos x is a common factor of both terms.
    Product rule (2), Section 5.3; (log⁡s)′=1s(\log s)' = \frac1s with s=sin⁡xs = \sin x (Theorem 5 and chain rule). Basics: derivative rules
  5. Solve for dydx\frac{dy}{dx}

    Equating the two sides, 1ydydx=(1+log⁡(sin⁡x))cos⁡x\frac1y\frac{dy}{dx} = (1 + \log(\sin x))\cos x⁠. Multiply by y=(sin⁡x)sin⁡xy = (\sin x)^{\sin x}⁠:

    dydx=(1+log⁡(sin⁡x)) (sin⁡x)sin⁡xcos⁡x.\frac{dy}{dx} = (1 + \log(\sin x))\,(\sin x)^{\sin x}\cos x.
    Logarithmic differentiation always ends this way: the left side was 1ydydx\frac1y\frac{dy}{dx}⁠, so we multiply by yy and replace yy by its formula so that the answer is in terms of xx alone.
    Since both sides of log⁡y=sin⁡xlog⁡(sin⁡x)\log y = \sin x\log(\sin x) are equal for every xx in (0,π)(0,\pi)⁠, their derivatives are equal too. Lesson: logarithmic differentiation
  6. An alternative route, and what the answer shows

    Since sin⁡x>0\sin x > 0⁠, y=esin⁡xlog⁡(sin⁡x)y = e^{\sin x\log(\sin x)}⁠. Differentiating with the chain rule (outer ewe^w⁠, inner w=sin⁡xlog⁡(sin⁡x)w = \sin x\log(\sin x)⁠, whose derivative is Step 4) gives

    y′=esin⁡xlog⁡(sin⁡x)⋅(1+log⁡(sin⁡x))cos⁡x=(sin⁡x)sin⁡x(1+log⁡(sin⁡x))cos⁡x,\begin{aligned} y' &= e^{\sin x\log(\sin x)} \\ &\quad\cdot(1+\log(\sin x))\cos x \\ &= (\sin x)^{\sin x}(1+\log(\sin x))\cos x, \end{aligned}

    the same answer.

    The derivative is zero where cos⁡x=0\cos x = 0 (x=π2x = \frac{\pi}{2}⁠) and where 1+log⁡(sin⁡x)=01 + \log(\sin x) = 0⁠, that is sin⁡x=1e\sin x = \frac1e (x≈0.3767x \approx 0.3767 and x≈π−0.3767x \approx \pi - 0.3767⁠). The graph has flat tangents exactly there:

    x y π/4 π/2 3π/4 π 0.5 1 sin x = 1/e sin x = 1/e cos x = 0 height 0.692
    y=(sin⁡x)sin⁡xy = (\sin x)^{\sin x} on (0,π)(0,\pi)⁠. The derivative vanishes at the three rose points: where sin⁡x=1e\sin x = \frac1e (lowest value (1e)1/e≈0.692(\frac1e)^{1/e} \approx 0.692⁠) and at x=π2x = \frac{\pi}{2} (value 11⁠). Open dots at the ends: x=0x = 0 and x=πx = \pi are not in the domain.
    The second route avoids writing log⁡y\log y but rests on the same fact, pq=eqlog⁡pp^q = e^{q\log p} for p>0p > 0⁠. Checking where the derivative is zero against the picture is a quick test that the formula is right: the flat points of the graph are exactly the zeros of f′f'⁠.
    elog⁡p=pe^{\log p} = p for p>0p > 0 (Example 25); (ex)′=ex(e^x)' = e^x (Theorem 5). Basics: exponentials and logarithms
Result

For 0<x<π0 < x < \pi⁠,

f′(x)=(1+log⁡(sin⁡x))×(sin⁡x)sin⁡xcos⁡x.\begin{aligned} f'(x) &= (1 + \log(\sin x)) \\ &\quad\times(\sin x)^{\sin x}\cos x. \end{aligned}

(This agrees with the textbook's worked answer.)

Check it with numbers

Take x=1x = 1⁠. Then sin⁡1≈0.8414710\sin 1 \approx 0.8414710⁠, cos⁡1≈0.5403023\cos 1 \approx 0.5403023⁠, log⁡(sin⁡1)≈−0.1726037\log(\sin 1) \approx -0.1726037⁠, and f(1)=(0.8414710)0.8414710f(1) = (0.8414710)^{0.8414710} ≈0.8648138\approx 0.8648138⁠. The formula gives

(1−0.1726037)×0.8648138×0.5403023≈0.3866099.\begin{aligned} &(1 - 0.1726037)\times 0.8648138 \times 0.5403023 \\ &\qquad\approx 0.3866099. \end{aligned}

A difference quotient of ff with h=0.0001h = 0.0001 on each side of 11 gives 0.386610.38661⁠. They agree.

Common mistakes
  1. Using the power rule. sin⁡x (sin⁡x)sin⁡x−1cos⁡x\sin x\,(\sin x)^{\sin x - 1}\cos x treats the exponent as a constant. It is not.
  2. Using the rule for axa^x⁠. (sin⁡x)sin⁡xlog⁡(sin⁡x)cos⁡x(\sin x)^{\sin x}\log(\sin x)\cos x treats the base as a constant. Also wrong; the correct answer contains both pieces (it is their sum).
  3. Forgetting to multiply by yy at the end, leaving (1+log⁡sin⁡x)cos⁡x(1 + \log\sin x)\cos x⁠, which is 1ydydx\frac{1}{y}\frac{dy}{dx}⁠, not dydx\frac{dy}{dx}⁠.
  4. Taking logs without checking the sign. The method needs sin⁡x>0\sin x > 0⁠, which is why the question restricts xx to (0,π)(0,\pi)⁠.
What to take away
  1. For y=uvy = u^v with both uu and vv depending on xx (and u>0u > 0⁠): dydx=uv(v′log⁡u+v u′u)\dfrac{dy}{dx} = u^v\left(v'\log u + \dfrac{v\,u'}{u}\right)⁠.
  2. That general formula is exactly "power-rule part plus exponential part": vuv−1u′+uvlog⁡u v′v u^{v-1}u' + u^v\log u\,v'⁠.
  3. Always check the base is positive before taking logarithms.

Every fact used, and where it comes from

FactUsed inSource
sin⁡x>0\sin x > 0 on (0,π)(0,\pi)Steps 1, 4Trigonometry (Class XI)
log⁡(pq)=qlog⁡p\log(p^q) = q\log p⁠, p>0p > 0Step 2Section 5.4, properties of logarithms
(log⁡x)′=1x(\log x)' = \frac1x⁠; (ex)′=ex(e^x)' = e^xSteps 3, 4, 6Theorem 5, Section 5.4
Chain rule; product ruleSteps 3, 4, 6Theorem 4, Section 5.3.1; rule (2), Section 5.3
Logarithmic differentiationSteps 2–5Section 5.5 (Lesson: logarithmic differentiation)
p=elog⁡pp = e^{\log p} for p>0p > 0Step 6Example 25, Section 5.4 (Example 25)
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →