Logarithmic differentiation
NCERT Class 12 Mathematics Chapter 5 Section 5.5
Quick answer
Logarithmic differentiation means taking logarithms before differentiating, the method for powers whose base and exponent both vary, as in x, and for long products and quotients. For y = u with u positive, log y = v log u, so (1/y) dy/dx = v u′/u + v′ log u, and multiplying by y gives dy/dx; for example d/dx (x) = x(1 + log x). A sum of such powers is differentiated one term at a time, and the same method gives d/dx (a) = a log a for a > 0.
With your textbook
NCERT Mathematics Part I (Class 12), Chapter 5 “Continuity and Differentiability”, Section 5.5 “Logarithmic Differentiation”, pages 130–134.
Open the official NCERT chapter (PDF, 3.2 MB, ncert.nic.in) (opens in a new tab)
Checked against the 2026-27 reprint on .
What is logarithmic differentiation?
Logarithmic differentiation
- To differentiate y = [u(x)]v(x), take logarithms first: log y = v(x) log u(x). Then differentiate both sides with respect to x and multiply by y (NCERT Section 5.5, page 130).
The main point to be noted in this method is that f(x) and u(x) must always be positive as otherwise their logarithms are not defined.
NCERT Mathematics Part I (Class 12), Section 5.5, page 130
In plain words: the laws of logarithms turn powers into products, and products and quotients into sums and differences, which are much easier to differentiate than with the product and quotient rules. The left side becomes (1/y) dy/dx, by the chain rule. For y = uv:
Derivative of u to the power v
dy/dx = y[v u′/u + v′ log u]
Here u and v are differentiable, u > 0, and primes denote their derivatives. In the implicit examples below, take positive variable bases and divide only where the coefficient of dy/dx is non-zero.
Products and quotients
For a long product or quotient, logarithms save repeated use of the product and quotient rules. NCERT Example 27 (page 131): y = √(P/Q), with P = (x − 3)(x2 + 4) and Q = 3x2 + 4x + 5. The real domain is x ≥ 3, and logarithmic differentiation here applies for x > 3. At x = 3 the square root has an unbounded right difference quotient. For x > 3,
log y = ½[log (x − 3) + log (x2 + 4) − log (3x2 + 4x + 5)],
so (1/y) dy/dx is ½ times the sum of three fractions: 1/(x − 3), then 2x/(x2 + 4), then minus (6x + 4)/(3x2 + 4x + 5). Multiply by y for dy/dx.
A variable in the exponent
Neither the power rule (for xn, fixed n) nor the exponential rule (for ax, fixed a) applies when both base and exponent vary. NCERT Example 29 (page 132): for y = xsin x, x > 0, log y = sin x log x, so
(1/y) dy/dx = cos x log x + (sin x)/x,
and dy/dx = xsin x[cos x log x + (sin x)/x].
The derivative of a (NCERT Example 28, page 131): for a positive constant a, log y = x log a, so (1/y) dy/dx = log a:
Derivative of a
d/dx (a) = a log a, for a > 0
With a = e this is e again, since log e = 1.
Sums of such powers
Logarithms cannot be taken term by term: log (u + v) is not log u + log v. So for a sum, give each power a name and differentiate each separately. NCERT Example 30 (pages 132–133): for yx + xy + xx = ab, put u = yx, v = xy, w = xx, so that u′ + v′ + w′ = 0, where
- log u = x log y gives u′ = yx[log y + (x/y) dy/dx];
- log v = y log x gives v′ = xy[y/x + log x dy/dx];
- log w = x log x gives w′ = xx(1 + log x).
Collecting the dy/dx terms gives NCERT’s answer, dy/dx = −N/M, with N = yx log y + yxy − 1 + xx(1 + log x) and M = xyx − 1 + xy log x.
Solved examples
Example 1: Two powers (NCERT Exercise 5.5, Q4, page 134)
Differentiate xx − 2sin x.
For xx: log y = x log x, so y′ = xx(1 + log x). For 2sin x: by the a rule and the chain rule, the derivative is 2sin x log 2 × cos x.
Answer: xx(1 + log x) − 2sin x cos x log 2.
Example 2: Two variable powers (NCERT Exercise 5.5, Q7, page 134)
Differentiate (log x)x + xlog x, for x > 1.
Let u = (log x)x: log u = x log (log x), so u′/u = log (log x) + x × 1/(x log x) = log (log x) + 1/log x. Let v = xlog x: log v = (log x)2, so v′/v = 2 log x/x.
Answer: u′ + v′, where u′ = u(1/log x + log (log x)) and v′ = 2v log x/x.
Example 3: An implicit equation (NCERT Exercise 5.5, Q13, page 134)
Find dy/dx if yx = xy.
Take logarithms: x log y = y log x. Differentiating, log y + (x/y) dy/dx = log x dy/dx + y/x. Collect: (x/y − log x) dy/dx = y/x − log y. Multiply the top and bottom by xy.
Answer: dy/dx = y(y − x log y)/
Example 4: A product at a point (NCERT Exercise 5.5, Q16, page 134)
Let f(x) be the product of 1 + x, 1 + x2, 1 + x4 and 1 + x8. Find f′(x) and f′(1).
For x ≠ −1, use log |f| = log |1 + x| + log (1 + x2) + log (1 + x4) + log (1 + x8), so f′/f is the sum 1/(1 + x) + 2x/(1 + x2) + 4x3/(1 + x4) + 8x7/(1 + x8). At x = 1, f(1) = 24 = 16 and the sum is ½ + 1 + 2 + 4 = 15/2.
Answer: f′(x) = f(x) times that sum for x ≠ −1, and f′(1) = 120. At x = −1 use the product rule: f′(−1) = (1 + 1)(1 + 1)(1 + 1) = 8. Equivalently, f = 1 + x + ⋯ + x, so its polynomial derivative works everywhere.
Example 5: Three ways (NCERT Exercise 5.5, Q17, page 134)
Differentiate (x2 − 5x + 8)(x3 + 7x + 9) by the product rule, by expanding, and by logarithms. Do they agree?
Product rule: (2x − 5)(x3 + 7x + 9) + (x2 − 5x + 8)(3x2 + 7). Expanding first gives x5 − 5x4 + 15x3 − 26x2 + 11x + 72. Logarithms give the product times (2x − 5)/(x2 − 5x + 8) + (3x2 + 7)/(x3 + 7x + 9), which is the product rule again.
Answer: all three give 5x4 − 20x3 + 45x2 − 52x + 11. (The logarithms need both factors positive; the product rule shows that the answer holds for every x.)
Common mistakes to avoid
Common mistake
Using the power rule on x
d/dx (xx) is not x × xx − 1 = xx, and not xx log x. It is xx(1 + log x): the two answers that fix one part each give the two pieces of the correct one.
Common mistake
Taking logarithms of a sum term by term
For y = xx + (sin x)x, log y is not x log x + x log sin x. Differentiate each power separately, as in NCERT Example 30.
Common mistake
Forgetting to multiply by y at the end
Differentiating log y gives (1/y) dy/dx. The answer is dy/dx = y × (the right side), with y written back in terms of x.
Quick revision summary
- For y = u, with u = u(x) > 0 and v = v(x), take logarithms: log y = v log u, then (1/y) dy/dx = v u′/u + v′ log u.
- Logarithms also turn long products and quotients into sums before differentiating.
- d/dx (a) = a log a and d/dx (x) = x(1 + log x); for sums of powers, differentiate each power separately.
Formula sheet
- dy/dx = y[v u′/u + v′ log u], for y = uv, u > 0
- d/dx (ax) = ax log a (a > 0)
- d/dx (xx) = xx(1 + log x) (x > 0)
Questions students ask
What is the derivative of xxx?
The derivative of y = xxx, for x > 0, is y × xx times the sum of 1/x and (1 + log x) log x, where the tower means x raised to the power xx, not (xx)x, which is the different function xx2. Taking logarithms gives log y = xx log x; the product rule, with (xx)′ = xx(1 + log x), then makes y′/y equal to xx times that sum. At x = 2, where y = 16 and xx = 4, the sum is about 1.674, so the derivative is 64 × 1.674 ≈ 107.1.
How do you differentiate the infinite power tower xxx…?
For the infinite power tower y = xxx…, the exponent of the first x is the whole tower again, so y = xy, and, in the interior of its convergence interval, the derivative is y2/(x(1 − y log x)). Taking logarithms gives log y = y log x; differentiating implicitly, y′/y = y′ log x + y/x, and solving for y′ gives the result. Beyond NCERT, the tower is known to converge only for x from e−e ≈ 0.066 to e1/e ≈ 1.445; at x = √2 it settles at 2, where (√2)2 = 2 (not at 4, the other solution of (√2)y = y), and there the slope is 4/(√2(1 − log 2)), about 9.218. At the upper endpoint x = e1/e, y = e makes the denominator zero, so there is no finite endpoint derivative; convergence alone does not guarantee differentiability.
How can you find the derivative of xx without logarithmic differentiation?
You can find the derivative of xx without logarithmic differentiation by writing xx = ex log x, true for x > 0 because elog x = x, and using the chain rule: the derivative is ex log x times (1 + log x), that is xx(1 + log x), the same result. This is the alternative route NCERT shows for ax in Example 28 (page 131), and it works for any uv with u > 0, since uv = ev log u. As a check at x = 3, the slope of the chord from x = 2.999 to x = 3.001 is about 56.66, and 27(1 + log 3) ≈ 56.66.
What is the difference between logarithmic and implicit differentiation?
Logarithmic differentiation is a special use of implicit differentiation: you replace y = f(x) by log y = log f(x) and differentiate that equation implicitly, the left side giving (1/y) dy/dx by the chain rule. Implicit differentiation in general works on an equation linking x and y that is not solved for y, such as xy + sin y = 1, with no logarithms. Taking logarithms is the extra step that turns a variable power, a product or a quotient into a sum, and an equation such as yx = xy (NCERT Exercise 5.5, Q13) needs both steps.
When should you use logarithmic differentiation?
Use logarithmic differentiation when x is in both the base and the exponent, as in xx or (sin x)log x, since neither the power rule nor the ax rule applies there, and when a function is a long product or quotient of powers, such as (x + 1)3(x + 2)5 divided by (x + 3)4, where logarithms turn it into a sum. For a short product such as x2 sin x, or a power with a fixed exponent such as (x2 + 1)7, the product rule or the chain rule is quicker.
Does logarithmic differentiation work if the function takes negative values?
Logarithmic differentiation still works for a product or quotient that takes negative values, at every point where it is not 0, if you take log |y| instead of log y: the derivative of log |u| is u′/u for every u ≠ 0, so the same sum of u′/u terms comes out; NCERT asks for positive functions (page 130) only so that log y is defined. For example, y = (x − 1)(x − 4) is −2 at x = 2, and log |y| is the sum of log |x − 1| and log |x − 4|, so there y′/y = 1 − ½ = ½ and y′ = −1, which matches y′ = 2x − 5. A variable power is different: in uv the base must stay positive, since a power such as (−2)1/2 is not a real number.
Practice questions
Try each question first, then open the answer to check your working.
-
Q1. Differentiate cos x cos 2x cos 3x (NCERT Exercise 5.5, Q1, page 134).
Show answerHide answer
log y = log cos x + log cos 2x + log cos 3x (where the cosines are positive), so y′/y = −tan x − 2 tan 2x − 3 tan 3x. The product-times-tangents form is valid wherever all three cosines are non-zero, also using absolute-value logs for negative factors. An answer valid for every real x, including zeros of the cosines, is −sin x cos 2x cos 3x − 2 cos x sin 2x cos 3x − 3 cos x cos 2x sin 3x.
-
Q2. Differentiate (log x)cos x, for x > 1 (NCERT Exercise 5.5, Q3, page 134).
Show answerHide answer
log y = cos x log (log x). The product rule gives y′/y = A − B, with A = cos x/(x log x) and B = sin x log (log x). So y′ = (log x)cos x(A − B).
-
Q3. Find dy/dx if xy + yx = 1 (NCERT Exercise 5.5, Q12, page 134).
Show answerHide answer
The derivative of xy is xy(y/x + log x y′), and of yx is yx(log y + (x/y) y′). Their sum is 0, so y′ = −(yxy − 1 + yx log y)/
(xy log x + xyx − 1). -
Q4. Find dy/dx if xy = ex − y (NCERT Exercise 5.5, Q15, page 134).
Show answerHide answer
Since xy = ex − y > 0, both variables are non-zero and have the same sign. Take logarithms: log |x| + log |y| = x − y. Then 1/x + y′/y = 1 − y′, so y′(1/y + 1) = 1 − 1/x, and y′ = y(x − 1)/(x(y + 1)), where y ≠ −1; this also covers the negative-variable branch.