Logarithmic Differentiation — Find dy/dx if y = xˣ

hard CBSE JEE-MAIN JEE Main 2023 3 min read

Question

Find dydx\dfrac{dy}{dx} if y=xxy = x^x.


Solution — Step by Step

We cannot differentiate xxx^x directly — the base and exponent are both variables. Taking log\log converts this into something we can handle.

logy=log(xx)=xlogx\log y = \log(x^x) = x \log x

Left side uses the chain rule: ddx(logy)=1ydydx\dfrac{d}{dx}(\log y) = \dfrac{1}{y} \cdot \dfrac{dy}{dx}.

Right side uses the product rule: ddx(xlogx)=1logx+x1x=logx+1\dfrac{d}{dx}(x \log x) = 1 \cdot \log x + x \cdot \dfrac{1}{x} = \log x + 1.

So we get:

1ydydx=logx+1\frac{1}{y} \cdot \frac{dy}{dx} = \log x + 1

Multiply both sides by yy:

dydx=y(logx+1)\frac{dy}{dx} = y(\log x + 1)

We always substitute back — leaving yy in the answer is incomplete.

dydx=xx(logx+1)\boxed{\frac{dy}{dx} = x^x(\log x + 1)}

Why This Works

The function y=xxy = x^x is neither a pure power function (like xnx^n, where only the base varies) nor a pure exponential (like axa^x, where only the exponent varies). Standard differentiation rules don’t apply directly because both the base and exponent contain xx.

Logarithmic differentiation is the standard tool for such forms. When we write logy=xlogx\log y = x \log x, the right side is now a simple product of two functions — perfectly handled by the product rule.

This technique extends naturally to products of many functions and to forms like y=f(x)g(x)y = f(x)^{g(x)} in general. Master this once and you handle a whole family of JEE-favourite questions.


Alternative Method

We can rewrite xxx^x using the exponential identity ab=eblnaa^b = e^{b \ln a}:

y=xx=exlnxy = x^x = e^{x \ln x}

Now differentiate using the chain rule:

dydx=exlnxddx(xlnx)\frac{dy}{dx} = e^{x \ln x} \cdot \frac{d}{dx}(x \ln x)

Since ddx(xlnx)=lnx+1\dfrac{d}{dx}(x \ln x) = \ln x + 1:

dydx=exlnx(lnx+1)=xx(lnx+1)\frac{dy}{dx} = e^{x \ln x}(\ln x + 1) = x^x(\ln x + 1)

Same answer, slightly different route. The logarithmic differentiation method (Step-by-Step above) is faster in exams — fewer chances of sign errors.

In JEE Main 2023, this exact function appeared as part of a two-step problem. Students who knew the xxx^x derivative directly saved 30–40 seconds per question across the paper. Memorise the final form: ddx(xx)=xx(1+lnx)\dfrac{d}{dx}(x^x) = x^x(1 + \ln x).


Common Mistake

The most frequent error: treating xxx^x like xnx^n and writing dydx=xxx1=xx\dfrac{dy}{dx} = x \cdot x^{x-1} = x^x.

This is wrong. The power rule ddx(xn)=nxn1\dfrac{d}{dx}(x^n) = nx^{n-1} only applies when the exponent is a constant. Here, the exponent is xx — a variable. Using the power rule here is like applying a formula outside its validity condition, which NCERT explicitly warns against in Chapter 5.

Always ask yourself: “Is the exponent a constant or a variable?” If variable — reach for logarithmic differentiation.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next