Tangent Line Calculator

Find the equation of the tangent line to any function at a point, with the derivative, slope and point shown step by step, the normal line and a graph.

Tangent Line Calculator

Calculate the equation of a tangent line to a function at a specific point. This calculator finds the derivative, evaluates it at the given point, and provides the tangent line equation in various forms. Includes visualization and step-by-step explanations.

Function Input

Enter a polynomial function up to x³. Example: f(x) = 2x³ - 3x² + 5x - 1. For higher degrees use Custom Function (e.g. x^5 - 2x^4 + 1).

Point of Tangency

Display Options

Tangent Line Calculator: Equation of a Tangent Line

A tangent line touches a curve at a point and can cross it there. It can also intersect the curve elsewhere. What makes a line tangent is the slope: the unique straight line that has the same instantaneous rate of change as the function at that exact x-value. A tangent line calculator automates the mechanics, but the concept is what matters. You give it a function like f(x) = x² and a point like x = 1, and it returns the equation of the line that grazes the curve there. The calculator handles the derivative, evaluates it at your chosen point, and writes the result in a form you can use immediately, whether you need point-slope, slope-intercept, or standard form.

How to Enter the Function and the Point

Before you press calculate, tell the tangent line calculator what curve you are working with and where to look. Start with the function type. The calculator accepts polynomials up to x³, rational functions, radical expressions, exponentials, logarithms, trigonometric functions, or a custom function you type yourself. For a polynomial like f(x) = 3x² - 2x + 1, select the polynomial option and enter the coefficients. For a custom function, write it in standard mathematical notation, using * for multiplication, / for division, and ^ for powers. The point of tangency is the x-value where you want the tangent line. Enter it as a number, and the calculator will plug it into the original function to find the y-coordinate. If you enter x = 2, it computes f(2) to get the point (2, f(2)).

Point of Tangency Is a Coordinate Pair

Do not confuse the x-value with the function value. The point of tangency is a coordinate pair, not just a number. If you only have the y-value, solve for x first or pick an x that lies on the curve. The calculator does not guess; it needs the x-coordinate to evaluate both the function and its derivative. If you enter a point where the function is undefined, like x = 0 for f(x) = 1/x, the calculator will return an error. Check the domain of your function before you enter the point. For logarithms, the argument must be positive; for square roots, non-negative. The calculator will not correct your input, so verify the point lies in the function's domain.

One Point per Run

One more thing: the calculator evaluates the derivative at the x-value you provide. That means the slope you get is f'(a), the instantaneous rate of change at that exact point. If you want the tangent line at a different location, change the x-value and recalculate. The calculator does not find all tangent lines at once; it handles one point per run. For a function with multiple interesting points, run it multiple times with different x-values. The reset button clears the previous results and lets you start fresh, which is useful when you are comparing slopes at different locations on the same curve.

The Three Steps the Calculator Runs

Every tangent line problem reduces to three steps, and the tangent line calculator performs all of them in the background. First, it evaluates the original function at the given x-value to find the point of tangency. This is the coordinate (a, f(a)) where the line touches the curve. Second, it computes the derivative of the function, f'(x), and then evaluates that derivative at x = a. The result is the slope m = f'(a), which measures how steep the curve is at that exact point. Third, it plugs the point and the slope into the point-slope form of a line: y - y₁ = m(x - x₁). That gives you the equation of the tangent line in a form you can graph or manipulate.

Worked Example: f(x) = x² at x = 1

Consider the function f(x) = x² at the point x = 1. The calculator finds f(1) = 1, so the point is (1, 1). The derivative f'(x) = 2x, evaluated at x = 1, gives m = 2. The point-slope equation becomes y - 1 = 2(x - 1), which simplifies to y = 2x - 1. That is the tangent line. The slope of 2 tells you the curve is rising twice as fast as it is running horizontally at that point. The y-intercept of -1 is where the line crosses the y-axis, which is not where it touches the curve. The point of tangency is the only place the line and the curve share both a location and a direction.

The Derivative Is the Heart

The derivative is the heart of the process. Without it, you cannot find the slope of the tangent line. The calculator uses the limit definition of the derivative, which measures the slope of the secant line as the two points get arbitrarily close together. That is why the tangent line is sometimes called the limiting position of the secant line. If the function has a sharp corner, like f(x) = |x| at x = 0, the derivative does not exist there, and the calculator will return an error. The slope is different from the left and the right, so there is no single tangent line. The calculator cannot invent one, and neither should you.

Reading the Output: Point-Slope, Slope-Intercept, Standard Form, Normal Line

