Implicit Differentiation

Updated 15 min read Intermediate Baca dalam Bahasa Indonesia

Calculus Proof Computing

Quick answer

Implicit differentiation finds (dy)/(dx) from an equation in x and y without solving it for y: differentiate both sides with respect to x, treating y as a differentiable function of x, then collect the terms with (dy)/(dx) and solve for it. Each y brings a factor (dy)/(dx) by the chain rule, so (d)/(dx)y^2=2y (dy)/(dx). For the circle x^2+y^2=25 this gives (dy)/(dx)=-x/y, the slope at every point where y\ne0.

Key takeaways

  • An equation such as x^3+y^3=9xy defines y implicitly: near most of its points the curve is the graph of a differentiable function of x, even when no formula for it can be written.
  • Method: differentiate both sides with respect to x (a factor (dy)/(dx) for every y), collect the terms with (dy)/(dx), solve; the answer usually contains both x and y.
  • At a point of the curve with slope m the tangent line is y-y_0=m(x-x_0) and the normal line has slope -\frac1m; the tangent is horizontal where the numerator of (dy)/(dx) is 0 and vertical where the denominator is 0.
  • For the second derivative differentiate (dy)/(dx) again, put the formula for (dy)/(dx) back in, and use the original equation to simplify: for x^2+y^2=25, (d^2y)/(dx^2)=-(25)/(y^3).
  • Implicit differentiation of y^q=x^p proves the power rule (d)/(dx)x^p/q=\frac pq x^p/q-1 for every rational exponent.
  • Check that the point is on the curve, expect \frac00 at points where the curve crosses itself, and remember that the formula is only a formula: x^2+y^2=-1 has no points and still gives -\frac xy.

What is an implicit function, and why can you not always solve for y?

An implicit function is a function that an equation in x and y defines without giving y by a formula: y is whatever number makes the equation true. Most of the functions so far were explicit, y=f(x), with y alone on one side. Three equations are different:

  • y^2=x gives two values of y for each x>0, namely √ x and -√ x;
  • x^2+y^2=25, the circle of radius 5, gives y=√(25-x^2) or y=-√(25-x^2);
  • x^3+y^3=9xy, the folium of Descartes, is a cubic in y with no simple formula for its three solutions.

Each of these is a relation, not a function: a value of x can have more than one y. But the curve can be cut into arcs, and each arc is the graph of a differentiable function of x, for example the lower half of the circle through (3,-4).

Why this matters. The slope of such a curve is still the derivative of those arcs, and the derivative rules will find it if we are able to differentiate the equation itself instead of a formula for y. That is implicit differentiation. It is the only way for the folium, and for the circle it is shorter than the explicit way.

The assumption. In every example the equation is assumed to determine y as a differentiable function of x near the point in question, so that (dy)/(dx) exists. The section on what can go wrong says when that fails.

How does implicit differentiation work?

To differentiate implicitly, differentiate both sides of the equation with respect to x, treating y as a differentiable function of x, collect the terms with (dy)/(dx) on one side, and solve for (dy)/(dx).

  1. Differentiate both sides with respect to x, treating y as a differentiable function of x.
  2. Collect the terms with (dy)/(dx) on one side and solve for (dy)/(dx).

Where the factor comes from. The word treating is the chain rule. With y=f(x), y^2 is a composite function: the outside is a square and the inside is y, so (d)/(dx)y^2=2y·(dy)/(dx). In general every function of y gets one extra factor y': (d)/(dx)f(y)=f'(y)·(dy)/(dx), and a product such as xy needs the product rule: (d)/(dx)(xy)=y+x (dy)/(dx). A function of x alone gets no factor.

Example 1. Find (dy)/(dx) if y^2=x. The equation defines two functions we can write, y=√ x and y=-√ x for x>0, with derivatives (1)/(2√ x) and -(1)/(2√ x). But without knowing them, differentiate both sides: 2y (dy)/(dx)=1, (dy)/(dx)=(1)/(2y). One formula gives both: (1)/(2y)=(1)/(2√ x) when y=√ x and (1)/(2y)=-(1)/(2√ x) when y=-√ x.

