Tangent Line Calculator

Tangent slope f′(a)—
f(a) — function value—
Tangent line—
Normal slope—

How Tangent Line Calculator is calculated: Tangent: y = f(a) + f′(a)(x − a); Normal: y = f(a) − (x − a) ÷ f′(a)

What is a Tangent Line Calculator?

The Tangent Line Calculator is a free online tool that finds the equation of the tangent line to a curve at a point — the straight line that just touches the curve there — and the normal line that crosses it at right angles. Calculus students working through tangents, normals and linear approximation use it when the line that best hugs a curve at one point, for sketching, for approximation, or for a physics problem about motion along a curve. Instead of finding the derivative, evaluating it at the point, and then rearranging into y = mx + c without dropping a sign, you type the function from the list and the point a to draw the tangent at and the calculator returns the tangent slope, the function value, the tangent line as an equation, and the normal slope straight away.

The working idea is simple. the calculator evaluates the function and its exact derivative at the point, then builds the tangent from the point-slope form The tangent is y = f(a) + f′(a)(x − a), which passes through (a, f(a)) with slope f′(a). The normal is perpendicular to it, so its slope is the negative reciprocal, −1 ÷ f′(a), and it passes through the same point. There is no sign-up and nothing to install: the page runs entirely in your browser, so your numbers never leave your device.

That matters because the tangent line is the best straight-line approximation to a curve at a point, and it is the geometric meaning of the derivative: the slope of the tangent is the derivative The derivative here is exact for the preset functions, because each one has a known analytic derivative — this is not a finite-difference approximation. The rest of this page walks through the formula, the input people get wrong most often, and a worked example with real numbers you can check by hand.

How a Tangent Line Calculator works

At its core, the calculator applies the tangent line is y = f(a) + f′(a)(x − a), and the normal line is y = f(a) − (x − a) ÷ f′(a). The point-slope form says the line through (a, f(a)) with slope m is y − f(a) = m(x − a). For the tangent, m is f′(a); for the normal, m is −1 ÷ f′(a), because perpendicular slopes multiply to −1. Expanding gives the familiar y = mx + c form shown on the page. The formula box at the top of this page shows the same rule in symbols: Tangent: y = f(a) + f′(a)(x − a); Normal: y = f(a) − (x − a) ÷ f′(a).

The calculator uses the exact derivative of the chosen preset function — 2x for x², 3x² for x³, cos x for sin x, eˣ for eˣ — so the slope is exact, not approximated. The intercept follows from c = f(a) − f′(a) × a. If the tangent is horizontal, f′(a) is 0 and the normal is vertical — a vertical line has no finite slope, so the calculator shows a dash for the normal slope. That is a real geometric fact, not a missing answer.

The slope and intercept are exact for the preset functions; only the two-decimal display rounds them A derivative calculator can help you check the numbers that feed into this step, and it is worth doing that check before you trust an answer that looks surprising.

The the point a explained

The point is the whole problem, and the mistake people make is evaluating the derivative at the wrong x. The derivative of x² is 2x, so at a = 2 the slope is 4, but at a = 3 it is 6 — and the tangent line changes completely: y = 4x − 4 at the first point, y = 6x − 9 at the second. The function alone does not determine the tangent; the point does.

Read the point from the question and enter it exactly, including its sign. A tangent at a = −2 is a different line from the tangent at a = 2, even though the function value is the same for x². Check the answer by substitution: the tangent line at x = a must give f(a). If it does not, the intercept is wrong.

For f(x) = x² at a = 2, the tangent is y = 4x − 4: at x = 2 it gives 4, which is f(2), and its slope 4 is f′(2). Both checks pass. A slope calculator is a good cross-check when the input comes from a measurement or a table rather than from a textbook problem.

A worked example

Take the default settings on this page: f(x) = x² at the point a = 2.

The function value is f(2) = 4, shown as 4, and the derivative is f′(x) = 2x, so f′(2) = 4. The tangent line is y = 4x - 4, and the normal slope is -0.25, since −1 ÷ 4 = −0.25.

The line y = 4x − 4 touches the parabola at (2, 4) and runs alongside it there, rising 4 units for each unit of x. The normal line through the same point has slope −0.25 and crosses the tangent at a right angle. Put x = 2 into the tangent: 4 × 2 − 4 = 4, which is f(2), so the line passes through the point of tangency exactly as it must.

