Solved.tools: Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

Slope of Tangent Line Calculator

Last updated: 7 August 2026

Reviewed by Gavin Meiring, Lead research and primary author ยท Doctoral Candidate (Corporate Governance) ยท Research and drafting assisted by AI

Was this helpful?


Slope of Tangent Line Calculator

The slope of tangent line calculator finds the exact slope of the line touching a curve at a single point, using differentiation. It is designed for calculus students and anyone needing to analyse how steeply a function rises or falls at a specific location. Enter your function and x value to compute the tangent slope instantly.

How to Use the Slope of Tangent Line Calculator

  1. Type your function f(x) into the function input field.
  2. Enter the x value at the point of tangency.
  3. Click Calculate to find the derivative and evaluate it at that point.
  4. Read the slope value returned, which is f'(x) at your chosen point.
  5. Optionally use the result to write the full equation of the tangent line.

The Formula

The slope of the tangent line to f(x) at x = a is:

m = f'(a)

where f'(a) is the derivative of f(x) evaluated at x = a. To find the full equation of the tangent line, use the point-slope form:

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

Here, m is the slope, (a, f(a)) is the point of tangency, and the formula gives the straight line that just touches the curve at that point without crossing it.

Real-World Example

Find the slope of the tangent line to f(x) = x^3 - 2x at x = 1.

  1. Differentiate: f'(x) = 3x^2 - 2
  2. Substitute x = 1: f'(1) = 3(1) - 2 = 1
  3. Find the y-coordinate: f(1) = 1 - 2 = -1
  4. Write the tangent line equation: y - (-1) = 1(x - 1), which simplifies to y = x - 2

The slope of the tangent line is 1, and the full equation is y = x - 2. At this point, the curve rises at exactly the same rate as a 45-degree line.

Using Tangent Lines in Approximation

The tangent line is more than just a geometric curiosity. It forms the basis of linear approximation, where you use the tangent line as a stand-in for the curve near the point of tangency. This is why engineers and scientists use tangent lines to estimate function values without needing complex calculations. In physics, the slope of the position-time curve at a point gives instantaneous velocity. In economics, the slope of a cost curve gives marginal cost. Knowing how to find and interpret tangent slopes opens up a wide range of practical applications.

Worked examples across four functions

Every tangent slope question follows the same three steps: differentiate, substitute the x value into the derivative, then read the number. The table below runs the whole procedure over five functions, and the notes underneath show the substitute step for each one.

FunctionPoint af(a)Derivative f'(x)Slope f'(a)
f(x) = x^2392x6
f(x) = x^3 - 2x1-13x^2 - 21
f(x) = 3x^2 + 4x - 12196x + 416
f(x) = 1/x20.5-1/x^2-0.25
f(x) = sin x00cos x1

Row 4 is worth reading closely, because the negative sign is easy to doubt. The derivative of 1/x is -1/x^2, so the slope at x = 2 is -0.25, and the curve does fall as x rises through the positive values. Row 5 is the one people remember: the derivative of sin x is cos x, cos 0 equals 1, and a slope of 1 at the origin means the sine curve leaves the origin at exactly 45 degrees.

The f(a) column is a separate calculation from the slope column. Substituting a into the function and substituting a into the derivative are two different jobs, and the numbers they return are different in every row of the table.

From the slope to the equation of the tangent

The derivative gives the slope, and the point-slope form turns that slope plus a point into a line. The table below completes the five examples from the section above.

FunctionaPoint (a, f(a))Slope f'(a)Tangent lineCheck
f(x) = x^23(3, 9)6y = 6x - 9At x = 3, y = 9
f(x) = x^3 - 2x1(1, -1)1y = x - 2At x = 1, y = -1
f(x) = 3x^2 + 4x - 12(2, 19)16y = 16x - 13At x = 2, y = 19
f(x) = 1/x2(2, 0.5)-0.25y = 1 - 0.25xAt x = 2, y = 0.5
f(x) = sin x0(0, 0)1y = xAt x = 0, y = 0

Work one of them by hand to confirm the method. Take f(x) = 1/x at a = 2. The slope is -0.25 and the point is (2, 0.5). Substitute into y - f(a) = f'(a)(x - a):

y - 0.5 = -0.25(x - 2) y - 0.5 = -0.25x + 0.5 y = 1 - 0.25x

Substituting x = 2 back into that equation gives y = 0.5, which is the y-coordinate you started from. That check catches the most common error in the whole procedure, which is writing the line through the correct point but with the wrong sign on the slope.

Estimating a value with a tangent line

The tangent line is the best straight-line stand-in for a curve near the point of tangency, which makes it a tool for estimating values you cannot compute directly. The method is linear approximation: take the tangent line at a convenient point and evaluate it at the awkward one.

Take the square root of 4.1. No one knows that value by hand, but the square root of 4 is exactly 2, so a = 4 is the convenient point.

The function is f(x) = sqrt(x), which is x^(1/2). Its derivative is f'(x) = 1 / (2 sqrt(x)), so at a = 4 the slope is 1 / (2 x 2) = 0.25.

The tangent line is L(x) = f(4) + f'(4)(x - 4) = 2 + 0.25(x - 4).

Evaluate it at x = 4.1: L(4.1) = 2 + 0.25(0.1) = 2 + 0.025 = 2.025.

The exact value of the square root of 4.1 is 2.0248457, so the estimate is out by 0.0001543, an error of about 0.008%. The table below shows how the error grows as you move away from the point of tangency.

