Instant PDF download, name-and-email checkout. Complete bundle: every Economics, Statistics and Mathematics book
Mathematics

Implicit Differentiation Examples: Tangents, Second Derivatives and the MRS

How many pastries is one more coffee worth? Learn implicit differentiation through an indifference curve, then tangents, normals and second derivatives.

In 30 seconds
  • Implicit differentiation finds \( \dfrac{dy}{dx} \) when \( x \) and \( y \) are tangled together in one equation, such as \( \sqrt{x} + \sqrt{y} = 6 \) or \( x^3 + y^3 = 9xy \).
  • Differentiate every term with respect to \( x \). Each time you differentiate something in \( y \), the chain rule adds a factor of \( \dfrac{dy}{dx} \).
  • Then collect the \( \dfrac{dy}{dx} \) terms on one side and factorise. The answer usually contains both \( x \) and \( y \), so you need a point on the curve to get a number.
  • In economics the gradient of an indifference curve is minus the marginal rate of substitution (MRS): how much of one good a person will give up for one more unit of the other.
  • Exam point: write \( \dfrac{dy}{dx} \) after every \( y \)-term the moment you differentiate it. Forgetting it is the most common lost mark.

The case: how many pastries is one more coffee worth?

Sara visits the same café every month. She buys \( x \) coffees and \( y \) pastries, and her satisfaction can be modelled by the utility function \( U = \sqrt{x} + \sqrt{y} \). (The function and the numbers are illustrative, but this square-root form is a standard textbook model of preferences.) This month she has 16 coffees and 4 pastries, so her utility is \( \sqrt{16} + \sqrt{4} = 6 \).

Every combination that also gives her a utility of 6 is equally good to her. Those combinations form her indifference curve:

\[ \sqrt{x} + \sqrt{y} = 6 \]

The café manager wants to run a swap offer and asks a simple question: at Sara’s current mix, how many pastries would she give up in exchange for one extra coffee, and still feel just as well off? That is a question about the gradient of the curve at \( (16, 4) \).

The concept: differentiating a relation, not a function

Most of the differentiation you have done starts with \( y = \) something in \( x \). An indifference curve is written differently. It is a relation: a rule that links \( x \) and \( y \) without putting \( y \) on its own. Sometimes you could rearrange it; often (as with \( x^3 + y^3 = 9xy \)) you cannot, or the rearranged form is ugly.

Implicit differentiation skips the rearranging. The idea is that along the curve, \( y \) still changes when \( x \) changes, so we can treat \( y \) as some unknown function of \( x \). Then we differentiate both sides of the equation with respect to \( x \), term by term. A term in \( x \) differentiates as usual. A term in \( y \) is a function of a function, so the chain rule applies: differentiate with respect to \( y \), then multiply by \( \dfrac{dy}{dx} \).

For example, \( \dfrac{d}{dx}\left(y^2\right) = 2y\dfrac{dy}{dx} \), and \( \dfrac{d}{dx}\left(\sqrt{y}\right) = \dfrac{1}{2\sqrt{y}}\dfrac{dy}{dx} \). A product such as \( xy \) needs the product rule: \( \dfrac{d}{dx}(xy) = y + x\dfrac{dy}{dx} \).

Key termImplicit differentiation: finding \( \dfrac{dy}{dx} \) from an equation linking \( x \) and \( y \) by differentiating every term with respect to \( x \), using the chain rule on each \( y \)-term, and then solving for \( \dfrac{dy}{dx} \).

The formula

The whole method rests on one chain-rule line. For any differentiable function \( g \),

