NCERT Class 12 Mathematics — Continuity and Differentiability, Exercise 5.5. All 18 questions solved.
Logarithmic differentiation is the technique for two situations the ordinary rules cannot reach: a variable base raised to a variable power, and a long product or quotient. In both cases, take logarithms first:
$$y = [u(x)]^{v(x)} \quad\Longrightarrow\quad \log y = v(x)\log u(x) \quad\Longrightarrow\quad \frac{1}{y}\frac{dy}{dx} = v\frac{u’}{u} + v’\log u$$
Key insight. When the function is a sum of two such terms — questions 4, 6, 7, 8, 9, 10 and 11 — you cannot take the logarithm of the sum. Split it: write $y = u + v$, set $u$ and $v$ separately equal to their own variables, differentiate each by logarithms, and add the results.
Trying to write $\log(u+v)$ is the single commonest way this exercise goes wrong, and the answers to those seven questions are all visibly two pieces added together — which is the clue that this is what was intended.
Differentiate the functions given in Exercises 1 to 11 w.r.t. $x$.
Question 1
$\cos x \cdot \cos 2x \cdot \cos 3x$
Solution. A triple product: logarithms turn it into a sum.
$$\log y = \log\cos x + \log\cos 2x + \log\cos 3x$$
$$\frac1y\frac{dy}{dx} = -\tan x – 2\tan 2x – 3\tan 3x$$
$$-\cos x\cos 2x\cos 3x\left[\tan x + 2\tan 2x + 3\tan 3x\right]$$
Question 2
$\sqrt{\dfrac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}}$
Solution. The square root becomes a factor of $\tfrac12$, and the quotient becomes a difference:
$$\log y = \frac12\Big[\log(x-1) + \log(x-2) – \log(x-3) – \log(x-4) – \log(x-5)\Big]$$
Differentiating term by term gives the bracket below.
$$\frac12\sqrt{\frac{(x-1)(x-2)}{(x-3)(x-4)(x-5)}}\left[\frac{1}{x-1} + \frac{1}{x-2} – \frac{1}{x-3} – \frac{1}{x-4} – \frac{1}{x-5}\right]$$
Question 3
$(\log x)^{\cos x}$
Solution. Variable base, variable exponent:
$$\log y = \cos x\log(\log x)$$
$$\frac1y\frac{dy}{dx} = \cos x \cdot \frac{1}{\log x} \cdot \frac1x – \sin x\log(\log x)$$
$$(\log x)^{\cos x}\left[\frac{\cos x}{x\log x} – \sin x\log(\log x)\right]$$
Question 4
$x^x – 2^{\sin x}$
Solution. Two terms, handled separately.
First: $u = x^x$, so $\log u = x\log x$ and $\tfrac{u’}{u} = 1 + \log x$, giving $u’ = x^x(1 + \log x)$.
Second: $v = 2^{\sin x}$, so $\log v = \sin x\log 2$ and $v’ = 2^{\sin x}\cos x\log 2$.
$$x^x(1 + \log x) – 2^{\sin x}\cos x\log 2$$
Question 5
$(x+3)^2(x+4)^3(x+5)^4$
Solution.
$$\log y = 2\log(x+3) + 3\log(x+4) + 4\log(x+5)$$
$$\frac1y\frac{dy}{dx} = \frac{2}{x+3} + \frac{3}{x+4} + \frac{4}{x+5}$$
Multiplying through by $y$ and clearing denominators — one factor of each bracket cancels — leaves a quadratic:
$$(x+3)(x+4)^2(x+5)^3\left(9x^2 + 70x + 133\right)$$
Question 6
$\left(x + \dfrac1x\right)^x + x^{\left(1 + \frac1x\right)}$
Solution. Two terms again.
First: $\log u = x\log\left(x + \tfrac1x\right)$, so
$$\frac{u’}{u} = x \cdot \frac{1 – \frac{1}{x^2}}{x + \frac1x} + \log\left(x+\frac1x\right) = \frac{x^2-1}{x^2+1} + \log\left(x+\frac1x\right)$$
Second: $\log v = \left(1 + \tfrac1x\right)\log x$, so
$$\frac{v’}{v} = \left(1 + \frac1x\right)\frac1x – \frac{\log x}{x^2} = \frac{x + 1 – \log x}{x^2}$$
$$\left(x+\frac1x\right)^x\left[\frac{x^2-1}{x^2+1} + \log\left(x+\frac1x\right)\right] + x^{1+\frac1x}\left(\frac{x+1-\log x}{x^2}\right)$$
Question 7
$(\log x)^x + x^{\log x}$
Solution.
First: $\log u = x\log(\log x)$, so $\tfrac{u’}{u} = \tfrac{1}{\log x} + \log(\log x)$ and $u’ = (\log x)^{x-1}\left[1 + \log x\log(\log x)\right]$.
Second: $\log v = (\log x)^2$, so $\tfrac{v’}{v} = \tfrac{2\log x}{x}$ and $v’ = 2x^{\log x – 1}\log x$.
$$(\log x)^{x-1}\left[1 + \log x\log(\log x)\right] + 2x^{\log x – 1}\log x$$
Question 8
$(\sin x)^x + \sin^{-1}\sqrt{x}$
Solution.
First: $\log u = x\log\sin x$, so $\tfrac{u’}{u} = x\cot x + \log\sin x$.
Second: $\tfrac{d}{dx}\sin^{-1}\sqrt{x} = \dfrac{1}{\sqrt{1-x}} \cdot \dfrac{1}{2\sqrt{x}} = \dfrac{1}{2\sqrt{x – x^2}}$.
$$(\sin x)^x\left(x\cot x + \log\sin x\right) + \frac12 \cdot \frac{1}{\sqrt{x-x^2}}$$
Question 9
$x^{\sin x} + (\sin x)^{\cos x}$
Solution.
First: $\log u = \sin x\log x$, so $\tfrac{u’}{u} = \tfrac{\sin x}{x} + \cos x\log x$.
Second: $\log v = \cos x\log\sin x$, so $\tfrac{v’}{v} = \cos x\cot x – \sin x\log\sin x$.
$$x^{\sin x}\left[\frac{\sin x}{x} + \cos x\log x\right] + (\sin x)^{\cos x}\left[\cos x\cot x – \sin x\log\sin x\right]$$
Question 10
$x^{x\cos x} + \dfrac{x^2+1}{x^2-1}$
Solution.
First: $\log u = x\cos x\log x$, so by the product rule on three factors,
$$\frac{u’}{u} = \cos x\log x + x\log x(-\sin x) + x\cos x \cdot \frac1x = \cos x(1 + \log x) – x\sin x\log x$$
Second: the quotient rule gives $\dfrac{2x\left(x^2-1\right) – 2x\left(x^2+1\right)}{\left(x^2-1\right)^2} = \dfrac{-4x}{\left(x^2-1\right)^2}$.
$$x^{x\cos x}\left[\cos x(1 + \log x) – x\sin x\log x\right] – \frac{4x}{\left(x^2-1\right)^2}$$
Question 11
$(x\cos x)^x + (x\sin x)^{1/x}$
Solution.
First: $\log u = x\log(x\cos x)$, so
$$\frac{u’}{u} = x\left(\frac1x – \tan x\right) + \log(x\cos x) = 1 – x\tan x + \log(x\cos x)$$
Second: $\log v = \tfrac1x\log(x\sin x)$, so
$$\frac{v’}{v} = \frac1x\left(\frac1x + \cot x\right) – \frac{\log(x\sin x)}{x^2} = \frac{x\cot x + 1 – \log(x\sin x)}{x^2}$$
$$(x\cos x)^x\left[1 – x\tan x + \log(x\cos x)\right] + (x\sin x)^{1/x}\left[\frac{x\cot x + 1 – \log(x\sin x)}{x^2}\right]$$
Find $\dfrac{dy}{dx}$ of the functions given in Exercises 12 to 15.
Question 12
$x^y + y^x = 1$
Solution. Set $u = x^y$ and $v = y^x$ and differentiate each by logarithms, remembering that $y$ depends on $x$.
$$\log u = y\log x \quad\Longrightarrow\quad u’ = x^y\left(\frac{y}{x} + \log x\frac{dy}{dx}\right)$$
$$\log v = x\log y \quad\Longrightarrow\quad v’ = y^x\left(\log y + \frac{x}{y}\frac{dy}{dx}\right)$$
Setting $u’ + v’ = 0$ and collecting the $\tfrac{dy}{dx}$ terms:
$$\frac{dy}{dx}\left(x^y\log x + xy^{x-1}\right) = -\left(yx^{y-1} + y^x\log y\right)$$
$$\frac{dy}{dx} = -\frac{yx^{y-1} + y^x\log y}{x^y\log x + xy^{x-1}}$$
Question 13
$y^x = x^y$
Solution. Take logarithms of both sides at once — here it works because the equation is a single equality, not a sum:
$$x\log y = y\log x$$
$$\log y + \frac{x}{y}\frac{dy}{dx} = \frac{y}{x} + \log x\frac{dy}{dx}$$
$$\frac{dy}{dx}\left(\frac{x}{y} – \log x\right) = \frac{y}{x} – \log y$$
Multiplying numerator and denominator by $\tfrac{y}{x}$ tidies this to NCERT’s form.
$$\frac{dy}{dx} = \frac{y}{x}\left(\frac{y – x\log y}{x – y\log x}\right)$$
Question 14
$(\cos x)^y = (\cos y)^x$
Solution. Logarithms first:
$$y\log\cos x = x\log\cos y$$
$$\log\cos x\frac{dy}{dx} – y\tan x = \log\cos y – x\tan y\frac{dy}{dx}$$
Collecting:
$$\frac{dy}{dx}\left(\log\cos x + x\tan y\right) = \log\cos y + y\tan x$$
$$\frac{dy}{dx} = \frac{y\tan x + \log\cos y}{x\tan y + \log\cos x}$$
Question 15
$xy = e^{(x-y)}$
Solution. Take logarithms:
$$\log x + \log y = x – y$$
$$\frac1x + \frac1y\frac{dy}{dx} = 1 – \frac{dy}{dx}$$
$$\frac{dy}{dx}\left(\frac1y + 1\right) = 1 – \frac1x = \frac{x-1}{x}$$
$$\frac{dy}{dx} \cdot \frac{1+y}{y} = \frac{x-1}{x}$$
$$\frac{dy}{dx} = \frac{y(x-1)}{x(y+1)}$$
Question 16
Find the derivative of the function given by $f(x) = (1+x)\left(1+x^2\right)\left(1+x^4\right)\left(1+x^8\right)$ and hence find $f'(1)$.
Solution. A four-fold product, so take logarithms:
$$\log f = \log(1+x) + \log\left(1+x^2\right) + \log\left(1+x^4\right) + \log\left(1+x^8\right)$$
$$\frac{f’}{f} = \frac{1}{1+x} + \frac{2x}{1+x^2} + \frac{4x^3}{1+x^4} + \frac{8x^7}{1+x^8}$$
At $x = 1$: $f(1) = 2 \cdot 2 \cdot 2 \cdot 2 = 16$, and the bracket is $\tfrac12 + 1 + 2 + 4 = \tfrac{15}{2}$.
$$f'(1) = 16 \times \frac{15}{2} = 120$$
$$f'(x) = (1+x)\left(1+x^2\right)\left(1+x^4\right)\left(1+x^8\right)\left[\frac{1}{1+x} + \frac{2x}{1+x^2} + \frac{4x^3}{1+x^4} + \frac{8x^7}{1+x^8}\right]$$
$$f'(1) = 120$$
Question 17
Differentiate $\left(x^2 – 5x + 8\right)\left(x^3 + 7x + 9\right)$ in three ways: (i) by using product rule (ii) by expanding the product to obtain a single polynomial (iii) by logarithmic differentiation. Do they all give the same answer?
Solution.
(i) Product rule.
$$(2x – 5)\left(x^3 + 7x + 9\right) + \left(x^2 – 5x + 8\right)\left(3x^2 + 7\right)$$
(ii) Expanding first. Multiplying out gives
$$x^5 – 5x^4 + 15x^3 – 26x^2 + 11x + 72$$
whose derivative is $5x^4 – 20x^3 + 45x^2 – 52x + 11$.
(iii) Logarithmic. With $\log y = \log\left(x^2-5x+8\right) + \log\left(x^3+7x+9\right)$,
$$\frac{dy}{dx} = y\left[\frac{2x-5}{x^2-5x+8} + \frac{3x^2+7}{x^3+7x+9}\right]$$
which is the product-rule answer with $y$ multiplied back in.
Expanding (i) confirms it equals (ii). Yes — all three agree, as they must: they are three routes to the same derivative.
$$5x^4 – 20x^3 + 45x^2 – 52x + 11 \qquad \text{(all three methods)}$$
Question 18
If $u$, $v$ and $w$ are functions of $x$, then show that
$$\frac{d}{dx}(u \cdot v \cdot w) = \frac{du}{dx}v \cdot w + u \cdot \frac{dv}{dx} \cdot w + u \cdot v\frac{dw}{dx}$$
in two ways — first by repeated application of the product rule, second by logarithmic differentiation.
Solution.
Method 1: repeated product rule. Treat $vw$ as a single function:
$$\frac{d}{dx}\big(u \cdot (vw)\big) = u'(vw) + u\frac{d}{dx}(vw) = u’vw + u\left(v’w + vw’\right)$$
Expanding gives the three terms.
Method 2: logarithmic differentiation. Let $y = uvw$, so $\log y = \log u + \log v + \log w$ and
$$\frac{1}{y}\frac{dy}{dx} = \frac{u’}{u} + \frac{v’}{v} + \frac{w’}{w}$$
Multiplying by $y = uvw$, each term loses its own denominator:
$$\frac{dy}{dx} = u’vw + uv’w + uvw’$$
The second method is shorter and generalises immediately to any number of factors, which is why questions 1, 2, 5 and 16 use it.
Both methods give
$$\frac{d}{dx}(u \cdot v \cdot w) = \frac{du}{dx}v \cdot w + u \cdot \frac{dv}{dx} \cdot w + u \cdot v\frac{dw}{dx}$$
Common mistakes
- Taking the logarithm of a sum. $\log(u+v) \ne \log u + \log v$. Split into two terms and differentiate separately — questions 4, 6, 7, 8, 9, 10 and 11.
- Forgetting to multiply back by $y$. Logarithmic differentiation gives $\tfrac{y’}{y}$; the answer is $y$ times that.
- Missing the $\tfrac{dy}{dx}$ inside a logarithm of $y$. In questions 12 to 15 every $\log y$ differentiates to $\tfrac{1}{y}\tfrac{dy}{dx}$.
- Using the power rule on $x^x$. Neither $x \cdot x^{x-1}$ nor $x^x\log x$ alone is right; the answer has both terms.
- Differentiating a three-factor logarithm incompletely. In question 10, $\log u = x\cos x\log x$ needs the product rule across all three factors.
- Not simplifying to the key’s shape. Question 13’s answer only matches after multiplying top and bottom by $\tfrac{y}{x}$.
Practise next
- Exercise 5.6 — parametric differentiation, the last of the chapter’s techniques.
- Miscellaneous Exercise on Chapter 5 — questions 9, 10 and 11 there are harder versions of these.

Doubts are answered by Shiwam, usually within a day. Ask about this question specifically — a general question about the chapter is better asked in class.