Example 2. Find the slope of the circle x^2+y^2=25 at the point (3,-4). Differentiate: 2x+2y (dy)/(dx)=0, (dy)/(dx)=-x/y. At (3,-4) the slope is -(3)/(-4)=\frac34. The explicit way agrees: the lower semicircle is y=-√(25-x^2), whose derivative (x)/(√(25-x^2)) is \frac34 at x=3. Notice that the explicit formula only works on that half of the circle, but -\frac xy works everywhere on the circle except where y=0, and that it contains both variables.

Example 3. Find (dy)/(dx) if y^2=x^2+\sin(xy). Differentiate both sides, using the product rule inside the sine: 2y y'=2x+\cos(xy) (y+x y'). Collect the terms with y' on the left: 2y y'-x\cos(xy) y'=2x+y\cos(xy). Factor and solve: y'=(2x+y\cos(xy))/(2y-x\cos(xy)). The formula applies at every point of the curve where the denominator is not 0.

Type any equation in x and y below, with a point to find the tangent and normal lines there. The curve is drawn, the steps are shown, and the slope is checked by solving the equation numerically on both sides of the point.

Interactive: differentiate an equation implicitly

Type an equation in x and y, and see both sides differentiated, the terms with y′ collected and solved, the slope, tangent line and normal line at a point of the curve, and the second derivative, with the curve drawn and the slope checked numerically.

How do you find tangent and normal lines to an implicit curve?

At a point (x_0,y_0) of the curve where the slope is m, the tangent line is y-y_0=m(x-x_0) and the normal line, perpendicular to it, has slope -\frac1m. First check that the point is on the curve, then evaluate (dy)/(dx) there with both coordinates. The two lines are the tangent line equation of the earlier article, with the slope found implicitly. The normal line matters in optics: the angles at which a ray of light enters a lens are measured from the normal line to the surface.

Example 4. Show that (2,4) lies on the folium x^3+y^3=9xy, and find the tangent and normal lines there. The point is on the curve because 8+64=72=9·2·4. Differentiate: 3x^2+3y^2y'=9y+9x y'. Collect and solve, then divide the top and bottom by 3: y'=(9y-3x^2)/(3y^2-9x)=(3y-x^2)/(y^2-3x). At (2,4) the slope is (12-4)/(16-6)=\frac45. The tangent line is y-4=\frac45(x-2), that is y=\frac45x+(12)/(5). The normal line has slope -\frac54: y-4=-\frac54(x-2), that is y=-\frac54x+(13)/(2).

Example 5: parallel tangents. The curve x^2+xy+y^2=7 meets the x-axis where y=0 and x^2=7, at \left(√7,0\right) and \left(-√7,0\right). Differentiating gives 2x+y+x y'+2y y'=0, so y'=-(2x+y)/(x+2y). At both points y=0 and the slope is -(2x)/(x)=-2: the tangent lines are parallel.

Example 6: horizontal and vertical tangents of the folium. A tangent is horizontal where the numerator of y'=(3y-x^2)/(y^2-3x) is 0, that is y=(x^2)/(3), and vertical where the denominator is 0, that is y^2=3x. Put y=(x^2)/(3) in the equation of the curve: x^3+(x^6)/(27)=3x^3, x^6=54 x^3. Apart from the origin, x^3=54, so x=54^(1/3)=32^(1/3)≈3.78 and y=(x^2)/(3)=34^(1/3)≈4.76. The equation does not change when x and y are swapped, so the vertical tangent is at the mirror point \left(34^(1/3), 32^(1/3)\right)≈(4.76, 3.78).

Move a point around a circle, an ellipse and a rounded square below, and watch the tangent and normal lines turn.

Interactive: a point round a curve

Move a point round a circle, an ellipse or a rounded square and watch its tangent and normal lines turn, with the slope from y′ = −x/y and its relatives, horizontal where the numerator is 0 and vertical where the denominator is 0.

How do you find the second derivative of an implicit function?

To find (d^2y)/(dx^2), differentiate the formula for y' again, treating y as a function of x, and then put the formula for y' in place of every y' that appears. The result has only x and y in it, and the original equation can often shorten it.