\[ \frac{d}{dx}\,g(y) = g'(y)\,\frac{dy}{dx} \]

Here \( g(y) \) is any expression in \( y \) alone (such as \( y^3 \), \( \sqrt{y} \) or \( e^{y} \)), \( g'(y) \) is its ordinary derivative with respect to \( y \), and \( \dfrac{dy}{dx} \) is the gradient of the curve, the quantity we want. For an indifference curve, economists then define

\[ \text{MRS} = -\frac{dy}{dx} \]

The minus sign turns the negative gradient into a positive “exchange rate”: the number of units of \( y \) the person would give up for one more unit of \( x \)[2].

Mathematics Made Simple textbook coverChapter 11 of Mathematics Made Simple builds implicit differentiation, inverses and related rates from scratch.Get the textbook · $12

Why this formula fits the case

Sara’s curve can be rearranged to \( y = (6-\sqrt{x})^2 \), but it takes a step and the derivative then needs the chain rule anyway. Implicit differentiation goes straight from the equation she was given to the gradient, and it gives the gradient in a neat, symmetric form that economists like to read.

It is the right tool whenever the relation is easier to state than to solve: indifference curves, isoquants (combinations of labour and capital giving the same output), circles, and curves like \( x^3 + y^3 = 9xy \) that cannot be written as a single \( y = f(x) \) at all. It is not needed when the equation is already \( y = f(x) \); then ordinary differentiation is shorter. And it only tells you the gradient at points that actually lie on the curve, so always check the point first.

Setting it up

  • Variables: \( x \) = coffees per month (horizontal axis), \( y \) = pastries per month (vertical axis). Both are positive, so \( x > 0 \) and \( y > 0 \), which keeps the square roots defined.
  • The relation: \( \sqrt{x} + \sqrt{y} = 6 \), which is \( x^{1/2} + y^{1/2} = 6 \) in index form.
  • The point: \( (16, 4) \). Check: \( \sqrt{16} + \sqrt{4} = 4 + 2 = 6 \). It is on the curve.
  • Units of the answer: \( \dfrac{dy}{dx} \) is measured in pastries per coffee.

Solving it

Worked example

Find \( \dfrac{dy}{dx} \) for \( \sqrt{x} + \sqrt{y} = 6 \), and hence Sara’s MRS at \( (16, 4) \).

Step 1Differentiate each term with respect to \( x \): \( \dfrac{1}{2\sqrt{x}} + \dfrac{1}{2\sqrt{y}}\dfrac{dy}{dx} = 0 \). The right-hand side is a constant, so its derivative is 0.
Step 2Move the \( x \)-term across: \( \dfrac{1}{2\sqrt{y}}\dfrac{dy}{dx} = -\dfrac{1}{2\sqrt{x}} \).
Step 3Multiply both sides by \( 2\sqrt{y} \): \( \dfrac{dy}{dx} = -\dfrac{\sqrt{y}}{\sqrt{x}} \).
Step 4Substitute \( (16, 4) \): \( \dfrac{dy}{dx} = -\dfrac{\sqrt{4}}{\sqrt{16}} = -\dfrac{2}{4} = -0.5 \).
Step 5MRS \( = -\dfrac{dy}{dx} = 0.5 \) pastries per coffee.

Check by the explicit route: \( y = (6-\sqrt{x})^2 \) gives \( \dfrac{dy}{dx} = 2(6-\sqrt{x}) \times \left(-\dfrac{1}{2\sqrt{x}}\right) = -\dfrac{6-\sqrt{x}}{\sqrt{x}} \). At \( x = 16 \) this is \( -\dfrac{2}{4} = -0.5 \). Same answer, and since \( 6-\sqrt{x} = \sqrt{y} \) on the curve, the same formula.

The next example has no explicit form at all, which is where the method earns its keep. It is the kind of curve that appears on exam papers.

Worked example

The curve \( x^3 + y^3 = 9xy \) passes through \( (2, 4) \). Find the equations of the tangent and the normal at that point.

Step 1Check the point: \( 2^3 + 4^3 = 8 + 64 = 72 \) and \( 9 \times 2 \times 4 = 72 \). It lies on the curve.
Step 2Differentiate, using the product rule on \( 9xy \): \( 3x^2 + 3y^2\dfrac{dy}{dx} = 9y + 9x\dfrac{dy}{dx} \).
Step 3Collect the \( \dfrac{dy}{dx} \) terms: \( (3y^2-9x)\dfrac{dy}{dx} = 9y-3x^2 \).
Step 4Divide by 3 and solve: \( \dfrac{dy}{dx} = \dfrac{3y-x^2}{y^2-3x} \).
Step 5At \( (2, 4) \): \( \dfrac{dy}{dx} = \dfrac{12-4}{16-6} = \dfrac{8}{10} = \dfrac{4}{5} \).
Step 6Tangent: \( y-4 = \tfrac{4}{5}(x-2) \), so \( 5y-20 = 4x-8 \), giving \( 4x-5y + 12 = 0 \).
Step 7Normal: gradient \( -\tfrac{5}{4} \), so \( y-4 = -\tfrac{5}{4}(x-2) \), giving \( 4y-16 = -5x + 10 \), that is \( 5x + 4y-26 = 0 \).

Both lines pass through \( (2, 4) \): \( 8-20 + 12 = 0 \) and \( 10 + 16-26 = 0 \). The gradients \( \tfrac{4}{5} \) and \( -\tfrac{5}{4} \) multiply to \( -1 \), as perpendicular lines must.

Economists also care about how the MRS changes along the curve, which needs the second derivative. You can get it by differentiating the first-derivative formula again, still treating \( y \) as a function of \( x \).

Worked example

For \( \sqrt{x} + \sqrt{y} = 6 \), find \( \dfrac{d^2y}{dx^2} \) at \( (16, 4) \) and say what its sign means.

Step 1Write the first derivative in index form: \( \dfrac{dy}{dx} = -y^{1/2}x^{-1/2} \).
Step 2Product rule, with the chain rule on \( y^{1/2} \): \( \dfrac{d^2y}{dx^2} = -\tfrac{1}{2}y^{-1/2}x^{-1/2}\dfrac{dy}{dx} + \tfrac{1}{2}y^{1/2}x^{-3/2} \).
Step 3At \( (16, 4) \): \( y^{-1/2} = \tfrac{1}{2} \), \( x^{-1/2} = \tfrac{1}{4} \), \( \dfrac{dy}{dx} = -\tfrac{1}{2} \), \( y^{1/2} = 2 \), \( x^{-3/2} = \tfrac{1}{64} \).
Step 4First term: \( -\tfrac{1}{2} \times \tfrac{1}{2} \times \tfrac{1}{4} \times \left(-\tfrac{1}{2}\right) = \tfrac{1}{32} \). Second term: \( \tfrac{1}{2} \times 2 \times \tfrac{1}{64} = \tfrac{1}{64} \).
Step 5\( \dfrac{d^2y}{dx^2} = \tfrac{1}{32} + \tfrac{1}{64} = \tfrac{3}{64} \approx 0.0469 \).

The second derivative is positive, so the curve is concave up (it bows towards the origin). The gradient is getting less steep as \( x \) grows, which means the MRS is falling.

Mathematics Made Simple Practice Questions coverDrill implicit curves, tangents and normals with 1,565 practice questions, each with a fully worked answer.Get 1,565 questions · $9

What the answer tells us

An MRS of 0.5 means that, at 16 coffees and 4 pastries, Sara values one more coffee at about half a pastry. Turn it round and one extra pastry is worth about 2 coffees to her. She already has plenty of coffee and not much pastry, so coffee is the cheap item in her eyes. A swap offer that charges her more than half a pastry’s worth for an extra coffee will not tempt her.

The gradient is a tangent-line estimate, so it is exact only for very small changes. We can test it. One more coffee means \( x = 17 \), and staying on the curve needs \( y = (6-\sqrt{17})^2 \approx 3.523 \). She gives up about 0.48 pastries, close to the 0.5 the gradient predicted. For one more pastry, \( y = 5 \) needs \( x = (6-\sqrt{5})^2 = 41-12\sqrt{5} \approx 14.167 \), so she gives up about 1.83 coffees rather than exactly 2. The estimates are slightly too big because the curve bends away from its tangent, exactly as the positive second derivative said.

Sensitivity: the MRS depends on where she is on the curve. At the balanced point \( (9, 9) \) the gradient is \( -\sqrt{9}/\sqrt{9} = -1 \), so she swaps one for one. The further she moves towards lots of coffee and few pastries, the less she will give up for yet another coffee. That pattern is called a diminishing marginal rate of substitution, and Figure 1 shows it as tangents getting flatter from left to right.

Indifference curves √x + √y = 6 and = 5, with the tangent at (16, 4)
√x + √y = 6 (U = 6)√x + √y = 5 (U = 5)tangent at (16, 4): gradient −½tangent at (9, 9): gradient −1
4812162024283236481216200x (coffees per month)y (pastries)(16, 4)(9, 9)
Figure 1. Both curves bend towards the origin, so the gradient gets flatter as x grows: the marginal rate of substitution falls from 1 at (9, 9) to ½ at (16, 4). Illustrative preferences.
Common mistakeWriting \( \dfrac{d}{dx}\left(y^3\right) = 3y^2 \). The variable you are differentiating with respect to is \( x \), not \( y \), so the chain rule adds a factor: \( 3y^2\dfrac{dy}{dx} \). A quick test: if your final answer has no way to isolate \( \dfrac{dy}{dx} \), you dropped one somewhere.
Common mistakeTreating \( xy \) as if only one part varies. It is a product of two things that both change with \( x \), so \( \dfrac{d}{dx}(9xy) = 9y + 9x\dfrac{dy}{dx} \). Writing just \( 9y \) or just \( 9x\dfrac{dy}{dx} \) loses the method mark.
Exam tipImplicit differentiation is AP Calculus AB/BC topic 3.2, with implicit second derivatives in topic 3.6[3]. Cambridge 9709 tests it in Papers 2 and 3 (sections 2.4 and 3.4), usually as “find the tangent or normal at a point”[4]. In IB Mathematics: analysis and approaches it is HL topic 5.14[5]. Many questions say “show that \( \dfrac{dy}{dx} = \dots \)”: write every line, because the answer is given and the marks are for the working.

If you want the full build-up, from the chain rule to inverse functions and related rates, the Mathematics Made Simple textbook covers it in Chapters 10 and 11, with economics applications in Appendix B.

Mathematics Made Simple bundle coverGet the textbook and practice book together for $16 and save $5 on your calculus revision.Both books · $16

Practice questions

Work each one on paper, then open the worked answer. For a much bigger bank at every level, the Mathematics Made Simple practice book has 1,565 questions with full solutions and two mock papers.

EasyQ1. Find the gradient of the circle \( x^2 + y^2 = 169 \) at the point \( (5, 12) \). Show worked answer
Differentiate: \( 2x + 2y\dfrac{dy}{dx} = 0 \), so \( \dfrac{dy}{dx} = -\dfrac{x}{y} \).
At \( (5, 12) \): \( \dfrac{dy}{dx} = -\dfrac{5}{12} \approx -0.417 \).
Check: the radius to \( (5, 12) \) has gradient \( \tfrac{12}{5} \), and \( -\tfrac{5}{12} \times \tfrac{12}{5} = -1 \), so the tangent is perpendicular to the radius, as it should be.
EasyQ2. A workshop’s isoquant for 48 units of output is \( LK = 48 \), where \( L \) is labour hours and \( K \) is machine hours. Find \( \dfrac{dK}{dL} \) at \( L = 6 \) and interpret it. Show worked answer
At \( L = 6 \), \( K = 48/6 = 8 \).
Product rule: \( K + L\dfrac{dK}{dL} = 0 \), so \( \dfrac{dK}{dL} = -\dfrac{K}{L} \).
At \( (6, 8) \): \( \dfrac{dK}{dL} = -\dfrac{8}{6} = -\dfrac{4}{3} \approx -1.33 \).
One extra labour hour can replace about 1.33 machine hours while output stays at 48.
MediumQ3. The curve \( x^2y + y^3 = 10 \) passes through \( (3, 1) \). Find the equation of the tangent at this point. Show worked answer
Check: \( 9 \times 1 + 1 = 10 \). Yes.
Differentiate: \( 2xy + x^2\dfrac{dy}{dx} + 3y^2\dfrac{dy}{dx} = 0 \).
So \( \dfrac{dy}{dx} = -\dfrac{2xy}{x^2 + 3y^2} \). At \( (3, 1) \): \( -\dfrac{6}{9 + 3} = -\dfrac{1}{2} \).
Tangent: \( y-1 = -\tfrac{1}{2}(x-3) \), so \( y = -\tfrac{1}{2}x + \tfrac{5}{2} \), or \( x + 2y-5 = 0 \).
MediumQ4. A consumer’s indifference curve is \( xy^2 = 500 \). Find the MRS at \( (5, 10) \) and at \( (20, 5) \), and comment. Show worked answer
Differentiate: \( y^2 + 2xy\dfrac{dy}{dx} = 0 \), so \( \dfrac{dy}{dx} = -\dfrac{y}{2x} \) and MRS \( = \dfrac{y}{2x} \).
Both points are on the curve: \( 5 \times 100 = 500 \) and \( 20 \times 25 = 500 \).
At \( (5, 10) \): MRS \( = \dfrac{10}{10} = 1 \). At \( (20, 5) \): MRS \( = \dfrac{5}{40} = \dfrac{1}{8} = 0.125 \).
With more \( x \) and less \( y \), the consumer gives up far less \( y \) for another unit of \( x \): a diminishing MRS.
ExamQ5. A curve has equation \( x^2-xy + y^2 = 7 \). (a) Show that \( \dfrac{dy}{dx} = \dfrac{2x-y}{x-2y} \). [3] (b) Find the equation of the tangent at \( (3, 2) \). [2] (c) Find the exact coordinates of the points where the tangent is horizontal. [4] Show worked answer
(a) \( 2x-\left(y + x\dfrac{dy}{dx}\right) + 2y\dfrac{dy}{dx} = 0 \) [1, product rule on \( xy \)]. So \( (2y-x)\dfrac{dy}{dx} = y-2x \) [1], and multiplying top and bottom by \( -1 \) gives \( \dfrac{dy}{dx} = \dfrac{2x-y}{x-2y} \) [1].
(b) \( (3, 2) \) is on the curve: \( 9-6 + 4 = 7 \). Gradient \( = \dfrac{6-2}{3-4} = -4 \) [1]. Tangent: \( y-2 = -4(x-3) \), so \( y = -4x + 14 \) [1].
(c) Horizontal means \( 2x-y = 0 \), so \( y = 2x \) [1]. Substitute: \( x^2-2x^2 + 4x^2 = 3x^2 = 7 \) [1], so \( x = \pm\sqrt{7/3} \) [1]. The points are \( \left(\sqrt{7/3},\ 2\sqrt{7/3}\right) \) and \( \left(-\sqrt{7/3},\ -2\sqrt{7/3}\right) \), about \( (1.528, 3.055) \) and \( (-1.528, -3.055) \) [1]. The denominator there is \( x-4x = -3x \ne 0 \), so the gradient really is 0.

Frequently asked questions

What is implicit differentiation in simple terms?

It is a way to find the gradient of a curve whose equation mixes \( x \) and \( y \). You differentiate both sides with respect to \( x \), attach \( \dfrac{dy}{dx} \) to every \( y \)-term by the chain rule, and then solve for \( \dfrac{dy}{dx} \)[1].

Why does a \( \dfrac{dy}{dx} \) appear when I differentiate \( y^2 \)?

Because \( y \) depends on \( x \). The expression \( y^2 \) is a function of a function, so by the chain rule its derivative is \( 2y \) times the rate at which \( y \) itself changes, which is \( \dfrac{dy}{dx} \).

Why does my answer contain both \( x \) and \( y \)?

That is normal. The gradient depends on where you are on the curve, and on an implicit curve a single \( x \) can match several \( y \)-values (a circle has two points for most \( x \)). Substitute the coordinates of the point you want.

How is implicit differentiation used in economics?

The gradient of an indifference curve gives the marginal rate of substitution, and the gradient of an isoquant gives the marginal rate of technical substitution between labour and capital. Both come straight from implicit differentiation of the curve’s equation.

References

  1. Strang, G. and Herman, E. (2016) Calculus Volume 1, Section 3.8 Implicit Differentiation. Houston: OpenStax. https://openstax.org/details/books/calculus-volume-1
  2. Varian, H. R. (2014) Intermediate Microeconomics: A Modern Approach, 9th edn. New York: W. W. Norton.
  3. College Board. AP Calculus AB and AP Calculus BC Course and Exam Description. apcentral.collegeboard.org
  4. Cambridge International. Cambridge International AS & A Level Mathematics 9709: Syllabus for 2026 and 2027. cambridgeinternational.org
  5. International Baccalaureate Organization. Mathematics: analysis and approaches guide (first assessment 2021). ibo.org
Mathematics Made Simple complete bundle cover
This topic has a full chapter in Mathematics Made Simple, with 1,565 fully worked practice questions in the bundle.Mathematics Made Simple Complete Bundle — Textbook + 1,565 Practice Questions
Get it for $16
E

The EconTutorials team writes clear, exam-focused lessons in economics and statistics for A-Level, IB, AP and university students, with more than 13 years of classroom teaching behind every guide and book in the Made Simple series.