Tangent Line Calculator
- Free
- No sign-up
- Works on phones
- Shows the working
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.

How to use the tangent line calculator
- Type the function in the \( f(x) \) box. Use
^for powers,sqrt(x),sin(x),cos(x),ln(x),e^(x)andpi. Implicit multiplication works:2x^2andx ln(x)are fine. - Enter the x-coordinate of the point of tangency in \( x_0 \). Expressions such as
pi/3oreare accepted. - 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 orsqrt(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.

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
- Find \( f(a) \) to get the point.
- Differentiate and evaluate \( f'(a) \) for the slope.
- 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
- Tangent to \( y = e^x \) at \( x = 0 \).
- 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
- How to Find the Equation of a Tangent Line
- Linear Approximation
- Derivative of ln(x)
- Implicit Differentiation
Further reading
- Tangent Lines and Rates of Change (Paul’s Online Math Notes) — how secant slopes lead to the slope of the tangent line.
- The Definition of the Derivative (Paul’s Online Math Notes) — the limit that turns the tangent slope into \( f'(a) \).
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.
