Ma · Mathematics

How Do You Find the Slope of a Function?

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose a point

    Identify the input value where you want the slope, or decide whether you need a formula for slopes at all inputs.

  2. 2. Find the derivative

    Differentiate the function, or use the difference quotient to find the derivative from its definition.

  3. 3. Evaluate the slope

    Substitute the chosen input into the derivative to get the tangent-line slope there.

  4. 4. Check existence

    Confirm the derivative exists at that input; corners, cusps, and discontinuities can prevent a single slope.

The slope of a function is usually not one fixed number: it can change as the input changes. To find the slope at a particular point, differentiate the function and evaluate its derivative at that point. The derivative function gives the slope of the graph at each input where it exists.

What “slope of a function” means

For a straight line, slope measures the change in output divided by the change in input. For a curved graph, that ratio between two distinct points is the slope of a secant line. The slope at a single point is the slope of the graph’s tangent line there.

If the function is y=f(x)y=f(x) and you want the slope at x=ax=a, the answer is f′(a)f'(a), provided the derivative exists. If you want a formula for the slopes across the graph, find f′(x)f'(x) instead. A positive derivative means the graph is rising locally; a negative derivative means it is falling; a zero derivative means the tangent is horizontal.

Find the derivative and evaluate it

For a differentiable function, use the usual differentiation rules to find f′(x)f'(x), then substitute the input value. For example, the power rule says that the derivative of xnx^n is nxn−1nx^{n-1}.

Consider

f(x)=x2−4x+1.f(x)=x^2-4x+1.

Differentiate each term:

f′(x)=2x−4.f'(x)=2x-4.

At x=3x=3, the slope is

f′(3)=2(3)−4=2.f'(3)=2(3)-4=2.

So the graph has slope 22 at the point whose input is 33. To check the point’s coordinates, calculate f(3)=9−12+1=−2f(3)=9-12+1=-2. The tangent line therefore passes through (3,−2)(3,-2) with slope 22:

y+2=2(x−3),y+2=2(x-3),

or y=2x−8y=2x-8.

Why the derivative gives the slope

The derivative is defined by the limit of secant-line slopes as the second point approaches the first. At x=ax=a, it is

f′(a)=lim⁡h→0f(a+h)−f(a)h,f'(a)=\lim_{h\to 0}\frac{f(a+h)-f(a)}{h},

if this limit exists. Here, hh is a small change in the input. The numerator is the corresponding change in the function’s output, so the fraction is an average rate of change. Taking the limit makes the two points approach one another and gives the instantaneous rate of change, or tangent slope.

For the example f(x)=x2−4x+1f(x)=x^2-4x+1, set a=3a=3. The difference quotient simplifies to

f(3+h)−f(3)h=(3+h)2−4(3+h)+1−(−2)h=2h+h2h=2+h.\begin{aligned} \frac{f(3+h)-f(3)}{h} &=\frac{(3+h)^2-4(3+h)+1-(-2)}{h}\\ &=\frac{2h+h^2}{h}\\ &=2+h. \end{aligned}

As hh approaches zero, 2+h2+h approaches 22. This agrees with the derivative calculation.

When a slope may not exist

A function can be defined at a point without having a derivative there. For example, f(x)=∣x∣f(x)=|x| has a sharp corner at x=0x=0. The slopes approaching from the left are −1-1, while the slopes approaching from the right are 11. Since they do not agree, there is no single tangent slope at zero, and f′(0)f'(0) does not exist.

A discontinuity can also prevent differentiability. At an endpoint of a function’s domain, you may be able to define a one-sided derivative, using inputs from within the domain, even though the usual two-sided derivative is unavailable. State that convention if the problem asks about an endpoint.

Common mistakes

  • Stopping at the derivative when a numerical slope is requested. If the question asks for the slope at x=ax=a, evaluate f′(a)f'(a); do not report only the formula f′(x)f'(x).
  • Confusing a secant slope with a tangent slope. The quotient [f(b)−f(a)]/(b−a)[f(b)-f(a)]/(b-a) uses two distinct inputs and gives an average slope. The derivative is a limit as those inputs approach each other.
  • Using the function’s output as its slope. The point on the graph is (a,f(a))(a,f(a)), but its slope is f′(a)f'(a). These are generally different values.
  • Assuming every point has a derivative. Check for corners, cusps, jumps, or other places where the defining limit fails to exist.

If a graph is provided rather than a formula, estimate the tangent’s slope by drawing a tangent at the requested point and calculating its rise divided by its run. With a formula, differentiation usually gives the more precise answer.

References

  1. OpenStax Calculus Volume 1

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.