Tangent and Normal Line Calculator

Enter f(x) and an x-coordinate to find the point on the curve, the exact first derivative, and the tangent and perpendicular normal line equations. Results and graphing stay in your browser.

Enter a function and point

Use ^ for powers. Supported functions include sin, cos, tan, exp, ln, log, sqrt, and abs. Trigonometric inputs use radians.

The calculator uses the point (a, f(a)). Enter a finite decimal number.

Try an example

Keyboard shortcut: Ctrl/ + Enter.

Advertisement

Tangent and normal lines

Point and derivative
Enter a function and x-coordinate to begin.
Tangent line
The tangent equation will appear here.
Normal line
The normal equation will appear here.

Calculation steps

Calculation steps will appear here.

Function, tangent, and normal graph

Calculate the lines to draw the curve and both lines near the selected point.

Calculator methodology and limits

Developed and reviewed by
Starlight Robotics calculator team
Last reviewed
Method
Parse f(x) → differentiate symbolically → evaluate f(a) and f′(a) → construct both lines through (a,f(a)).
Input limits
One real-valued function in x up to 300 characters and one finite numeric x-coordinate.
Privacy
The function, point, results, and graph remain in your browser; no solving API receives them.
Domain note
A line can be calculated only where f(a) is real and finite. Corners, cusps, endpoints, and discontinuities may require separate one-sided analysis.

How to use the tangent and normal line calculator

  1. Enter a function of x, such as x^2, sin(x), or ln(x).
  2. Enter the x-coordinate a. The calculator evaluates f(a) to locate the point on the curve.
  3. Select Calculate lines to see the derivative, slopes, equations, construction steps, and graph.

Tangent and normal line formulas

If f is differentiable at x = a, the tangent slope is mt = f′(a). The tangent line through (a, f(a)) is:

\[y-f(a)=f'(a)(x-a)\]

For a finite nonzero tangent slope, a perpendicular line has negative-reciprocal slope mn = −1/f′(a), so the normal line is:

\[y-f(a)=-\frac{1}{f'(a)}(x-a)\]

If f′(a) = 0, the tangent is horizontal and the normal is vertical. An infinite derivative value can indicate a vertical tangent, but endpoints and singular points should be checked with one-sided limits.

Worked examples

Parabola at x = 1

f(x)=x² and f′(x)=2x, so the point is (1,1) and the tangent slope is 2.

Tangent: y=2x−1. Normal: y=−0.5x+1.5.

Sine at x = 0

f(x)=sin(x) and f′(x)=cos(x). At (0,0), the tangent slope is 1.

Tangent: y=x. Normal: y=−x.

Horizontal tangent

For f(x)=x²+3 at x = 0, the derivative is zero and the point is (0,3).

Tangent: y=3. Normal: x=0.

Tangent and normal line calculator FAQs

What is a tangent line?

A tangent line is the local linear approximation to a differentiable curve at a point. Its slope equals the derivative f′(a).

What is a normal line?

The normal line passes through the same point and is perpendicular to the tangent. For tangent slope m ≠ 0, its slope is −1/m.

What happens when the derivative is zero?

The tangent is horizontal: y = f(a). The perpendicular normal cannot be written with a finite slope, so its equation is the vertical line x = a.

Can it calculate a vertical tangent?

If f(a) is finite and the evaluated derivative expression is positive or negative infinity, the calculator reports x = a as a vertical-tangent candidate and y = f(a) as the horizontal normal. A one-sided limit check may still be necessary.

Why might there be no unique line?

The function may be outside its real domain, discontinuous, or nondifferentiable at the point. For example, abs(x) has a corner at zero and therefore no unique tangent slope or normal line there.

Are trigonometric inputs in radians?

Yes. This matches standard calculus formulas such as d[sin(x)]/dx = cos(x).

Does my input leave the browser?

No. The symbolic differentiation, numerical evaluation, equation construction, and graphing all run on your device.

Explore more mathematical tools

Explore more tools