Once the tangent line calculator finishes, you get a results panel with several pieces of information. The original function is displayed as you entered it, so you can verify the input is correct. The point of tangency is shown as coordinates (a, f(a)), confirming which point the line touches. The slope m = f'(a) appears as a number, which is the instantaneous rate of change at that point. The tangent line equation is presented in multiple forms. The point-slope form y - y₁ = m(x - x₁) is the most direct, since it comes straight from the calculation. The slope-intercept form y = mx + b simplifies it, giving you the y-intercept. The standard form Ax + By = C rearranges the same line into a different convention. All three describe the same line, so pick the one your assignment requires.

The Normal Line

The normal line is also part of the output. The normal line is perpendicular to the tangent line at the point of tangency. Its slope is the negative reciprocal of the tangent slope: if the tangent has slope m, the normal has slope -1/m, assuming m is not zero. The calculator shows the normal line equation in point-slope form as well. For example, with f(x) = x² at x = 1, the tangent slope is 2, so the normal slope is -1/2. The normal line equation becomes y - 1 = -0.5(x - 1), which simplifies to y = -0.5x + 1.5. The normal line is useful in physics for understanding forces perpendicular to a surface, and in optimization problems where you need the direction of steepest ascent or descent.

Edge Cases

If the tangent line is horizontal, the slope is zero, and the normal line is vertical with an undefined slope. The calculator will report the normal line as x = a in that case. If the tangent line is vertical, the slope is undefined, and the normal line is horizontal with slope zero. The calculator handles these edge cases by checking the derivative first. When m = 0, the normal line equation is x = a. When the derivative is infinite, the tangent line is x = a, and the normal line is y = f(a). These cases are rare but important, especially for functions with vertical asymptotes or cusps.

How to Calculate Tangent Line: Step-by-Step with the Calculator

If you are working without a calculator, the process is the same but manual. Start with the function f(x) and the point x = a. Compute f(a) to get the y-coordinate. Then find the derivative f'(x) using the rules of differentiation: power rule, product rule, chain rule, or whatever applies. Evaluate f'(a) to get the slope m. Write the equation using point-slope form: y - f(a) = f'(a)(x - a). That is the tangent line equation. Simplify to slope-intercept form if you need it. The tangent line calculator does all of this automatically, but understanding the steps helps you verify the output and catch errors.

Polynomial Example

For a polynomial like f(x) = 3x² - 4x + 2, the derivative is f'(x) = 6x - 4. At x = 1, f(1) = 3 - 4 + 2 = 1, so the point is (1, 1). The slope is f'(1) = 6 - 4 = 2. The tangent line equation is y - 1 = 2(x - 1), which simplifies to y = 2x - 1. For a trigonometric function like f(x) = sin(x), the derivative is f'(x) = cos(x). At x = π/2, f(π/2) = 1 and f'(π/2) = 0, so the tangent line is horizontal: y = 1. For an exponential function f(x) = eˣ, the derivative is the same as the function, f'(x) = eˣ. At x = 0, both f(0) and f'(0) equal 1, so the tangent line is y = x + 1.

Implicit Functions

When the function is not given explicitly, like an implicit equation x² + y² = 25, you need implicit differentiation to find dy/dx. Differentiate both sides with respect to x: 2x + 2y(dy/dx) = 0, so dy/dx = -x/y. At a point like (3, 4), the slope is -3/4. The tangent line equation is y - 4 = (-3/4)(x - 3). The calculator handles explicit functions, not implicit ones, so you would need to solve for y first or use a different tool. But the concept is the same: the derivative gives the slope, and the point gives the location.

What is Tangent Line: the Geometric Meaning

A tangent line is the straight line that best approximates a curve near a given point. It shares the same slope as the curve at that point, which means it has the same instantaneous rate of change. Unlike a secant line, which passes through two distinct points on the curve, a tangent line touches at a single point in the immediate neighborhood. But that "single point" idea breaks down for many functions. A tangent line can cross the curve at an inflection point, where the concavity changes. It can also intersect the curve again elsewhere, as with f(x) = x³ - 3x at x = 1, where the tangent line crosses the curve at another point.

The derivative at a point f'(a) is the slope of the tangent line at x = a. This is the fundamental link between differential calculus and geometry. If you know the slope and the point, you can write the equation of the line. If you do not know the slope, you cannot. The tangent line is not the curve itself; it is a linear approximation that is accurate only very close to the point of tangency. Farther away, the curve may diverge significantly from the line. This is why linearization uses the tangent line to estimate function values near x = a, but the error grows as you move away.