xTangent line L(x)True sqrt(x)ErrorError as a share
4.012.00250002.00249840.00000160.0001%
4.12.02500002.02484570.00015430.0076%
4.52.12500002.12132030.00367970.1735%

The pattern is worth remembering because it applies to every linear approximation. Close to the point of tangency the estimate is almost exact, and the error grows as you move away from it. At 0.01 away from 4 the estimate is right to six decimal places. At 0.5 away the error is more than 20 times larger.

A tangent line therefore answers a question about the neighbourhood of a point, not about the curve as a whole. Use it to estimate a small change, and use the function itself when the change is large.

The derivative as a limit

The derivative has a definition as well as a set of rules, and the definition explains what the tangent slope actually is. It is the limit of the slope of a secant line as the two points on the curve slide together:

f'(a) = limit as h goes to 0 of [f(a + h) - f(a)] / h

The expression inside the limit is the slope of the line through the points (a, f(a)) and (a + h, f(a + h)). At h = 0 the two points coincide and the expression becomes 0 divided by 0, which is why the limit is needed rather than a direct substitution.

You can watch the limit converge. Take f(x) = x^2 at a = 3, where the exact answer is 6.

hSecant slope [f(3 + h) - f(3)] / h
0.16.1000000
0.016.0100000
0.0016.0010000
0.00016.0001000

Each tenfold reduction in h cuts the gap to 6 by a factor of ten. That is the limit in arithmetic form, and it is also the reason a numerical derivative is an approximation: a tool cannot set h to zero, so it picks a small h and accepts a small error.

Method and assumptions

The derivative must exist at the point you enter. Where it does not, there is no tangent line to find. The three cases that come up most are a corner, such as |x| at x = 0, where the slope from the left and the slope from the right disagree; a cusp, where the slope becomes infinite in opposite directions; and a vertical tangent, such as the cube root function at x = 0, where the tangent line is vertical and has no finite slope.

The tool differentiates symbolically for the functions it recognises, which gives an exact answer. Where it cannot apply a rule, it falls back on a numerical difference of the kind shown in the table above, and a numerical answer carries a small approximation error rather than being exact. The distinction matters if you are checking the tool by hand.

The point-slope form assumes the tangent is not vertical, because a vertical line cannot be written as y = mx + c with a finite m. For a vertical tangent, write the line as x = a.

The result is a local quantity. It describes the curve at the single point a and says nothing about the curve anywhere else. Two functions can share a point and a tangent slope there and diverge immediately afterwards, which is exactly why a tangent line is a good estimate near a and a poor one far from it.

The slope carries units, and the units are the units of y divided by the units of x. For a position-time curve the derivative is a velocity. For a cost-quantity curve it is a marginal cost. For a concentration-time curve it is a rate of reaction.

Common Mistakes to Avoid

  • Confusing the function value with the slope. For f(x) = x^3 - 2x at x = 1, the function value is -1 and the slope is 1. Reporting the function value as the slope is the most frequent error on this topic.
  • Stopping at the derivative formula instead of evaluating it. Writing f'(x) = 6x + 4 answers a different question from f'(2) = 16. Substitute the x value before you report.
  • Using a secant slope when a tangent slope is wanted. A slope between two points is an average rate of change, and it equals the tangent slope only when the function is a straight line.
  • Assuming every point has a tangent. A corner has no single tangent slope, because the limit from the left and the limit from the right disagree.
  • Writing the tangent line through the wrong point. The point is (a, f(a)), not (a, 0) and not the origin. Compute f(a) separately.
  • Losing a negative sign. The derivative of 1/x is -1/x^2 for a reason, and a descending curve has a negative tangent slope.
  • Applying a linear approximation far from the point of tangency. The estimate is excellent next to a and degrades quickly as the distance grows, as the square root table above shows.

Frequently Asked Questions

What is the difference between a secant line and a tangent line? A secant line passes through two distinct points on a curve and gives the average rate of change. A tangent line touches the curve at exactly one point and gives the instantaneous rate of change at that location.

Can the slope of a tangent line be undefined? Yes. If the derivative does not exist at a point, the tangent line is undefined there. This happens at corners, cusps, or vertical tangents where the slope would be infinite.

How do I find the tangent line equation once I have the slope? Use the point-slope form: y - y1 = m(x - x1), where m is the slope from the derivative and (x1, y1) is the point on the curve. Rearrange to get slope-intercept form if needed.

Why is the tangent slope important in optimisation? Where the tangent slope equals zero, the function has a stationary point. These points are candidates for local maxima and minima, making zero-slope tangents central to finding optimal values in real-world problems.

Is the derivative the same thing as the tangent slope? They are the same quantity described at different levels. The derivative f'(x) is the function that returns the slope of the tangent at any x, and the tangent slope is that derivative evaluated at one particular value of x.

Can the calculator give a tangent slope for any function I type in? It handles the functions it can differentiate symbolically, and those answers are exact. For a function it cannot differentiate directly it uses a numerical difference, which gives a close approximation rather than an exact value. Check the result against the exact derivative when the stakes are high.


Also try these free tools:

Reference

The limit definition of the derivative used above, and the standard derivatives for the power, reciprocal and trigonometric functions, follow the conventional presentation of single-variable calculus. Wolfram MathWorld maintains a reference entry for the derivative at https://mathworld.wolfram.com/Derivative.html. The tangent line construction and the linear approximation method appear in the first chapters of any standard calculus text.