Example 7. Find y'' if 2x^3-3y^2=8. First, 6x^2-6y y'=0, so y'=(x^2)/(y) (y\ne0). Differentiate with the quotient rule, remembering that y is a function of x: y''=(2x· y-x^2· y')/(y^2). Now substitute y'=(x^2)/(y): y''=(2xy-x^2·(x^2)/(y))/(y^2)=(2x)/(y)-(x^4)/(y^3).

Example 8: the circle. For x^2+y^2=25 we found y'=-x/y. Then y''=-(y-x y')/(y^2)=-(y+(x^2)/(y))/(y^2) =-(x^2+y^2)/(y^3). The original equation says x^2+y^2=25, so (d^2y)/(dx^2)=-(25)/(y^3). At (3,-4) that is (25)/(64)>0: the lower semicircle is bent upward there, like a bowl, as it should be. At (0,5) it is -(25)/(125)=-\frac15<0: the top of the circle bends downward.

The same pattern works for third and higher derivatives: each step differentiates the previous formula and replaces y' again. Tick also the second derivative in the tool above to see y'' for any equation; the formulas come out longer than by hand, because the tool does not use the original equation to shorten them.

How does implicit differentiation prove the power rule for fractions?

If p and q are integers with q>0 and y=x^p/q, then (dy)/(dx)=\frac pq x^p/q-1: the power rule holds for every rational exponent. The proof is implicit differentiation of an equation that has no fraction in it. Since y=x^p/q, we have y^q=x^p. Differentiate both sides with respect to x: q y^q-1 y'=p x^p-1. Solve for y', and replace y^q-1 by x^p(q-1)/q: y'=\frac pq·(x^p-1)/(y^q-1) =\frac pq· x^p-1-(p(q-1))/(q)=\frac pq· x^\frac pq-1. The exponent works out because p-1-p+\frac pq=\frac pq-1. The result holds where y\ne0 and y is differentiable.

Examples. For y=√ x take y^2=x: 2y y'=1 and y'=(1)/(2√ x). For y=x^2/3 take y^3=x^2: 3y^2y'=2x, so y'=(2x)/(3y^2)=(2x)/(3x^4/3)=\frac23 x^-1/3. This is the derivative of x^2/3 met in the earlier articles, which is undefined at x=0, as the formula x^-1/3 predicts.

The chain rule then lets the exponent sit on any function: (d)/(dx)u^p/q=\frac pq u^p/q-1(du)/(dx).

What can go wrong with implicit differentiation?

The formula y'=-\frac AB is only meaningful at points that are on the curve and where B\ne0; at other points it is wrong, undefined, or \frac00.

  • The point must be on the curve. The formula -\frac xy gives a number at (1,1), but (1,1) is not on x^2+y^2=25, so that number is the slope of nothing. Always check that the coordinates satisfy the equation first, as in Example 4.
  • A zero denominator means a vertical tangent, not "no tangent". Where B=0 and A\ne0 the quantity (dy)/(dx) does not exist but the curve is smooth and its tangent line is vertical: on the circle at (5,0) and (-5,0), where y=0. In the folium, at \left(34^(1/3),32^(1/3)\right).
  • \frac00 at a crossing. At the origin the folium's formula (3y-x^2)/(y^2-3x) is \frac00. That is not a slope of 0. Near the origin the term 9xy dominates, so the curve looks like xy=0: two branches cross there, one along each axis, with tangents y=0 and x=0. A point where a curve crosses itself has two tangent lines and no single slope.
  • A formula is not a curve. The equation x^2+y^2=-1 is satisfied by no real point, yet differentiating it produces y'=-\frac xy just the same. The method assumes that y exists as a differentiable function, and does not check it.
  • When does the assumption hold? If the equation is F(x,y)=0 with smooth F and B\ne0 at a point of the curve, the implicit function theorem says that near that point the curve really is the graph of a differentiable function y(x). That is why a nonzero denominator is the condition to look at.

How do you differentiate implicitly in code?

SymPy has the method built in: sp.idiff(F, y, x) differentiates the equation F(x,y)=0 implicitly and returns (dy)/(dx), and a fourth argument asks for a higher derivative. The equation is given as an expression equal to zero, so x^3+y^3=9xy becomes x**3 + y**3 - 9xy. SymPy writes the folium's slope as (x^2-3y)/(3x-y^2), which is our (3y-x^2)/(y^2-3x) with the top and bottom both multiplied by -1. For the circle it gives the second derivative -1/y\left((x^2)/(y^2)+1\right), which is -(x^2+y^2)/(y^3).

