Tangent Line Calculator

  • Free
  • No sign-up
  • Works on phones
  • Shows the working
Differential#4

Tangent & Normal Line Generator

Slope \(m = f'(x_0)\) plus the equations of the tangent and normal lines.

This tangent line calculator gives you the equation of the line that touches \( y = f(x) \) at a chosen point, along with its slope and the equation of the normal line (the perpendicular line through the same point). Both lines come out in slope-intercept form, \( y = mx + b \), ready to copy into your answer.

It is useful for homework checks, graph sketching and linear approximation problems. It’s free and needs no sign-up.

Tangent Line Calculator: The tangent line to y = x² at (1, 1) has slope 2, the derivative there, so its equation is y = 2x…
The tangent line to y = x² at (1, 1) has slope 2, the derivative there, so its equation is y = 2x − 1.

How to use the tangent line calculator

  1. Type the function in the \( f(x) \) box. Use ^ for powers, sqrt(x), sin(x), cos(x), ln(x), e^(x) and pi. Implicit multiplication works: 2x^2 and x ln(x) are fine.
  2. Enter the x-coordinate of the point of tangency in \( x_0 \). Expressions such as pi/3 or e are accepted.
  3. Press Compute lines. The output lists the point \( (x_0, f(x_0)) \), the slope \( m \), the tangent line and the normal line.

Formula

The tangent line at \( x = a \) passes through \( (a, f(a)) \) with slope \( f'(a) \):

$$y = f(a) + f'(a)(x - a)$$

The normal line passes through the same point with the negative reciprocal slope:

$$y = f(a) - \frac{1}{f'(a)}(x - a)$$

The calculator differentiates \( f \) symbolically, evaluates \( f(a) \) and \( f'(a) \), then expands both lines into \( y = mx + b \) form. When a number has a recognizable exact form (a fraction, \( \sqrt3 \), a multiple of \( \pi \)), it is shown that way.

Worked example

Example 1. Find the tangent and normal lines to \( f(x) = x^3 - 2x^2 + 1 \) at \( x = 2 \).

  • Point: \( f(2) = 8 - 8 + 1 = 1 \), so the point is \( (2, 1) \).
  • Slope: \( f'(x) = 3x^2 - 4x \), so \( m = f'(2) = 12 - 8 = 4 \).
  • Tangent: \( y = 1 + 4(x - 2) \), which simplifies to \( y = 4x - 7 \).
  • Normal: slope \( -\frac14 \), so \( y = 1 - \frac14(x - 2) \), or \( y = -\frac14x + \frac32 \).

These are the lines the calculator above shows for its default input.

Example 2. Find the tangent to \( f(x) = \ln x \) at \( x = e \). The point is \( (e, 1) \) and the slope is \( \frac1e \), so

$$y = 1 + \frac1e(x - e) = \frac{x}{e}$$

The tangent passes through the origin. The normal has slope \( -e \):

$$y = -ex + e^2 + 1$$

Type ln(x) with \( x_0 \) = e to check both.

Reading the output: special cases

  • Horizontal tangent. When the slope is 0, the tangent is \( y = f(a) \) and the normal is vertical, so the calculator writes it as \( x = a \). Try cos(x) at 0: the tangent is \( y = 1 \) and the normal is \( x = 0 \).
  • No tangent line. If \( f \) or \( f' \) is undefined at your point, for example ln(x) at 0 or sqrt(x) at 0, the calculator reports that \( f \) is not differentiable there instead of giving a line.
  • Decimals. Irrational slopes that aren’t a recognizable closed form are shown as decimals rounded to about 8 significant figures.
  • Implicit curves. The calculator needs \( y \) as a function of \( x \). For a circle or other implicit curve, find the slope with implicit differentiation first, then use the point-slope form.

The tangent line is also the best linear estimate of the function near the point. The linear approximation guide shows how to use it for quick numerical estimates (the linear approximation calculator does the arithmetic). Also, the full hand method, with more examples, is in how to find the equation of a tangent line.

A calculator, pencil, and notebook on a desk.

The normal line

The normal line is perpendicular to the tangent at the same point, so its slope is \( -1/m \). For \( y = x^2 \) at \( (1, 1) \): the tangent has slope 2 and equation \( y = 2x - 1 \), and the normal has slope \( -\frac{1}{2} \) and equation \( y = -\frac{1}{2}x + \frac{3}{2} \).

Horizontal and vertical tangents

  • Horizontal tangents are where \( f'(x) = 0 \). For \( y = x^3 - 3x \), \( y' = 3x^2 - 3 = 0 \) at \( x = \pm 1 \).
  • Vertical tangents are where the slope becomes infinite. On the circle \( x^2 + y^2 = 25 \), they occur at \( (\pm 5, 0) \).

Tangent to a curve given implicitly

For the circle \( x^2 + y^2 = 25 \) at \( (3, 4) \), implicit differentiation gives \( y' = -\frac{x}{y} = -\frac{3}{4} \), so the tangent is

$$y - 4 = -\frac{3}{4}(x - 3) \quad\Rightarrow\quad y = -\frac{3}{4}x + \frac{25}{4}$$

See the implicit differentiation calculator.

Why tangent lines are useful

Near the point of contact, the tangent line is the best straight-line approximation to the curve. That idea powers linear approximation and Newton’s method, which follows tangent lines to find roots.

Step-by-step method

  1. Find \( f(a) \) to get the point.
  2. Differentiate and evaluate \( f'(a) \) for the slope.
  3. Write \( y - f(a) = f'(a)(x - a) \) and simplify.

Common mistakes

  • Using \( f'(x) \) instead of the number \( f'(a) \) as the slope.
  • Forgetting the point: the line must pass through \( (a, f(a)) \).

Practice problems

  1. Tangent to \( y = e^x \) at \( x = 0 \).
  2. Tangent to \( y = \ln x \) at \( x = 1 \).

Answers: 1. \( y = x + 1 \). 2. \( y = x - 1 \).

Using the Calculator for Verification

The tangent line calculator saves time. First, solve the problem by hand. Then, use the calculator to check your work. This helps catch arithmetic errors. Input your function and the x-coordinate. Compare the calculator's output to your manual solution. Both tangent and normal line equations should match.

Also, verify the point of tangency. The calculator shows (x0, f(x0)). Make sure this matches your calculated point. This confirms you used the correct function value. A quick visual check on a graphing tool can also be helpful.

When a Different Method is Better

This tangent line calculator works best for explicit functions y = f(x). However, some curves are defined implicitly. For these, like x^2 + y^2 = 25, implicit differentiation is necessary. You must first find dy/dx manually. Then, substitute the point's coordinates to get the slope. Finally, use the point-slope form to write the line equation.

Similarly, if a curve is given parametrically, you need a different approach. Calculate dy/dt and dx/dt. Then, find dy/dx = (dy/dt) / (dx/dt). Evaluate this at the given parameter value. This gives the slope. The calculator cannot directly handle these forms.

Related guides

Further reading

To build a line from two points instead of a derivative, use the slope calculator.

FAQ

How do you find the equation of a tangent line?

First, find the point \( (a, f(a)) \). Next, compute the slope \( f'(a) \). Then, substitute both into \( y - f(a) = f'(a)(x - a) \). The calculator does all three steps and simplifies the result.

What is the normal line?

The normal line is perpendicular to the tangent at the point of tangency. Its slope is \( -\frac{1}{f'(a)} \), and it is vertical when the tangent is horizontal.

Can the tangent line calculator find where the tangent is horizontal?

Not directly; it works at a point you choose. To find horizontal tangents, solve \( f'(x) = 0 \), which is what the critical points calculator does.

Is the tangent line calculator free?

Yes. It’s free to use as often as you like, with no account required.

Embed this calculator on your website

Teachers, tutors and bloggers are welcome to use this calculator for free. Copy the code below and paste it into any page (in WordPress, use a "Custom HTML" block). The small script makes the calculator grow to fit its answer; if your site removes scripts, it still works at a fixed height. Please keep the credit link.

More calculators

See all calculators