acalculator

Find dy/dx by implicit differentiation

Type an equation in x and y. The page differentiates both sides with respect to x, treating y as a function of x, and solves for dy/dx; add a point on the curve to get the slope there.

Your numbers

Use x, y, = , + - * / ^, brackets, pi, e, sqrt, ln, sin, cos, tan.
dy/dx =
-x/y

For x^2 + y^2 = 25, dy/dx = -x/y.

dy/dx =: -x/y. For x^2 + y^2 = 25, dy/dx = -x/y.

How to calculate

Finds dy/dx for an equation in x and y, such as x^2 + y^2 = 25, and the slope at a point on the curve, checked numerically.

Example with the default inputs (Equation in x and y x^2 + y^2 = 25): For x^2 + y^2 = 25, dy/dx = -x/y.

Method: Write the equation as H(x, y) = 0 (left side minus right side). Then dy/dx = −(∂H/∂x)/(∂H/∂y), checked against difference quotients of H.

  • y is a differentiable function of x near each point; angles are in radians; ln is the natural logarithm.
  • An answer that fails its check is not shown.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Equation in x and y x^2 + y^2 = 25, Slope at (x, y) (optional) 3, -4 gives dy/dx = -x/y, Slope at the point 0.75.Source: OpenStax, Calculus Volume 1, section 3.8 Implicit Differentiation, Example 3.68 and 3.71. https://openstax.org/books/calculus-volume-1/pages/3-8-implicit-differentiation
  2. Equation in x and y x^3 sin(y) + y = 4x + 3 gives dy/dx = (4 - 3x^2 sin(y))/(x^3 cos(y) + 1).
  3. Equation in x and y y^3 + x^3 - 3x y = 0, Slope at (x, y) (optional) 3/2, 3/2 gives dy/dx = (y - x^2)/(y^2 - x), Slope at the point -1.

How it works

Write the equation as H(x, y) = 0, where H is the left side minus the right side (with no = sign, the page reads the typed expression as H = 0). Then

dy/dx = −H_x / H_y

where H_x = ∂H/∂x (y held fixed) and H_y = ∂H/∂y (x held fixed).

The page differentiates H itself, with the sum, product, quotient, power and chain rules (for u^c with a constant c, c u^(c−1) u′; for u^v otherwise, u^v (v′ ln u + v u′/u)) and the derivatives of sin, cos, tan, exp, ln, sqrt, asin, acos, atan, sinh, cosh and abs. Zeros and ones are dropped as it goes, and numbers in a product are multiplied together. Any other function gives no answer.

Writing the answer. Let g be the largest whole number that divides the number in front of every term of H_x and of H_y (a term with no number in front, or with a number that is not whole, counts as 1; g is 1 when there is no larger one). Both are divided by g. The minus sign goes into the top: each term of H_x changes sign. dy/dx is the top over H_y (or the top alone when H_y is 1), written by the page: for x³ + y³ = 6xy, H_x = 3x² − 6y and H_y = 3y² − 6x, g = 3, and dy/dx = (2y − x^2)/(y^2 − 2x). The answer is not simplified further (−y 2^(x y) ln(2)/(x 2^(x y) ln(2)) keeps its common factors).

The answer is checked. At the test points (x, y) = (0.37, 1.21), (1.73, −0.61), (−2.17, 0.83), (2.9, 3.3), (−0.53, −1.9) and (0.81, 2.47), the formula must agree with −(H(x + h, y) − H(x − h, y))/(H(x, y + h) − H(x, y − h)), h = 10⁻⁵, to 1 part in 10⁵ of max(1, |formula|), at every point where both are real numbers, and there must be at least 3 such points. Otherwise the page says "No verified answer".

The slope at a point. If you give a point "x, y", it must be on the curve: |H(x, y)| at most 10⁻⁹ × max(1, |left side at the point|). The slope is dy/dx there, to 10 significant figures (rounded half up); it is left out when dy/dx is not a real number there (a vertical tangent).

What you can type

  • A number has at most 15 digits in a row. A computer number keeps only about 16 digits, so a longer one (9007199254740993) would stand for a nearby number (9007199254740992), and the page asks for fewer digits instead. Write very large or very small numbers with a power of ten (1e-20).
  • The equation uses x and y, with one = (or none). Numbers can have decimals; + − * / and ^; brackets; a number or bracket next to a letter multiplies, and a space between letters multiplies (x y, 6x y).
  • Constants pi and e; functions sin, cos, tan, exp, ln (log), sqrt, asin, acos, atan (arcsin, arccos, arctan), sinh, cosh, abs (|x|). Angles are in radians.
  • The point is two numbers or constant expressions separated by a comma: 3, -4 or 3/2, 3/2.

What gets no answer

  • An equation without y (dy/dx has no meaning), with more than one =, or with a function this page does not differentiate.
  • A formula that fails its check or can be checked at fewer than 3 test points.
  • A point that is not on the curve (a message next to the point).

Worked examples by hand

x² + y² = 25, and the slope at (3, −4) (OpenStax Calculus Volume 1, section 3.8, Examples 3.68 and 3.71). H = x² + y² − 25, H_x = 2x, H_y = 2y, g = 2: dy/dx = −x/y. At (3, −4): −3/(−4) = 0.75.

x³ sin(y) + y = 4x + 3 (OpenStax Calculus Volume 1, section 3.8, Example 3.69). H = x³ sin(y) + y − 4x − 3, H_x = 3x² sin(y) − 4, H_y = x³ cos(y) + 1. dy/dx = (4 − 3x^2 sin(y))/(x^3 cos(y) + 1).

y³ + x³ − 3xy = 0, and the slope at (3/2, 3/2) (OpenStax Calculus Volume 1, section 3.8, Example 3.72). H_x = 3x² − 3y, H_y = 3y² − 3x, g = 3: dy/dx = (y − x^2)/(y^2 − x), the book's (3y − 3x²)/(3y² − 3x). At (3/2, 3/2): (3/2 − 9/4)/(9/4 − 3/2) = −1.

Other questions people ask

What is implicit differentiation?

A way to find dy/dx when y is not written as a function of x, as in x² + y² = 25. Differentiate both sides with respect to x, using the chain rule on every term with y (the derivative of y² is 2y · dy/dx), then solve for dy/dx.

How do I differentiate x² + y² = 25?

2x + 2y · dy/dx = 0, so dy/dx = −x/y. At the point (3, −4) on the circle, the slope is −3/(−4) = 3/4.

Is there a formula?

Yes. Move everything to one side, H(x, y) = 0. Then dy/dx = −H_x/H_y, where H_x is the derivative of H in x with y held fixed and H_y the derivative in y with x held fixed. It gives the same answer as differentiating term by term.

Why is the answer in terms of both x and y?

Because y is only defined implicitly: at a given x there may be several points on the curve (the circle has two at x = 3), each with its own slope. Give a point (x, y) to get one number.

Why does the page say the point is not on the curve?

The slope formula only makes sense at points that satisfy the equation. The page checks that the two sides agree at your point to 1 part in 10⁹. For x² + y² = 25, (3, 4) and (3, −4) are on the curve, but (1, 1) is not.

How is the answer checked?

At test points the formula for dy/dx is compared with −(difference quotient of H in x)/(difference quotient of H in y). They must agree at every test point where both are real numbers, and at least 3 such points.