CALCULUS WORKSPACE

Tangent Line Calculator

Find the tangent line to a curve at a chosen x-value, with the contact point, derivative, slope, and step-by-step equation.

CALCULUS

Enter a function and point

Try an example

Enter a supported function of x and a real input where the function is defined and differentiable.

TANGENT LINE

At x = 2

✓ Calculated
POINT-SLOPE FORM
y−11=7(x−2)y - 11 = 7\left(x - 2\right)
SLOPE-INTERCEPT FORM
y=7x−3y = 7x - 3
POINT ON CURVE(2, 11)LINE SLOPE7Y-INTERCEPT-3
STEP-BY-STEP

Build the tangent equation

y−f(a)=f′(a)(x−a)y-f(a)=f'(a)(x-a)
  1. 1
    Locate the point on the curve

    Evaluate the function at a = 2.

    f(2)=11⇒P=(2,11)f(2) = 11\quad\Rightarrow\quad P=(2,11)
  2. 2
    Differentiate the function
    f′(x)=2⋅x+3f'(x) = 2 \cdot x + 3
  3. 3
    Evaluate the derivative to get the slope

    The tangent slope is the derivative evaluated at the selected input.

    m=f′(2)=7m=f'(2)=7
  4. 4
    Substitute the point and slope
    y−11=7(x−2)y - 11 = 7\left(x - 2\right)
  5. ✓
    Write the tangent line
    y=7x−3y = 7x - 3
Quick checkAt x = 2, the line passes through (2, 11). The tangent slope matches the derivative.
TANGENT LINE BASICS

What does a tangent line calculator find?

A tangent line is the straight line that gives the local direction of a curve at a point. For a differentiable function y = f(x), its slope at x = a is f′(a), and it passes through the point (a, f(a)). The tangent line calculator first differentiates the entered function, evaluates the function and derivative at a, and then uses those two values to form the line.

y−f(a)=f′(a)(x−a)y-f(a)=f'(a)(x-a)

Differentiate f(x) to obtain f′(x). The tangent passes through (a, f(a)) with slope f′(a), so inserting that point and slope into the point-slope equation gives the tangent line. Rearranging produces slope-intercept form when useful.

The function must be defined at x = a, and its derivative must exist and be finite there. A corner, cusp, discontinuity, or vertical tangent does not have a finite tangent slope in the usual y = mx + b sense.

How to use the calculator

  1. Enter the function f(x) using the math field or type standard notation such as x^2 + 3x + 1.
  2. Enter the x-coordinate a where you want the tangent. The input can be an integer, negative number, or decimal.
  3. Choose Find tangent line. The calculator checks that both f(a) and f′(a) are finite.
  4. Read the contact point (a, f(a)) and the tangent slope f′(a).
  5. Use the displayed point-slope equation, its slope-intercept equivalent, and the worked substitution to follow the result.

Worked example

Problem: Find the tangent line to f(x) = x² + 3x + 1 at x = 2.

Method: f′(x) = 2x + 3, f(2) = 11, and f′(2) = 7. The line passes through (2, 11) with slope 7.

Result: y − 11 = 7(x − 2), which simplifies to y = 7x − 3.

At x = 2, the curve is at height 11 and is rising at 7 units vertically per one unit horizontally. The tangent line matches the curve’s value and slope at that point.

When is a tangent line undefined?

  • At a corner such as f(x) = |x| at x = 0, the left and right slopes disagree, so there is no single tangent line.
  • At a vertical tangent, the slope is unbounded; this calculator reports that a finite tangent equation is unavailable.
  • At a discontinuity or outside the real domain of the function, f(a) is not a valid finite contact point.
  • For a horizontal tangent, the line is simply y = f(a).
  • A simplified derivative may have a restricted domain inherited from the original function; a removable cancellation does not automatically restore excluded inputs.

Common mistakes

  • Using the function value f(a) as the slope; the slope is f′(a).
  • Using the derivative value as the tangent line’s y-coordinate; the point is (a, f(a)).
  • Writing x − a with the wrong sign in point-slope form.
  • Assuming the tangent line follows the curve over a large interval instead of approximating it locally.
  • Trying to assign one finite slope at a corner, cusp, discontinuity, or vertical tangent.

Frequently asked questions

How do I find a tangent line to a function?

Differentiate f(x), evaluate f(a) and f′(a), then use y − f(a) = f′(a)(x − a).

What does the x-value a represent?

It is the input where the tangent touches the curve. The corresponding point is (a, f(a)).

Why do I need both f(a) and f′(a)?

The function value locates the contact point; the derivative supplies the line’s slope. A line is determined by one point and one slope.

Can I get the answer in point-slope form?

Yes. The result displays point-slope form first, then slope-intercept form for readability.

What if the derivative is zero?

The tangent is horizontal. Its equation is y = f(a).

Can a function have no tangent at a point?

Yes. If it is discontinuous, has a corner or cusp, or has an unbounded slope at the point, a finite tangent line may not exist.

Does the tangent line equal the function?

Usually only at the contact point do their values and slopes match. The tangent is a local straight-line approximation, not generally the whole function.

References

Related calculus tools