Tangent Line Calculator: Equation of the Tangent and Normal Line at x = a
Type a function f(x) and a point x = a to get the tangent line equation, the derivative and slope, the normal line, point-slope form and a graph, with steps.
How it works
Tangent line at x = a: y = f(a) + f′(a)(x − a) · slope m = f′(a) · y-intercept b = f(a) − m·a · Normal line: y = f(a) − (x − a) ÷ f′(a) · angle with the x-axis = arctan(m)
The tangent line touches the curve y = f(x) at the point (a, f(a)) and has the same slope as the curve there. That slope is the derivative f′(a), so the line is y − f(a) = f′(a)(x − a) in point-slope form, which rearranges to y = mx + b with b = f(a) − m·a. The normal line passes through the same point at a right angle to the tangent, so its slope is −1 ÷ f′(a). Type the function the way you would write it: 3x^2 − 5x + 2, sin(x)^2, x·e^x, ln(x)/x or sqrt(x + 1). The calculator differentiates it symbolically with the power, product, quotient and chain rules, shows f′(x), evaluates it at your point and writes both lines, the angle the tangent makes with the x-axis and where it crosses the axes. It also gives f″(a): when it is positive the curve lies above the tangent near a (the tangent-line approximation underestimates), and when it is negative the curve lies below it. The graph under the results plots f(x) and the tangent together. If the derivative is infinite at a (for example the cube root at 0) the tangent is the vertical line x = a. If the left and right slopes differ, as for |x| at 0, there is no tangent line and the calculator says so. Trigonometric functions use radians. The derivative-at-a-point calculator only estimates the slope of a cubic; this page takes any function and returns the full tangent and normal line equations.
Worked example
For f(x) = x³ − 2x + 1 at x = 2: f(2) = 8 − 4 + 1 = 5, so the point is (2, 5). The derivative is f′(x) = 3x² − 2, so the slope is f′(2) = 12 − 2 = 10. Point-slope form: y − 5 = 10(x − 2), which simplifies to y = 10x − 15. The normal line has slope −1 ÷ 10 = −0.1: y = −0.1x + 5.2. The tangent makes an angle of arctan(10) = 84.2894° with the x-axis, crosses the x-axis at x = 1.5, and since f″(2) = 12 > 0 the curve lies above it near the point.
Sources: Paul’s Online Math Notes (Lamar University): Tangent lines and rates of change · eMathHelp: Tangent line calculator (y = x² at x = 1 example)
Frequently asked questions
How do you find the equation of a tangent line?
Find the point (a, f(a)), find the slope m = f′(a) from the derivative, then write y − f(a) = m(x − a) and simplify. For f(x) = x² at x = 1: the point is (1, 1), f′(x) = 2x so m = 2, and the tangent is y − 1 = 2(x − 1), or y = 2x − 1.
What is the difference between the tangent line and the normal line?
Both pass through the same point on the curve. The tangent has the curve’s slope m; the normal is perpendicular to it, with slope −1/m. If the tangent is horizontal, the normal is vertical (x = a).
Can a tangent line be vertical?
Yes, when the derivative grows without bound at the point, as for the cube root ∛x at x = 0. The tangent is then the vertical line x = a, which has no slope-intercept form.
When does a function have no tangent line?
When it is not differentiable there: at a corner like |x| at 0, a cusp, a jump or a point where f is undefined. The slopes from the left and the right do not agree, so no single line fits.
What is the tangent line used for?
It is the best straight-line approximation of the curve near the point, called the linearization L(x) = f(a) + f′(a)(x − a). For example, the tangent to 15 − 2x² at x = 1 is y = −4x + 17, which is very close to the curve for x near 1.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.