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

Exercise 5.5 · Q2: Differentiate (x−1)(x−2)(x−3)(x−4)(x−5)\sqrt{\frac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}}

Exercise 5.5Logarithmic differentiation · Section 5.5
The question

Differentiate the function w.r.t. xx⁠:

(x−1) (x−2)(x−3) (x−4) (x−5)\sqrt{\frac{(x-1)\,(x-2)}{(x-3)\,(x-4)\,(x-5)}}
Exam answer

Let y=(x−1)(x−2)(x−3)(x−4)(x−5)y = \sqrt{\frac{(x - 1)(x - 2)}{(x - 3)(x - 4)(x - 5)}}⁠. For x∈(1,2)∪(3,4)∪(5,∞)x \in (1, 2) \cup (3, 4) \cup (5, \infty)⁠, y>0y > 0⁠. Taking log on both sides,

log⁡y=12[log⁡∣x−1∣+log⁡∣x−2∣−log⁡∣x−3∣−log⁡∣x−4∣−log⁡∣x−5∣]\begin{aligned} \log y &= \frac12\bigg[\log|x - 1| \\ &\quad + \log|x - 2| - \log|x - 3| \\ &\quad - \log|x - 4| - \log|x - 5|\bigg] \end{aligned}

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

1y⋅dydx=12[1x−1+1x−2−1x−3−1x−4−1x−5]\begin{aligned} \frac1y\cdot\frac{dy}{dx} &= \frac12\bigg[\frac{1}{x - 1} + \frac{1}{x - 2} \\ &\quad - \frac{1}{x - 3} - \frac{1}{x - 4} \\ &\quad - \frac{1}{x - 5}\bigg] \end{aligned}

Multiplying by yy⁠,

dydx=12(x−1)(x−2)(x−3)(x−4)(x−5)×[1x−1+1x−2−1x−3−1x−4−1x−5]\begin{aligned} \dfrac{dy}{dx} &= \dfrac12\sqrt{\dfrac{(x - 1)(x - 2)}{(x - 3)(x - 4)(x - 5)}} \\ &\quad\times\bigg[\dfrac{1}{x - 1} + \dfrac{1}{x - 2} \\ &\qquad - \dfrac{1}{x - 3} - \dfrac{1}{x - 4} \\ &\qquad - \dfrac{1}{x - 5}\bigg] \end{aligned}

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

The one idea this problem is built on

Taking logarithms turns the square root into a factor 12\frac12⁠, the product into a sum and the quotient into a difference, so five simple log terms replace a messy quotient-rule calculation. The catch is the sign: the fraction is positive on three separate intervals, and on two of them some factors x−ax - a are negative. Writing log⁡∣x−a∣\log|x - a| handles every interval at once, because ddxlog⁡∣x−a∣=1x−a\frac{d}{dx}\log|x - a| = \frac{1}{x - a} whatever the sign.

Given, to find, and the plan
Given
y=Q(x)y = \sqrt{Q(x)}⁠, where Q(x)=(x−1)(x−2)(x−3)(x−4)(x−5)Q(x) = \dfrac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}⁠.
To find
dydx\frac{dy}{dx}⁠, and where it is valid.
Plan
(1) Sign table for QQ⁠: where yy is defined and where y>0y > 0⁠. (2) Take log⁡y\log y using absolute values. (3) Differentiate. (4) Multiply by yy⁠. (5) Examine the endpoints x=1x = 1 and x=2x = 2⁠.

Basics you need

1Log laws (positive numbers only)

log⁡(pq)=log⁡p+log⁡q\log(pq) = \log p + \log q⁠, log⁡pq=log⁡p−log⁡q\log\frac{p}{q} = \log p - \log q⁠, log⁡pn=nlog⁡p\log p^n = n\log p⁠, for p,q>0p, q > 0 (Section 5.4). So log⁡p=12log⁡p\log\sqrt{p} = \frac12\log p⁠. Basics: exponentials and logarithms