A check that needs no calculus. Solve the equation numerically for y at x=2+h and at x=2-h with Newton's method, and take the difference quotient: it is the slope, because it is the derivative of the function that the curve defines, with no formula for y ever written.

Python and SymPy: implicit derivatives, checked numerically
import sympy as sp

x, y = sp.symbols('x y')
print(sp.idiff(x**3 + y**3 - 9 * x * y, y, x))          # (x**2 - 3*y)/(3*x - y**2)
print(sp.idiff(x**2 + y**2 - 25, y, x, 2))              # -(x**2/y**2 + 1)/y
print(sp.idiff(2 * x**3 - 3 * y**2 - 8, y, x, 2))       # x*(-x**3/y**2 + 2)/y
print(sp.simplify(sp.idiff(sp.sin(x * y) - x - y, y, x)))   # (-y*cos(x*y) + 1)/(x*cos(x*y) - 1)


def solve_y(x, y):
    """Newton's method on F(x, y) = 0, for y, starting from a guess."""
    for _ in range(50):
        f = x**3 + y**3 - 9 * x * y
        d = 3 * y**2 - 9 * x                              # the derivative of F with respect to y
        y -= f / d
    return y


h = 1e-6
print(round((solve_y(2 + h, 4) - solve_y(2 - h, 4)) / (2 * h), 6))   # 0.8  (a difference quotient of the solutions)
print(round(solve_y(2, 4), 6))                                        # 4.0  (the point (2, 4) is on the curve)
slope = lambda x, y: (3 * y - x**2) / (y**2 - 3 * x)
print(round(slope(2, 4), 6))                                          # 0.8  (the formula of Example 4)
C++
#include <iostream>
#include <cstdio>
using namespace std;

// Newton's method on F(x, y) = x^3 + y^3 - 9xy = 0, for y, starting from a guess
double solveY(double x, double y) {
  for (int i = 0; i < 50; i++) {
    double f = x * x * x + y * y * y - 9 * x * y;
    double d = 3 * y * y - 9 * x;                      // the derivative of F with respect to y
    y -= f / d;
  }
  return y;
}

// the implicit derivative: dy/dx = (3y - x^2) / (y^2 - 3x)
double slope(double x, double y) { return (3 * y - x * x) / (y * y - 3 * x); }

int main() {
  double h = 1e-6;
  printf("%.6f\n", (solveY(2 + h, 4) - solveY(2 - h, 4)) / (2 * h));   // a difference quotient of the solutions
  printf("%.6f\n", solveY(2, 4));                                       // the point (2, 4) is on the curve
  printf("%.6f\n", slope(2, 4));                                        // the formula of Example 4
  return 0;
}

/* output:
0.800000
4.000000
0.800000
*/

Who first differentiated equations without solving them?

Curves given by equations were the first problems of the calculus, and the folium of Descartes was one of its first tests.

  • Descartes and Fermat. In 1638 René Descartes proposed the curve x^3+y^3=3axy, today called the folium of Descartes, as a challenge to Pierre de Fermat: find its tangent line at any point. Fermat solved it easily, which Descartes had been unable to do, and the episode is remembered as a test of the new methods of tangents.
  • Newton. Isaac Newton's Method of Fluxions, written in 1671 and published in 1736, treats curves given by an equation between two flowing quantities x and y and finds the ratio of their rates of change directly from the equation, without solving it for y. That is implicit differentiation in the language of fluxions.
  • The theorem behind it. Why y exists as a differentiable function near a point where B\ne0 was settled much later. Augustin-Louis Cauchy is credited with the first rigorous implicit function theorem, and Ulisse Dini gave the general form for several variables in 1878.

What mistakes do people make with implicit differentiation?

The most common mistakes with implicit differentiation are the nine below, each with the correct statement.

