Logarithmic Differentiation: Formula, Steps & Examples

#Calculus
TL;DR
Logarithmic differentiation is a technique that takes the natural log of both sides of $y = f(x)$, uses log laws to break products, quotients, and powers into sums, differences, and multiples, then differentiates implicitly to get $\dfrac{y'}{y}$ on the left. Solving gives $y' = y\cdot\big(\text{the log-expanded derivative}\big)$. Reach for it when the base and the exponent both vary, as in $y = x^x$, or when a function is a large product or quotient of powers.
BT
Bhanzu TeamLast updated on September 29, 202610 min read

What Is Logarithmic Differentiation?

Logarithmic differentiation is a method for finding the derivative of a function by first taking the natural logarithm of both sides, simplifying with log laws, and then differentiating. It is the standard tool for two situations that ordinary rules cannot handle: a function whose base and exponent both contain the variable, such as $y = x^x$, and a function built from a long product or quotient of powers.

The whole method rests on one identity. If $y = f(x)$ is positive, then differentiating $\ln y$ with respect to $x$ gives:

$$\frac{y'}{y} = \frac{d}{dx}\big[\ln y\big] \qquad\Longrightarrow\qquad y' = y\cdot\frac{d}{dx}\big[\ln y\big]$$

The factor $\dfrac{y'}{y}$ appears because $\ln y$ is a composite function of $x$, so its derivative needs the chain rule. That single factor is where most of the method's power, and most of its mistakes, come from. For a wider map of the field, see the calculus overview.

When Should You Use Logarithmic Differentiation?

Two shapes of function call for it, and recognising them is half the skill.

  • A variable base raised to a variable power. Functions like $x^x$, $(\sin x)^x$, or $(\ln x)^x$ have the variable in the base and the exponent at once. The power rule fails because the exponent is not a constant, and the exponential rule fails because the base is not a constant. Neither ordinary tool fits, so you take a logarithm to pull the exponent down in front.

  • A large product, quotient, or chain of powers. A function such as $\dfrac{(x^2+1)^3\sqrt{x-1}}{(2x+3)^4}$ can be differentiated with the product rule and quotient rule, but the algebra is punishing. Taking a log turns every product into a sum and every power into a multiplier, and the derivative falls out in one clean line.

If a function is a simple power like $x^5$ or a simple exponential like $2^x$, you do not need this method. Logarithmic differentiation earns its keep only when the two ordinary approaches stall.

Table: Which functions call for logarithmic differentiation, and why the ordinary rules stall.

Function shape

Example

Why ordinary rules stall

Variable base, variable power

$x^x$, $(\sin x)^x$

Power rule needs a constant exponent; exponential rule needs a constant base

Big product or quotient of powers

$\dfrac{(x^2+1)^3\sqrt{x-1}}{(2x+3)^4}$

Product and quotient rules work but are long and error-prone

Constant base, variable exponent

$2^x$

No log needed; use the exponential derivative directly

Variable base, constant power

$x^5$

No log needed; the plain power rule handles it

How Do You Do Logarithmic Differentiation? The Steps

The method is the same four moves every time, whatever the function.

  1. Take the natural log of both sides. Start from $y = f(x)$ and write $\ln y = \ln f(x)$.

  2. Expand with log laws. Use $\ln(ab) = \ln a + \ln b$, $\ln\left(\tfrac{a}{b}\right) = \ln a - \ln b$, and $\ln(a^n) = n\ln a$ to break the right side into separate terms.

  3. Differentiate both sides. The left side becomes $\dfrac{y'}{y}$ by the chain rule; differentiate each term on the right.

  4. Solve for $y'$. Multiply both sides by $y$, then replace $y$ with the original $f(x)$.

This is implicit differentiation applied to $\ln y$: you differentiate $y$ as an unknown function of $x$ and carry the $y'$ along, exactly as you would for a curve defined implicitly.

How Do You Differentiate x To The Power x? (Worked Examples)

Each example is fully stepped, and every answer is checked by an independent route.

Example 1: Differentiate $y = x^x$ (variable base and variable power).

Take the natural log of both sides, then use $\ln(a^n) = n\ln a$:

$$\ln y = \ln\big(x^x\big) = x\ln x$$

Differentiate both sides. The left gives $\dfrac{y'}{y}$; the right needs the product rule on $x\ln x$:

$$\frac{y'}{y} = (1)\ln x + x\cdot\frac{1}{x} = \ln x + 1$$

Multiply by $y = x^x$:

$$y' = x^x\big(\ln x + 1\big)$$

Check by a second method. Write $x^x = e^{x\ln x}$ and differentiate with the chain rule: $\dfrac{d}{dx}e^{x\ln x} = e^{x\ln x}\cdot(\ln x + 1) = x^x(\ln x + 1)$. The two routes agree.

Final answer: $y' = x^x\big(\ln x + 1\big)$.

Example 2: Differentiate the big quotient $y = \dfrac{(x^2+1)^3\sqrt{x-1}}{(2x+3)^4}$.

Take logs and expand every product, root, and power into a separate term (note $\sqrt{x-1} = (x-1)^{1/2}$):

$$\ln y = 3\ln(x^2+1) + \tfrac{1}{2}\ln(x-1) - 4\ln(2x+3)$$

Differentiate term by term, using the chain rule inside each logarithm:

$$\frac{y'}{y} = \frac{3\cdot 2x}{x^2+1} + \frac{1}{2}\cdot\frac{1}{x-1} - \frac{4\cdot 2}{2x+3} = \frac{6x}{x^2+1} + \frac{1}{2(x-1)} - \frac{8}{2x+3}$$

Multiply by $y$ to finish:

$$y' = \frac{(x^2+1)^3\sqrt{x-1}}{(2x+3)^4}\left(\frac{6x}{x^2+1} + \frac{1}{2(x-1)} - \frac{8}{2x+3}\right)$$

Check the structure: each factor of the original contributes one term to the bracket, with its power as the multiplier and a minus sign for the denominator factor. That pattern is the signature of a correct expansion.

Final answer: $y' = y\left(\dfrac{6x}{x^2+1} + \dfrac{1}{2(x-1)} - \dfrac{8}{2x+3}\right)$, with $y$ the original quotient.

Example 3: Differentiate $y = (\sin x)^x$ (a trig base to a variable power).

Take logs, bring the exponent down, then differentiate the product $x\ln(\sin x)$:

$$\ln y = x\ln(\sin x)$$

$$\frac{y'}{y} = (1)\ln(\sin x) + x\cdot\frac{\cos x}{\sin x} = \ln(\sin x) + x\cot x$$

Multiply by $y = (\sin x)^x$:

$$y' = (\sin x)^x\big(\ln(\sin x) + x\cot x\big)$$

Check by the exponential route: $(\sin x)^x = e^{x\ln(\sin x)}$, and differentiating gives $e^{x\ln(\sin x)}\big(\ln(\sin x) + x\cot x\big)$, the same result. This is valid where $\sin x > 0$, so that the logarithm is defined.

Final answer: $y' = (\sin x)^x\big(\ln(\sin x) + x\cot x\big)$.

Why Does Logarithmic Differentiation Work?

The method is not a trick pulled from nowhere. It works because logarithms convert the hard operations into easy ones, and because the derivative of $\ln y$ carries a built-in meaning.

  • Logs trade multiplication for addition. The whole reason logarithms were invented was to turn products into sums. A derivative of a sum is just the sum of the derivatives, so once a function is written as $\ln a + \ln b - \ln c$, differentiating is term by term with no product or quotient rule in sight.

  • The exponent comes down as a coefficient. The law $\ln(a^n) = n\ln a$ moves a variable exponent from the roof down to the floor, where the ordinary rules can reach it. That is exactly what unlocks $x^x$.

  • The left side has a geometric meaning. The quantity $\dfrac{y'}{y}$ is called the logarithmic derivative, and it is the slope of the graph of $\ln y$ plotted against $x$. Because dividing a rate of change by the value itself gives a relative rate of change, $\dfrac{y'}{y}$ is the fractional, or percentage, growth of $y$. A stock rising "2% a day" and a bacterial colony growing "10% an hour" are both statements about $\dfrac{y'}{y}$, not about $y'$ alone.

Reading those together: $y'$ is the slope of the tangent to $y = f(x)$, while $\dfrac{y'}{y}$ is the slope of the tangent to $\ln y$. Logarithmic differentiation computes the easy second quantity, then scales back up by $y$ to recover the one you wanted.

Who Discovered Logarithmic Differentiation?

The pieces arrived across two centuries before the method settled into its modern form.

Two other figures shaped the ideas the method depends on:

  • John Napier (1550–1617, Scotland) published the first tables of logarithms, establishing the product-to-sum rule that the whole technique rests on.

  • Leonhard Euler (1707–1783, Switzerland) systematised the constant $e$ and the natural logarithm, giving the identity $x^x = e^{x\ln x}$ the clean footing that lets the exponential check in the examples above work.

Where Is Logarithmic Differentiation Used In The Real World?

The idea that the logarithmic derivative is a relative rate of change makes this method quietly useful far outside a calculus exam.

  • Finance and compound growth: continuously compounded returns are measured as a percentage rate, which is exactly $\dfrac{y'}{y}$; log differentiation is how analysts convert a growth model into its growth rate.

  • Biology and population models: the per-capita growth rate of a population, the quantity ecologists actually measure, is the logarithmic derivative of the population size.

  • Economics and elasticity: price elasticity is a ratio of percentage changes, so it is naturally written with logarithmic derivatives of demand and price.

  • Statistics and machine learning: fitting a model by maximum likelihood almost always differentiates the log-likelihood, because a product of many probabilities becomes a sum of logs that is far easier to handle.

  • Engineering and signal analysis: decibels and other log scales report relative change, so rates of change on those scales are logarithmic derivatives.

One method connects a homework function like $x^x$ to how banks, biologists, and data scientists all describe growth in percentage terms.

What Are The Most Common Mistakes With Logarithmic Differentiation?

These four errors account for most lost marks, and each matches a question real students ask on r/learnmath, r/calculus, and university common-error handouts.

Using the power rule on $x^x$.

Where it slips in:

A student writes $\dfrac{d}{dx}x^x = x\cdot x^{x-1} = x^x$, copying the power rule as if the exponent were a constant.

Don't do this:

Do not apply the power rule when the exponent contains the variable. The power rule needs a constant exponent, and the exponential rule needs a constant base; $x^x$ has neither.

The correct way:

Take logs first: $\ln y = x\ln x$, giving $y' = x^x(\ln x + 1)$. The extra $\ln x$ term is exactly what the power rule misses.

Dropping the $\dfrac{1}{y}$ chain factor on the left.

Where it slips in:

A student differentiates $\ln y$ as if it were a function of $y$ only, writing $\dfrac{d}{dx}\ln y = \dfrac{1}{y}$ and forgetting the $y'$ that the chain rule attaches.

Don't do this:

Do not write $\dfrac{1}{y}$ alone. Because $y$ is itself a function of $x$, the derivative of $\ln y$ is $\dfrac{1}{y}\cdot y' = \dfrac{y'}{y}$.

The correct way:

Always carry the $y'$: the left side is $\dfrac{y'}{y}$, which is what you later multiply through by $y$ to isolate $y'$.

Splitting the log of a sum.

Where it slips in:

A student expands $\ln(x^2 + 1)$ as $\ln(x^2) + \ln 1$, or $\ln(a+b)$ as $\ln a + \ln b$, inventing a law that does not exist.

Don't do this:

Do not break the logarithm of a sum. Only products, quotients, and powers split; $\ln(a+b)$ stays as one piece.

The correct way:

Leave $\ln(x^2+1)$ intact and differentiate it with the chain rule: $\dfrac{d}{dx}\ln(x^2+1) = \dfrac{2x}{x^2+1}$.

Ignoring the domain of the logarithm.

Where it slips in:

A student takes $\ln y$ when $y$ might be negative or zero, for instance differentiating a quotient that dips below the axis, and the logarithm is undefined there.

Don't do this:

Do not assume $\ln y$ exists for every $x$. The natural log needs a positive argument.

The correct way:

Work with $\ln\lvert y\rvert$ instead. Its derivative is still $\dfrac{y'}{y}$, so the method and the final formula are unchanged, and the result now holds wherever $y \neq 0$.

Practice Problems On Logarithmic Differentiation

Work each one, then check against the answer. Answers are verified.

  1. Differentiate $y = x^{\ln x}$ (for $x > 0$).
    (Answer: $\ln y = (\ln x)^2$, so $\dfrac{y'}{y} = \dfrac{2\ln x}{x}$ and $y' = x^{\ln x}\cdot\dfrac{2\ln x}{x}$.)

  2. Differentiate $y = (2x+1)^5(x-3)^4$.
    (Answer: $y' = (2x+1)^5(x-3)^4\left(\dfrac{10}{2x+1} + \dfrac{4}{x-3}\right)$.)

  3. Differentiate $y = x^{\cos x}$ (for $x > 0$).
    (Answer: $y' = x^{\cos x}\left(\dfrac{\cos x}{x} - \sin x,\ln x\right)$.)

  4. Differentiate $y = (\ln x)^x$ (for $x > 1$).
    (Answer: $y' = (\ln x)^x\left(\ln(\ln x) + \dfrac{1}{\ln x}\right)$.)

  5. For $y = x^x$, find the exact slope at $x = 2$.
    (Answer: $y' = x^x(\ln x + 1)$, so at $x = 2$, $y' = 4(\ln 2 + 1) \approx 6.7726$.)

Where Should You Go Next After Logarithmic Differentiation?

The method sits at the crossing of logarithms and calculus, and several natural doors open from here.

  1. Derivatives of exponential functions. See the $x^x = e^{x\ln x}$ route in full, the exponential check used in the examples above.

  2. Derivatives of logarithmic functions. Firm up the derivative of $\ln x$ and the natural logarithm that the whole method leans on.

  3. Implicit differentiation. Strengthen the "carry the $y'$ along" move that makes the left side $\dfrac{y'}{y}$.

If your child is meeting logarithmic differentiation for the first time, a live Bhanzu trainer teaches it from the log laws up, so the four steps become second nature, in the Bhanzu math program.

Book a Free Demo

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is logarithmic differentiation in simple terms?
It is a way to differentiate a hard function by taking the natural log of both sides first. The log turns products, quotients, and powers into sums, differences, and multiples, which are easy to differentiate, and then you solve for $y'$.
When do you use logarithmic differentiation?
Use it when the variable is in both the base and the exponent, such as $x^x$ or $(\sin x)^x$, or when the function is a large product or quotient of powers where the product and quotient rules would be long and error-prone.
Why can't you use the power rule on $x^x$?
Because the power rule needs a constant exponent and the exponential rule needs a constant base, and $x^x$ has a variable in both places. Neither rule applies, so you take a logarithm to bring the exponent down before differentiating.
What is the formula for logarithmic differentiation?
The core identity is $\dfrac{y'}{y} = \dfrac{d}{dx}\big[\ln y\big]$, which rearranges to $y' = y\cdot\dfrac{d}{dx}\big[\ln y\big]$. You expand $\ln y$ with log laws before differentiating the right side.
What does the logarithmic derivative mean geometrically?
The quantity $\dfrac{y'}{y}$ is the slope of the graph of $\ln y$, which is the relative or percentage rate of change of $y$. It answers "how fast is $y$ growing as a fraction of itself," not just "how fast is $y$ growing."
Do you need absolute values when taking the log?
If the function can be negative or zero, yes. Use $\ln\lvert y\rvert$ so the logarithm is always defined; its derivative is still $\dfrac{y'}{y}$, so the working and the final answer do not change.
✍️ Written By
BT
Bhanzu Team
Content Creator and Editor
Bhanzu’s editorial team, known as Team Bhanzu, is made up of experienced educators, curriculum experts, content strategists, and fact-checkers dedicated to making math simple and engaging for learners worldwide. Every article and resource is carefully researched, thoughtfully structured, and rigorously reviewed to ensure accuracy, clarity, and real-world relevance. We understand that building strong math foundations can raise questions for students and parents alike. That’s why Team Bhanzu focuses on delivering practical insights, concept-driven explanations, and trustworthy guidance-empowering learners to develop confidence, speed, and a lifelong love for mathematics.
Related Articles
Book a FREE Demo ClassBook Now →