2ddxlog⁡∣g∣=g′g\frac{d}{dx}\log|g| = \frac{g'}{g} where g≠0g \ne 0

If g>0g > 0 this is the chain rule with Theorem 5. If g<0g < 0⁠, log⁡∣g∣=log⁡(−g)\log|g| = \log(-g) has derivative −g′−g=g′g\frac{-g'}{-g} = \frac{g'}{g}⁠. With g=x−ag = x - a⁠: ddxlog⁡∣x−a∣=1x−a\frac{d}{dx}\log|x - a| = \frac{1}{x-a} for x≠ax \ne a⁠. Basics: derivative rules

3Sign of a product

A product or quotient of non-zero numbers is positive when the number of negative factors is even, negative when it is odd. Basics: functions

Solution

  1. Where is yy defined, and where is it positive?

    Each factor x−ax - a changes sign only at x=ax = a⁠. The points 1,2,3,4,51, 2, 3, 4, 5 split the line into six intervals; count the negative factors in each:

    Factorx<1x<1(1,2)(1,2)(2,3)(2,3)(3,4)(3,4)(4,5)(4,5)x>5x>5
    x−1x-1−+++++
    x−2x-2−−++++
    x−3x-3−−−+++
    x−4x-4−−−−++
    x−5x-5−−−−−+
    Q(x)Q(x)−+−+−+

    A real square root needs Q(x)≥0Q(x) \ge 0⁠, and QQ is undefined at 3,4,53, 4, 5⁠. Q=0Q = 0 exactly at x=1x = 1 and x=2x = 2⁠. So

    y is defined on [1,2] ∪ (3,4) ∪ (5,∞),y \text{ is defined on } [1, 2]\,\cup\,(3, 4)\,\cup\,(5, \infty), y>0 on (1,2) ∪ (3,4) ∪ (5,∞).y > 0 \text{ on } (1, 2)\,\cup\,(3, 4)\,\cup\,(5, \infty).
    sign of Q(x): − + − + − + 0 1 2 3 4 5 6
    Sign of Q(x)Q(x) on each interval (one unit = 88 px). Green: where y=Qy = \sqrt{Q} is defined. Filled dots at 11 and 22 are included (y=0y = 0 there); open dots at 3,4,53, 4, 5 are excluded (QQ is undefined).
    Imitating Example 27 one would write log⁡(x−1)\log(x-1)⁠, log⁡(x−2)\log(x-2) and so on, which all exist only for x>5x > 5⁠. On (1,2)(1, 2) and (3,4)(3, 4) the fraction is positive although some factors are negative, so the function is defined there too. The sign table finds all three pieces; the next step makes one formula work on all of them.
    Sign of a product or quotient from the number of negative factors (Basic 3). Basics: functions
  2. Take logarithms, with absolute values

    On (1,2)(1,2)⁠, (3,4)(3,4) and (5,∞)(5,\infty)⁠, Q>0Q > 0⁠, so Q=∣Q∣Q = |Q| and log⁡y=12log⁡Q\log y = \frac12\log Q⁠. Since ∣Q∣|Q| is a product and quotient of the positive numbers ∣x−a∣|x - a|⁠,

    log⁡y=12[log⁡∣x−1∣+log⁡∣x−2∣−log⁡∣x−3∣−log⁡∣x−4∣−log⁡∣x−5∣].\begin{aligned} \log y = \tfrac12\big[&\log|x-1| + \log|x-2| \\ &- \log|x-3| - \log|x-4| \\ &- \log|x-5|\big]. \end{aligned}
    ∣Q∣=∣x−1∣ ∣x−2∣∣x−3∣ ∣x−4∣ ∣x−5∣|Q| = \frac{|x-1|\,|x-2|}{|x-3|\,|x-4|\,|x-5|} because the absolute value of a product or quotient is the product or quotient of the absolute values. Each ∣x−a∣|x - a| is positive (no factor is zero on these intervals), so the log laws apply. For x>5x > 5 every bar can be dropped, giving the line Example 27 would suggest.
    log⁡p=12log⁡p\log\sqrt{p} = \frac12\log p⁠, log⁡pqrst=log⁡p+log⁡q−log⁡r−log⁡s−log⁡t\log\frac{pq}{rst} = \log p + \log q - \log r - \log s - \log t (Section 5.4). Basics: exponentials and logarithms
  3. Differentiate both sides

    Left side (chain rule, outer log⁡\log⁠, inner yy⁠): 1ydydx\frac1y\frac{dy}{dx}⁠. Right side: ddxlog⁡∣x−a∣=1x−a\frac{d}{dx}\log|x - a| = \frac{1}{x-a} for each term (Basic 2). So

    1y⋅dydx=12[1x−1+1x−2−1x−3−1x−4−1x−5].\begin{aligned} \frac1y\cdot\frac{dy}{dx} = \frac12\Bigg[&\frac{1}{x-1} + \frac{1}{x-2} \\ &- \frac{1}{x-3} - \frac{1}{x-4} \\ &- \frac{1}{x-5}\Bigg]. \end{aligned}
    Each inner function x−ax - a has derivative 11⁠, so each term is simply 1x−a\frac{1}{x-a}⁠. The minus signs of the denominator's factors carry through unchanged.
    ddxlog⁡∣g∣=g′g\frac{d}{dx}\log|g| = \frac{g'}{g} with g=x−ag = x - a⁠, g′=1g' = 1⁠. Lesson: logarithmic differentiation
  4. Multiply by yy

    For xx in (1,2)(1,2)⁠, (3,4)(3,4) or (5,∞)(5,\infty)⁠:

    dydx= 12(x−1)(x−2)(x−3)(x−4)(x−5)×[1x−1+1x−2−1x−3−1x−4−1x−5].\begin{aligned} \frac{dy}{dx} = \ &\frac12\sqrt{\frac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}} \\ &\times\Bigg[\frac{1}{x-1} + \frac{1}{x-2} \\ &\qquad - \frac{1}{x-3} - \frac{1}{x-4} \\ &\qquad - \frac{1}{x-5}\Bigg]. \end{aligned}
    Multiplying by yy (positive here) isolates dydx\frac{dy}{dx}⁠, and substituting yy back gives the answer in xx alone. This is the textbook's answer, now with the set where it holds.
    Rearranging: 1yY=R\frac1y Y = R with y≠0y \ne 0 gives Y=yRY = yR⁠. Basics: solving for dy/dx
  5. What happens at x=1x = 1 and x=2x = 2⁠?

    There y=0y = 0⁠, so the log method cannot be used, and yy exists only on one side of each point (inside [1,2][1, 2]⁠). At x=1x = 1⁠, take 0<h<10 < h < 1⁠. Then

    Q(1+h)=h (h−1)(h−2)(h−3)(h−4)=h (1−h)(2−h)(3−h)(4−h)\begin{aligned} Q(1+h) &= \frac{h\,(h-1)}{(h-2)(h-3)(h-4)} \\ &= \frac{h\,(1-h)}{(2-h)(3-h)(4-h)} \end{aligned}

    (numerator and denominator both changed sign), so the right-hand difference quotient is

    y(1+h)−0h=Q(1+h)h2=1h1−h(2−h)(3−h)(4−h).\begin{aligned} \frac{y(1+h) - 0}{h} &= \sqrt{\frac{Q(1+h)}{h^2}} \\ &= \frac{1}{\sqrt h}\sqrt{\frac{1-h}{(2-h)(3-h)(4-h)}}. \end{aligned}

    As h→0+h \to 0^+ the second root tends to 1/24\sqrt{1/24}⁠, while 1h\frac{1}{\sqrt h} grows without bound, so the quotient tends to +∞+\infty⁠. At x=2x = 2⁠, in the same way,

    Q(2−h)=h (1−h)(1+h)(2+h)(3+h),Q(2-h) = \frac{h\,(1-h)}{(1+h)(2+h)(3+h)},

    and the left-hand quotient y(2−h)−0−h\frac{y(2-h) - 0}{-h} equals −1h-\frac{1}{\sqrt h} times a root that tends to 1/6\sqrt{1/6}⁠, so it tends to −∞-\infty⁠.

    So the graph meets the xx-axis at 11 and 22 with vertical tangents, and yy has no derivative there. The points 3,4,53, 4, 5 are not in the domain at all, so nothing is asked there. Hence the formula of Step 4 holds exactly on (1,2)(1,2)⁠, (3,4)(3,4) and (5,∞)(5,\infty)⁠.
    A derivative (or one-sided derivative) is a finite limit of difference quotients (Section 5.3). Basics: slope at a point
Result

The function is defined on [1,2][1,2]⁠, (3,4)(3,4) and (5,∞)(5,\infty)⁠. For xx in (1,2)(1,2)⁠, (3,4)(3,4) or (5,∞)(5,\infty)⁠,

dydx= 12(x−1)(x−2)(x−3)(x−4)(x−5)×[1x−1+1x−2−1x−3−1x−4−1x−5].\begin{aligned} \frac{dy}{dx} = \ &\frac12\sqrt{\frac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}} \\ &\times\Bigg[\frac{1}{x-1} + \frac{1}{x-2} \\ &\qquad - \frac{1}{x-3} - \frac{1}{x-4} \\ &\qquad - \frac{1}{x-5}\Bigg]. \end{aligned}