MistakeCorrect
❌ (d)/(dx)y^2=2yy depends on x, so the chain rule adds a factor: 2y (dy)/(dx).
❌ (d)/(dx)(xy)=yIt is a product of two functions of x: y+x (dy)/(dx).
❌ (d)/(dx)\sin y=\cos yAgain a factor: \cos y·(dy)/(dx).
❌ (dy)/(dx) may contain only xIt usually contains both x and y, and is evaluated at a point with both coordinates.
❌ Put any point into the slope formulaThe point must satisfy the equation; otherwise the number is the slope of nothing.
❌ For y'=-x/y, y''=-\frac1yy is a function of x: y''=-(y-x y')/(y^2), which is -(25)/(y^3) on x^2+y^2=25.
❌ If the denominator of y' is 0, there is no tangent lineThe tangent line is vertical there, as at (5,0) on the circle x^2+y^2=25.
❌ At the origin of the folium, \frac00 means the slope is 0\frac00 is undetermined: two branches cross, with tangents y=0 and x=0.
❌ Implicit differentiation works only when y can be solved forIt is for exactly the opposite case, when y cannot be isolated, as in x^3+y^3=9xy.

Practice: test your understanding

These questions mix everything above. A wrong answer costs nothing here: read the hint and try again.

True or false?

Decide whether each statement is True or False.

  • (d)/(dx)y^2=2y (dy)/(dx).
  • (d)/(dx)(xy)=y+x (dy)/(dx).
  • (d)/(dx)\sin y=\cos y.
  • The formula for (dy)/(dx) can contain y as well as x.
  • If the denominator of (dy)/(dx) is 0 at a point of the curve, the curve has no tangent line there.
  • Implicit differentiation needs y to be solved for first.

Select all that apply