A common misconception is that the tangent line must touch the curve at exactly one point. This is false for curves with inflection points, where the line crosses the curve, and for functions that recross the line elsewhere. The real definition is based on the limit of secant lines: as the second point approaches the first, the secant line approaches the tangent line. If that limit does not exist, there is no tangent line. Corners, cusps, and vertical tangents (where the derivative is infinite) all fail the differentiability test. The calculator will not draw a tangent line for these cases because none exists in the usual sense.

Comparison of Tangent Line Forms

Slope of Tangent Line Calculator: Getting the Number Right

The slope of the tangent line calculator is the most important output you get. It tells you how steep the curve is at the point of tangency. A positive slope means the function is increasing; a negative slope means it is decreasing. A zero slope means the tangent line is horizontal, which often indicates a local maximum or minimum. An undefined slope means the tangent line is vertical, which happens when the derivative approaches infinity. The calculator computes this value by evaluating the derivative at the given x-coordinate, so the accuracy depends on the function and the point you choose.

Verifying the Slope

For a polynomial like f(x) = x², the slope at any point x is 2x. At x = 3, the slope is 6. The slope of tangent line calculator gives you 6 as the number m in the equation. You can verify this by taking two points very close to x = 3 on the curve, like (3, 9) and (3.001, 9.006001), and computing the secant slope: (9.006001 - 9) / (3.001 - 3) = 0.006001 / 0.001 = 6.001. As the second point approaches 3, the secant slope approaches 6. That is the limit definition of the derivative, and it is exactly what the calculator computes internally.

TI-84 Differences