(Textbook answer: the same expression, with no domain stated.) At x=1x = 1 and x=2x = 2 there is no derivative (vertical tangents).

Check it with numbers

At x=6x = 6⁠: Q=5⋅43⋅2⋅1=103Q = \frac{5\cdot 4}{3\cdot 2\cdot 1} = \frac{10}{3}⁠, y=1.8257419y = 1.8257419⁠. The bracket is 15+14−13−12−1\frac15 + \frac14 - \frac13 - \frac12 - 1 =−1.3833333= -1.3833333⁠, so dydx=1.82574192×(−1.3833333)\frac{dy}{dx} = \frac{1.8257419}{2}\times(-1.3833333) =−1.2628048= -1.2628048⁠. The central difference quotient with h=0.0001h = 0.0001 gives −1.2628048-1.2628048⁠.

Inside (1,2)(1, 2)⁠, at x=1.5x = 1.5⁠, where four of the five factors x−ax - a are negative: Q=0.0190476Q = 0.0190476⁠, y=0.1380131y = 0.1380131⁠, bracket =1.3523810= 1.3523810⁠, so dydx=0.0933232\frac{dy}{dx} = 0.0933232⁠; the difference quotient gives 0.09332320.0933232⁠. The log⁡∣ ∣\log|\ | version is right on this piece as well.

