On this page
Many worked solutions stop at the general formula. Here we also put in the point (2, 4) and check the number four ways.
This exact equation is Question 13 of Exercise 5.5 in the NCERT Class 12 Mathematics chapter on continuity and differentiability, written there as yˣ = xʸ. In that chapter, log x means the natural logarithm (base e), so log in NCERT and ln below are the same thing.
How do you differentiate x^y = y^x?
You cannot make y the subject, and both sides have a variable in the exponent. Taking logarithms brings the exponents down, as in NCERT's worked examples on logarithmic differentiation. Work with x > 0 and y > 0 so the logs exist.
Take ln of both sides: y ln x = x ln y.
Differentiate the left side with the product rule: (dy/dx) ln x + y · (1/x).
Differentiate the right side with the product rule, remembering that y depends on x: ln y + x · (1/y) · (dy/dx).
Set the two equal and collect the dy/dx terms on one side: (dy/dx)(ln x − x/y) = ln y − y/x.
Divide: dy/dx = (ln y − y/x) / (ln x − x/y).
Clear the small fractions by multiplying top and bottom by xy: dy/dx = y(x ln y − y) / [x(y ln x − x)].
Both forms are correct. If implicit differentiation feels shaky, the step-by-step x² + y² = 25 example is a gentler start, and our guide to implicit and logarithmic differentiation for Class 12 and JEE covers the general method.
What is dy/dx at the point (2, 4)?
First, check that the point is on the curve: 2⁴ = 16 and 4² = 16. The reference page on the equation xʸ = yˣ notes that 2 and 4 are the only pair of different positive whole numbers that work, a fact stated in a 1728 letter from Bernoulli to Goldbach.
Now put x = 2 and y = 4 into the simplified form, using ln 4 = 2 ln 2.
Top: 4(2 ln 4 − 4) = 4(4 ln 2 − 4) = 16(ln 2 − 1).
Bottom: 2(4 ln 2 − 2) = 4(2 ln 2 − 1).
So dy/dx = 16(ln 2 − 1) / [4(2 ln 2 − 1)] = 4(ln 2 − 1) / (2 ln 2 − 1).
With ln 2 ≈ 0.6931, the top is 4 × (−0.3069) ≈ −1.2274 and the bottom is about 0.3863, so dy/dx ≈ −3.18. Give the exact form as your answer unless a decimal is asked for.
How can you check that the answer is right?
A slope like −3.18 is easy to get wrong by one sign. These checks catch most slips.
The sign. The curve through (2, 4) runs downhill: as x grows from 2 towards e, y falls from 4 towards e, where this branch meets the line y = x (the same reference page gives the crossing point (e, e)). A negative slope fits.
The mirror test. Swapping x and y leaves xʸ = yˣ unchanged, so the curve is its own reflection in y = x. Reflection swaps rise and run, so the slope at (4, 2) must be 1 over the slope at (2, 4). The formula at x = 4, y = 2 gives (2 ln 2 − 1) / [4(ln 2 − 1)] ≈ −0.31, and 1/(−3.18) ≈ −0.31 as well.
The line y = x. Every point with y = x satisfies the equation. Put y = x into the formula and it becomes (ln x − 1)/(ln x − 1) = 1, the slope of that line. The one exception is x = e, where you get 0/0 because two branches cross there.
A small step. Move from x = 2 to x = 2.01 and estimate y ≈ 4 − 3.18 × 0.01 ≈ 3.968. Then y ln x and x ln y both come to about 2.770, so the nearby point still sits on the curve.
Where do students go wrong with x^y = y^x?
Using the power rule on xʸ as if y were a constant, which gives y · xʸ⁻¹ and ignores that the exponent changes too.
Losing a minus sign while moving the dy/dx terms to one side.
Plugging in a point without first checking that it lies on the curve.
Leaving ln 4 unsimplified, so the answer looks different from the key.
For practice, NCERT's Exercise 5.5 also has xʸ + yˣ = 1 (Question 12) and (cos x)ʸ = (cos y)ˣ (Question 14). If a question asks for d²y/dx² next, see our second derivative of an implicit function walk-through.
If you get stuck collecting the dy/dx terms, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. If the log rules themselves are the gap, the Fermi Concept Library gives each concept in mathematics its own lesson.



