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

Miscellaneous · Q9: Differentiate (sin⁡x−cos⁡x)sin⁡x−cos⁡x(\sin x-\cos x)^{\sin x-\cos x} on (π4,3π4)\left(\frac{\pi}{4},\frac{3\pi}{4}\right)

Miscellaneous ExerciseLogarithmic differentiation · Miscellaneous Exercise
The question

Differentiate w.r.t. xx the function

(sin⁡x−cos⁡x)(sin⁡x−cos⁡x),(\sin x - \cos x)^{(\sin x - \cos x)}, π4<x<3π4.\frac{\pi}{4} < x < \frac{3\pi}{4}.
Exam answer

Let u=sin⁡x−cos⁡xu = \sin x - \cos x⁠, so y=uuy = u^u⁠. For π4<x<3π4\frac{\pi}{4} \lt x \lt \frac{3\pi}{4}⁠, u=2sin⁡(x−π4)>0u = \sqrt2\sin\big(x - \frac{\pi}{4}\big) \gt 0⁠.

Taking log on both sides, log⁡y=ulog⁡u\log y = u\log u⁠.

Differentiating both sides w.r.t. xx⁠, with dudx=cos⁡x+sin⁡x\frac{du}{dx} = \cos x + \sin x⁠,

1ydydx=dudxlog⁡u+u⋅1ududx=(cos⁡x+sin⁡x)(1+log⁡u)\begin{aligned} \frac1y\frac{dy}{dx} &= \frac{du}{dx}\log u + u\cdot\frac1u\frac{du}{dx} \\ &= (\cos x + \sin x)(1 + \log u) \end{aligned}

∴ dydx=(sin⁡x−cos⁡x)sin⁡x−cos⁡x\therefore\ \dfrac{dy}{dx} = (\sin x - \cos x)^{\sin x - \cos x} ×(cos⁡x+sin⁡x)\times(\cos x + \sin x) ×(1+log⁡(sin⁡x−cos⁡x))\times\big(1 + \log(\sin x - \cos x)\big) (π4<x<3π4)\big(\dfrac{\pi}{4} \lt x \lt \dfrac{3\pi}{4}\big)

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

The one idea this problem is built on

Write u=sin⁡x−cos⁡xu = \sin x - \cos x⁠. The function is y=uuy = u^u⁠: the same quantity is base and exponent, so we use logarithmic differentiation, log⁡y=ulog⁡u\log y = u\log u⁠. This needs u>0u > 0⁠, and the interval π4<x<3π4\frac{\pi}{4} < x < \frac{3\pi}{4} guarantees it, because u=2sin⁡(x−π4)u = \sqrt2\sin\left(x - \frac{\pi}{4}\right)⁠.

Given, to find, and the plan
Given
y=(sin⁡x−cos⁡x)sin⁡x−cos⁡xy = (\sin x - \cos x)^{\sin x - \cos x} for π4<x<3π4\frac{\pi}{4} < x < \frac{3\pi}{4}⁠.
To find
dydx\dfrac{dy}{dx}⁠.
Plan
(1) Show the base u=sin⁡x−cos⁡xu = \sin x - \cos x is positive on the interval. (2) Take logarithms. (3) Differentiate both sides, using u′=cos⁡x+sin⁡xu' = \cos x + \sin x⁠. (4) Multiply by yy⁠.

Basics you need

1Compound-angle formula

sin⁡(A−B)=sin⁡Acos⁡B−cos⁡Asin⁡B\sin(A - B) = \sin A\cos B - \cos A\sin B⁠, and sin⁡π4=cos⁡π4=12\sin\frac{\pi}{4} = \cos\frac{\pi}{4} = \frac{1}{\sqrt2} (Class XI). Basics: trigonometric identities

2Logarithms

log⁡\log is defined for positive numbers only, and log⁡pn=nlog⁡p\log p^n = n\log p (Section 5.4). Basics: exponentials and logarithms

3Product and chain rules

(uv)′=u′v+uv′(uv)' = u'v + uv'⁠; ddxlog⁡u=1u⋅dudx\frac{d}{dx}\log u = \frac{1}{u}\cdot\frac{du}{dx}⁠. Basics: derivative rules

4Logarithmic differentiation

Take logs, differentiate, multiply by yy (Section 5.5; Example 41 does (sin⁡x)sin⁡x(\sin x)^{\sin x} the same way). Lesson: logarithmic differentiation