Common mistakes
  1. Assuming the function lives only on x>5x > 5⁠. The sign table shows two more pieces, [1,2][1, 2] and (3,4)(3, 4)⁠.
  2. Writing log⁡(x−2)\log(x - 2) for 1<x<21 < x < 2⁠. It does not exist there; log⁡∣x−2∣\log|x - 2| does, with the same derivative.
  3. Sign slips: the denominator's terms enter with minus signs: −1x−3−1x−4−1x−5-\frac{1}{x-3} - \frac{1}{x-4} - \frac{1}{x-5}⁠.
  4. Losing the 12\frac12 from the square root, or forgetting to multiply back by yy⁠.
What to take away
  1. Before taking logs, find where the function is positive; a sign table does it for products and quotients of linear factors.
  2. log⁡∣x−a∣\log|x - a| has derivative 1x−a\frac{1}{x - a} on both sides of aa⁠, so one formula covers every piece.
  3. Where the function is zero the log method says nothing; check those points by difference quotients.

Every fact used, and where it comes from

FactUsed inSource
Square root of a real number needs it ≥0\ge 0⁠; sign of a productStep 1Real numbers (earlier classes)
Logarithmic differentiation needs a positive functionSteps 1, 2Section 5.5 (Lesson: logarithmic differentiation)
Log laws for products, quotients and powersStep 2Section 5.4
ddxlog⁡x=1x\frac{d}{dx}\log x = \frac1x⁠; chain ruleStep 3Theorem 5, Section 5.4; Theorem 4, Section 5.3.1
ddxlog⁡∣g∣=g′g\frac{d}{dx}\log|g| = \frac{g'}{g}Step 3Basic 2 (from Theorems 4 and 5)
Derivative as a finite limit; one-sided derivativesStep 5Section 5.3
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 →