If you are using a graphing calculator like the TI-84, the DRAW Tangent( feature works differently. It takes a function and an x-value, then draws the tangent line on the graph. It does not show you the equation unless you also compute the derivative numerically. The TI-84's nDeriv( function gives you the slope, but it does not check for differentiability. At a corner like f(x) = |x| at x = 0, nDeriv( may return a false slope because it uses a symmetric difference quotient. The tangent line calculator checks the left and right derivatives separately and reports an error if they differ. That is a critical difference you should know about.

Equation of Tangent Line Calculator: Handling Special Cases

The equation of tangent line calculator handles most cases without issue, but you should know its limits. For a vertical tangent, the slope is undefined, and the line has the form x = a. The calculator will report this as a special case, but you cannot write it in slope-intercept form. For a horizontal tangent, the slope is zero, and the line is y = f(a). The calculator handles this normally, giving you y = constant. For a function with a removable discontinuity, the tangent line does not exist at the gap because the function is not continuous there. The calculator will return an error.

Implicit Functions

Implicit functions are a different story. If you have an equation like x² + y² = 25, you cannot always solve for y as a function of x. The tangent line calculator requires an explicit function, so you would need to use implicit differentiation manually. Differentiate both sides with respect to x: 2x + 2y(dy/dx) = 0, so dy/dx = -x/y. At the point (3, 4), the slope is -3/4. The tangent line is y - 4 = (-3/4)(x - 3). The point must satisfy the original equation, which (3, 4) does. If the point does not lie on the curve, there is no tangent line there.

Parametric Equations

Parametric equations require a conversion. If you have x(t) and y(t), the slope of the tangent line is dy/dx = (dy/dt) / (dx/dt), provided dx/dt is not zero. The calculator does not accept parametric input, so you would need to eliminate the parameter first or use a different tool. The tangent line exists only where dx/dt ≠ 0 and both derivatives are defined. At a cusp, where dx/dt = 0 and dy/dt = 0, the slope is indeterminate, and there may be no tangent line. These are advanced cases, but they come up in physics and engineering problems.

Common Mistakes and How to Avoid Them

The most common error when using a tangent line calculator is plugging the x-value into the derivative instead of the original function to find the y-coordinate. The point of tangency is (a, f(a)), not (a, f'(a)). Always evaluate the original function at the given x-value to get the y-coordinate. The derivative gives you the slope, not the point. Another mistake is assuming the tangent line touches the curve at exactly one point. This is false for inflection points and for curves that recross the line. The tangent line may intersect the curve multiple times; what matters is the shared slope at the point of tangency.

Forgetting to check differentiability is another pitfall. If the function has a corner, cusp, or vertical tangent at the point, the derivative does not exist, and no tangent line exists. The calculator will return an error, but you should understand why. The left-hand and right-hand slopes differ, so there is no single limit. This is different from a vertical tangent, where the slope is infinite but the line x = a exists. The calculator treats these cases separately. If you see an error about a corner or cusp, the function is not differentiable there.

Misapplying the limit definition is a common manual error. Using h→0 from one side only when the function is not continuous gives a false slope. The derivative must be the same from both sides. If you are using a graphing calculator's nDeriv( function, it uses a symmetric difference quotient, which can give a false slope at a corner. The tangent line calculator checks both sides and reports an error if they differ. Do not trust a numerical derivative without checking the function's behavior around the point.

Tangent Line Equation: Linearization and Approximation

The tangent line equation is not just a geometric curiosity; it is the basis of linearization. The linear approximation L(x) = f(a) + f'(a)(x - a) uses the tangent line to estimate function values near x = a. For example, to approximate √4.01, use f(x) = √x at a = 4. The tangent line is y = 0.25x + 1, so L(4.01) = 0.25(4.01) + 1 = 2.0025. The actual value is √4.01 ≈ 2.0025, so the approximation is exact to four decimal places. The error grows as you move away from a, so linearization is only useful for small intervals.

The difference between the linearization and the tangent line equation is one of emphasis. Linearization is always written as L(x) = f(a) + f'(a)(x - a), highlighting its role as an approximation. The tangent line equation can be written in any form, but the point-slope version y - f(a) = f'(a)(x - a) is the most direct. Both describe the same line. The error in linearization is bounded by a term involving the second derivative, but most textbooks give the bound without showing how to compute it for a specific function. You can estimate the error by taking the second derivative and evaluating its maximum on the interval.

For a function that is not differentiable at the point, linearization fails. If f'(a) does not exist, there is no tangent line and no linear approximation. This is why differentiability is a prerequisite for most of calculus. The tangent line calculator will not give you a slope for such points, and neither should you expect one. The best you can do is a one-sided approximation, which is not the same as a tangent line. Always check differentiability before you rely on the tangent line for anything important.

The Honest Caveat About Tangent Lines

Here is the truth you will not hear from most sources: a tangent line is not always the best approximation, and the calculator can only do so much. If the function has a sharp corner, a cusp, or a vertical tangent, the derivative does not exist, and no tangent line exists in the usual sense. The calculator will refuse to draw one, but a graphing calculator's DRAW Tangent( feature might draw a misleading line because it uses a numerical approximation that does not check differentiability. Do not trust the graph blindly; trust the math.

Another honest caveat: the tangent line can cross the curve at the point of tangency. Most textbooks say it "touches without crossing," but that is false for inflection points. At x = 0 on the curve y = x³, the tangent line y = 0 crosses the curve. The line and the curve share the same slope, but the line goes through the curve from one side to the other. This is not a failure of the definition; it is what the definition means. The tangent line is the limiting position of secant lines, not a line that avoids the curve.

Finally, do not assume the tangent line is accurate far from the point. The tangent line is a local approximation. At x = a + h, the error is roughly (1/2)f''(c)h² for some c between a and a+h. The error grows quadratically with h, so moving twice as far from the point quadruples the error. If you need a good approximation, use the tangent line only within a small neighborhood of the point. For anything else, you need a higher-order approximation or the actual function. The tangent line calculator gives you the exact line for the point you choose, but it cannot make the line accurate everywhere.

Frequently Asked Questions

What exactly does the calculator need from me to start?

The calculator needs a function and an x-value. For a polynomial like f(x) = 3x² - 2x + 1, select the polynomial option and enter the coefficients. The point of tangency is the x-value where you want the tangent line, entered as a number.

What happens if I enter a point where the function is undefined?

If you enter a point where the function is undefined, like x = 0 for f(x) = 1/x, the calculator will return an error. You must check the domain of your function before entering the point, as the calculator will not correct your input.

Can the calculator find tangent lines at multiple points at once?

No, the calculator handles one point per run. If you want the tangent line at a different location, change the x-value and recalculate. The reset button clears previous results and lets you start fresh.

What forms of the tangent line equation does the output show?

The output shows the point-slope form y - y₁ = m(x - x₁), the slope-intercept form y = mx + b, and the standard form Ax + By = C. All three describe the same line, so you can pick the one your assignment requires.

How does the calculator handle the normal line?

The normal line is perpendicular to the tangent line at the point of tangency. Its slope is the negative reciprocal of the tangent slope: if the tangent has slope m, the normal has slope -1/m, assuming m is not zero. The calculator shows the normal line equation in point-slope form.

What happens if the derivative does not exist at the given point?

If the function has a sharp corner, like f(x) = |x| at x = 0, the derivative does not exist there, and the calculator will return an error. The slope is different from the left and the right, so there is no single tangent line.

Guides on this site