Solution

  1. The base is positive on (π4,3π4)\left(\frac{\pi}{4}, \frac{3\pi}{4}\right)

    Let u=sin⁡x−cos⁡xu = \sin x - \cos x⁠. Using cos⁡π4=sin⁡π4=12\cos\frac{\pi}{4} = \sin\frac{\pi}{4} = \frac{1}{\sqrt2}⁠:

    2sin⁡(x−π4)=2(sin⁡x2−cos⁡x2)=sin⁡x−cos⁡x=u.\begin{aligned} \sqrt2\sin\left(x - \tfrac{\pi}{4}\right) &= \sqrt2\left(\tfrac{\sin x}{\sqrt2} - \tfrac{\cos x}{\sqrt2}\right) \\ &= \sin x - \cos x = u. \end{aligned}

    For π4<x<3π4\frac{\pi}{4} < x < \frac{3\pi}{4}⁠, the angle x−π4x - \frac{\pi}{4} lies in (0,π2)\left(0, \frac{\pi}{2}\right)⁠, where sine is positive. Hence

    0<u<2on the whole interval.0 < u < \sqrt2 \quad\text{on the whole interval.}
    Logarithmic differentiation takes log⁡u\log u⁠, so uu must be positive. Rewriting uu as a single sine shows at a glance where it is positive. The key states this condition as "sin⁡x>cos⁡x\sin x > \cos x", which is the same thing as u>0u > 0⁠.
    sin⁡(A−B)=sin⁡Acos⁡B−cos⁡Asin⁡B\sin(A - B) = \sin A\cos B - \cos A\sin B (Class XI). Basics: trigonometric identities
  2. Take logarithms

    y=uuy = u^u with u>0u > 0⁠, so y>0y > 0 and

    log⁡y=ulog⁡u=(sin⁡x−cos⁡x)log⁡(sin⁡x−cos⁡x).\begin{aligned} \log y &= u\log u \\ &= (\sin x - \cos x)\log(\sin x - \cos x). \end{aligned}
    log⁡pn=nlog⁡p\log p^n = n\log p brings the exponent uu down, turning the power into a product of uu and log⁡u\log u⁠.
    log⁡bpn=nlog⁡bp\log_b p^n = n\log_b p⁠, Section 5.4. Basics: exponentials and logarithms
  3. Differentiate both sides

    Left side, by the chain rule: ddxlog⁡y=1ydydx\frac{d}{dx}\log y = \frac1y\frac{dy}{dx}⁠.

    Right side, by the product rule with factors uu and log⁡u\log u⁠, using ddxlog⁡u=u′u\frac{d}{dx}\log u = \frac{u'}{u}⁠:

    ddx(ulog⁡u)=u′log⁡u+u⋅u′u=u′(log⁡u+1).\begin{aligned} \frac{d}{dx}(u\log u) &= u'\log u + u\cdot\frac{u'}{u} \\ &= u'(\log u + 1). \end{aligned}

    The inner derivative is

    u′=ddx(sin⁡x−cos⁡x)=cos⁡x+sin⁡x.u' = \frac{d}{dx}(\sin x - \cos x) = \cos x + \sin x.
    The uu cancels in the second term (allowed since u>0u > 0⁠), and u′u' is then a common factor. The derivative of −cos⁡x-\cos x is +sin⁡x+\sin x⁠, which is why u′u' is a sum.
    Product rule (2), Section 5.3; chain rule, Theorem 4; ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x⁠, Theorem 5; Table 5.3. Lesson: chain rule
  4. Multiply by yy and substitute back

    From Step 3, 1ydydx=(cos⁡x+sin⁡x)(1+log⁡u)\frac1y\frac{dy}{dx} = (\cos x + \sin x)\left(1 + \log u\right)⁠. Multiplying by y=uuy = u^u⁠:

    dydx=(sin⁡x−cos⁡x)sin⁡x−cos⁡x×(cos⁡x+sin⁡x)×(1+log⁡(sin⁡x−cos⁡x)).\begin{aligned} \frac{dy}{dx} = {}&(\sin x - \cos x)^{\sin x - \cos x} \\ &\times(\cos x + \sin x) \\ &\times\left(1 + \log(\sin x - \cos x)\right). \end{aligned}
    The final answer must contain only xx⁠, so every uu is replaced by sin⁡x−cos⁡x\sin x - \cos x⁠.
    Logarithmic differentiation, Section 5.5. Lesson: logarithmic differentiation
π/4π/23π/4π 1−1√2 x u > 0 on this strip u = sin x − cos x
The base u=sin⁡x−cos⁡x=2sin⁡(x−π4)u = \sin x - \cos x = \sqrt2\sin\left(x - \frac{\pi}{4}\right) for 0≤x≤π0 \le x \le \pi (horizontal and vertical scales differ). On the shaded interval (π4,3π4)\left(\frac{\pi}{4}, \frac{3\pi}{4}\right) it is positive (blue), so log⁡u\log u exists and logarithmic differentiation is allowed. The open circles mark the excluded end points, where u=0u = 0 and u=2u = \sqrt2⁠.
Result