Choose all the correct derivatives with respect to x (y is a function of x).

  • (d)/(dx)\left(xy^2\right)=y^2+2xy y'
  • (d)/(dx)e^y=e^y y'
  • (d)/(dx)y^3=3y^2 y'
  • (d)/(dx)y/x=(x y'-y)/(x^2)
  • (d)/(dx)\left(x^2y\right)=2x y'

A parabola

Find the slope of y^2=4x at the point (1,2).

The circle

Find the slope of x^2+y^2=25 at (3,-4) (as a decimal).

A cubic curve

Find the slope of x^3+y^3=2xy at (1,1).

A sine in the equation

What is (dy)/(dx) for \sin(xy)=x+y?

  • (1-y\cos(xy))/(x\cos(xy)-1)
  • (1-\cos(xy))/(\cos(xy)-1)
  • 1-\cos(xy)
  • (y\cos(xy))/(x\cos(xy))

A second derivative

Find y'' on the circle x^2+y^2=25 at (0,5).

Where the tangent is vertical

The slope of a curve is (dy)/(dx)=A/B with A\ne0. Where is its tangent line vertical?

  • where B=0
  • where A=0
  • where A=B
  • nowhere

Parallel tangents

The curve x^2+xy+y^2=7 crosses the x-axis at two points. What is the common slope of its tangent lines there?

A fractional power

Using y^4=x^3, what is (d)/(dx)x^3/4?

  • \frac34x^-1/4
  • \frac43x^1/4
  • \frac34x^3/4
  • 3x^-1/4

A cusp

Find the slope of y^2=x^3 at (4,8).

The origin of the folium

At the origin of x^3+y^3=9xy the slope formula (3y-x^2)/(y^2-3x) gives \frac00. What does that mean?

  • two branches cross there, with tangent lines y=0 and x=0
  • the slope is 0
  • the slope is 1
  • the origin is not on the curve

Summary: implicit differentiation at a glance

  • Method: differentiate both sides with respect to x, treating y as a function of x ((d)/(dx)f(y)=f'(y) (dy)/(dx), (d)/(dx)(xy)=y+x(dy)/(dx)), collect the (dy)/(dx) terms, solve.
  • Circle: x^2+y^2=25 gives (dy)/(dx)=-\frac xy, slope \frac34 at (3,-4), and (d^2y)/(dx^2)=-(25)/(y^3).
  • Lines: tangent y-y_0=m(x-x_0), normal slope -\frac1m; horizontal tangent where the numerator is 0, vertical where the denominator is 0.
  • Folium: (dy)/(dx)=(3y-x^2)/(y^2-3x), slope \frac45 at (2,4), horizontal tangent at x=54^(1/3).
  • Second derivative: differentiate again and put y' back in; simplify with the original equation.
  • Rational powers: y^q=x^p gives (d)/(dx)x^p/q=\frac pq x^p/q-1.
  • Care: the point must be on the curve; \frac00 marks a crossing; a formula can exist where no curve does.
  • Code: sp.idiff(F, y, x); check with Newton's method and a difference quotient.

Glossary: key terms

Implicit function
A function defined by an equation in x and y that is not solved for y, so that y is whatever value makes the equation true.
Explicit function
A function written with y alone on one side, y equals f of x, which gives y directly from x.
Implicit differentiation
Finding dy over dx by differentiating both sides of an equation with respect to x, treating y as a function of x, and then solving for dy over dx.
Normal line
The line through a point of a curve that is perpendicular to the tangent line there; its slope is minus the reciprocal of the tangent slope.
Folium of Descartes
The curve x cubed plus y cubed equals 9xy, a loop with two branches that cross at the origin, first proposed by Descartes in 1638.
Vertical tangent
A tangent line parallel to the y-axis, at a point where dy over dx grows without bound because its denominator is zero.

Frequently asked questions

What is implicit differentiation?

Implicit differentiation is a way to find dy over dx from an equation in x and y without solving the equation for y. You differentiate both sides with respect to x, treating y as a function of x, then collect the terms with dy over dx and solve for it.

When do you use implicit differentiation?

Use it when an equation defines y in terms of x but y cannot be isolated, or when isolating it would give several branches and messy formulas, as for the folium of Descartes. It also gives a slope for the whole circle with one formula.

Why does y squared differentiate to 2y times dy over dx?

Because y depends on x, so y squared is a composite function: a square outside and y inside. The chain rule gives the derivative of the outside, two y, times the derivative of the inside, which is dy over dx. A function of x alone gets no extra factor.

What is the derivative of a circle?

For the circle x squared plus y squared equals r squared, implicit differentiation gives dy over dx equal to minus x over y, at every point where y is not zero. At the top and bottom points the slope is zero, and at the left and right points the tangent is vertical.

How do you find the tangent line to an implicit curve?

Check that the point is on the curve, find dy over dx by implicit differentiation, and put in both coordinates to get the slope m. The tangent line is y minus y0 equals m times x minus x0. The normal line uses the slope minus one over m.

How do you find the second derivative implicitly?

Differentiate the formula for dy over dx again, treating y as a function of x, then replace every dy over dx by its formula. The result has only x and y, and the original equation often shortens it, as with minus 25 over y cubed for the circle.

What does it mean when the denominator of dy over dx is zero?

Usually the tangent line is vertical there, since the slope grows without bound, as at the left and right points of a circle. If the numerator is zero too, you get zero over zero, which can mean that two branches of the curve cross at that point.

How does implicit differentiation prove the power rule for fractions?

Write y equals x to the p over q as y to the q equals x to the p, and differentiate both sides. That gives q times y to the q minus one times dy over dx equal to p times x to the p minus one, which solves to p over q times x to the p over q minus one.

Is implicit differentiation valid for any equation?

No. It assumes that y is a differentiable function of x near the point, which holds where the denominator of dy over dx is not zero and the equation is smooth. It gives formulas even for equations with no points, such as x squared plus y squared equals minus one.

References

  1. Joel Hass, Christopher Heil, Maurice D. Weir et al. (2023). Thomas' Calculus: Early Transcendentals in SI Units (15th ed.), Section 3.7: Implicit Differentiation. Pearson.
  2. James Stewart (2015). Calculus (8th ed.), section 3.5: Implicit Differentiation. Cengage Learning.
  3. Steven G. Krantz, Harold R. Parks (2002). The Implicit Function Theorem: History, Theory, and Applications. Birkhäuser.
  4. Isaac Newton (1736). The Method of Fluxions and Infinite Series (translated by John Colson). Henry Woodfall, London.
  • The Chain Rule: The chain rule explained: how to find the inside and outside of a composite function, the power chain rule, nested functions, second derivatives, and code.
  • Differentiation Rules: Differentiation rules with proofs and examples: constant, power, multiple, sum, product and quotient rules, the derivative of e^x, and higher-order derivatives.
  • Derivatives of Inverse Functions and Logarithms: Derivatives of inverse functions and logarithms: the rule for inverses, d/dx ln x = 1/x, a^x, log base a, logarithmic differentiation, and the number e.
  • Related Rates: Related rates: differentiate an equation in time to find an unknown rate, with the four-step strategy, six worked examples, a sliding ladder and common mistakes.