Where the Tangent Line Calculator is used

In calculus, the tangent line is the first step in linear approximation: near the point, the curve and its tangent are almost the same, so the tangent gives quick estimates of the function nearby.

In physics, the tangent to a position-time graph at a point is the instantaneous velocity, and the tangent to a velocity-time graph is the instantaneous acceleration — the same construction, read as a rate. A linear equation calculator often sits next to it in the same workflow, because the two answers answer different halves of the same question.

In economics, the tangent to a cost curve at a production level is the marginal cost, the cost of one more unit, which is how firms decide how much to produce.

It also helps to keep the units consistent from the first number to the last. Mixing units — metres with centimetres, degrees with radians, seconds with minutes — is the quietest way to get an answer that looks plausible and is wrong by a large factor. Write the unit next to every number you enter, and check the result's unit against the unit you expect before you use the answer anywhere else.

Tangent Line Calculator vs Slope Calculator

A slope calculator finds the slope between two points on a line. This calculator finds the slope of a curve at one point — the slope of its tangent — which is the derivative. The slope between two points on a curve is a secant slope, an average; the tangent slope is the instantaneous rate.

Use the slope calculator for straight lines and for average rates between two points. Use this calculator when the question asks for the tangent, the instantaneous rate, or the line that touches the curve at a point. The trigonometry calculator covers the other side of the same problem, so the two tools complement each other rather than compete.

The two agree where they overlap: the slope of the tangent line itself, read off as the coefficient of x, is exactly what a slope calculator would give for that line.

Common mistakes with the Tangent Line Calculator

The first mistake is using the function value as the slope. f(a) is the height of the point, and f′(a) is the slope there — for x² at a = 2 both happen to be 4, which is a coincidence of this example, not a rule. At a = 3 the value is 9 and the slope is 6.

The second mistake is writing the tangent through the origin instead of through (a, f(a)). The line y = f′(a)x passes through the origin, which is wrong unless f(a) happens to equal f′(a) × a. Always use the point-slope form and check that x = a gives f(a).

The third mistake is getting the normal slope backwards: it is −1 ÷ f′(a), not 1 ÷ f′(a) and not −f′(a). The minus sign and the reciprocal both matter, and forgetting either one gives a line that is not perpendicular.

A last mistake is trusting the first answer without a rough check. Before you accept a result, estimate it by hand to one significant figure: if the calculator says 400 and your rough estimate says 40, something is off — usually a misplaced decimal point or a wrong unit. The calculator does the arithmetic; the judgement about whether the answer makes sense still belongs to you.

How to use this Tangent Line Calculator

Open the page and enter the function from the list and the point a to draw the tangent at. Pick the function, enter the point a, and read the tangent equation. The normal slope is shown beside it.

Read the tangent slope as the instantaneous rate of change of the function at a, and the tangent equation as the best straight-line approximation to the curve near a. Read the normal slope as the slope of the line perpendicular to the tangent at the same point — useful for reflection problems in optics and for distance-to-a-curve questions.

Everything runs in your browser. No account, no upload, no data sent anywhere — your numbers never leave your device. If a result looks wrong, re-check the inputs first: a single mistyped number is the usual cause, and a derivative calculator will confirm the arithmetic.

Frequently Asked Questions

The tangent line is y = 4x - 4. The slope is f′(2) = 4 and the function value is 4, so the line is y = 4 + 4(x − 2), which simplifies to y = 4x − 4.

the tangent line is y = f(a) + f′(a)(x − a), and the normal line is y = f(a) − (x − a) ÷ f′(a) The point-slope form says the line through (a, f(a)) with slope m is y − f(a) = m(x − a). For the tangent, m is f′(a); for the normal, m is −1 ÷ f′(a), because perpendicular slopes multiply to −1. Expanding gives the familiar y = mx + c form shown on the page.

The tangent touches the curve at the point and runs in the direction the curve is going; its slope is f′(a). The normal passes through the same point at a right angle to the tangent; its slope is −1 ÷ f′(a). The two lines are perpendicular, so their slopes multiply to −1.

Yes — that is linear approximation. Near a, f(x) is close to f(a) + f′(a)(x − a), and the error grows with the square of the distance from a and with how much the curve bends. For x² at a = 2, the tangent estimates f(2.1) as 4.4, while the true value is 4.41, an error of only 0.01.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.