For π4<x<3π4\frac{\pi}{4} < x < \frac{3\pi}{4}⁠,

dydx=(sin⁡x−cos⁡x)sin⁡x−cos⁡x×(cos⁡x+sin⁡x)×(1+log⁡(sin⁡x−cos⁡x)).\begin{aligned} \frac{dy}{dx} = {}&(\sin x - \cos x)^{\sin x - \cos x} \\ &\times(\cos x + \sin x) \\ &\times\left(1 + \log(\sin x - \cos x)\right). \end{aligned}

(Textbook answer: (sin⁡x−cos⁡x)sin⁡x−cos⁡x(cos⁡x+sin⁡x)(\sin x - \cos x)^{\sin x - \cos x}(\cos x + \sin x) (1+log⁡(sin⁡x−cos⁡x))(1 + \log(\sin x - \cos x))⁠, sin⁡x>cos⁡x\sin x > \cos x⁠; the same.)

Check it with numbers

At x=π2x = \frac{\pi}{2}⁠: u=1−0=1u = 1 - 0 = 1⁠, y=11=1y = 1^1 = 1⁠, u′=0+1=1u' = 0 + 1 = 1 and log⁡1=0\log 1 = 0⁠, so the formula gives 1⋅1⋅(1+0)=11\cdot 1\cdot(1 + 0) = 1⁠. With h=0.0001h = 0.0001⁠: y(π2+h)≈1.000100005y\left(\frac{\pi}{2} + h\right) \approx 1.000100005 and y(π2−h)≈0.999900005y\left(\frac{\pi}{2} - h\right) \approx 0.999900005⁠, so the quotient is about 1.00000001.0000000⁠. ✓

At x=1.2x = 1.2⁠: u≈0.5696813u \approx 0.5696813⁠, u′≈1.2943968u' \approx 1.2943968⁠, log⁡u≈−0.5626781\log u \approx -0.5626781⁠, y=uu≈0.7257518y = u^u \approx 0.7257518⁠. Formula:

y′≈0.7257518×1.2943968×0.4373219≈0.4108249.\begin{aligned} y' &\approx 0.7257518 \times 1.2943968 \\ &\quad\times 0.4373219 \approx 0.4108249. \end{aligned}

Difference quotient with h=0.0001h = 0.0001⁠: y(1.2001)≈0.72579287y(1.2001) \approx 0.72579287 and y(1.1999)≈0.72571070y(1.1999) \approx 0.72571070⁠, so the quotient 0.72579287−0.725710700.0002\frac{0.72579287 - 0.72571070}{0.0002} is about 0.41082490.4108249⁠. ✓

Common mistakes
  1. Writing u′=cos⁡x−sin⁡xu' = \cos x - \sin x⁠. The derivative of −cos⁡x-\cos x is +sin⁡x+\sin x⁠, so u′=cos⁡x+sin⁡xu' = \cos x + \sin x⁠.
  2. Skipping the sign check. For 0<x<π40 < x < \frac{\pi}{4} the base is negative and log⁡u\log u does not exist; the interval is part of the question for that reason.
  3. Using the power rule u⋅uu−1⋅u′u\cdot u^{u-1}\cdot u'⁠: this misses the log⁡u\log u term, because the exponent is not constant.
What to take away
  1. ddx(uu)=uu(1+log⁡u) u′\frac{d}{dx}\left(u^u\right) = u^u(1 + \log u)\,u' wherever u>0u > 0⁠; this matches Example 41 with u=sin⁡xu = \sin x⁠.
  2. sin⁡x−cos⁡x=2sin⁡(x−π4)\sin x - \cos x = \sqrt2\sin\left(x - \frac{\pi}{4}\right) makes its sign easy to read.

Every fact used, and where it comes from

FactUsed inSource
sin⁡(A−B)\sin(A - B) formula; sin⁡π4=cos⁡π4=12\sin\frac{\pi}{4} = \cos\frac{\pi}{4} = \frac{1}{\sqrt2}Step 1Class XI, Trigonometric Functions
log⁡\log defined for positive numbers; log⁡pn=nlog⁡p\log p^n = n\log pSteps 1, 2Section 5.4 (log⁡pn=nlog⁡p\log p^n = n\log p is stated there for every real nn⁠, without proof)
Product rule; chain rule; Table 5.3Step 3Rule (2), Section 5.3; Theorem 4, Section 5.3.1
ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1xStep 3Theorem 5, Section 5.4
Logarithmic differentiation; (sin⁡x)sin⁡x(\sin x)^{\sin x}Steps 2–4Section 5.5; Example 41 (Lesson: logarithmic differentiation)
AnswerResultAnswers, Miscellaneous Exercise on Chapter 5, Q9
Numerical values, figure coordinatesCheck, figureRecomputed in the site's verification script
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 →