Tutorials › Calculus I › Derivatives of Linear Functions from the Definition

The Derivative from First Principles · Tutorial 342 of 1495

Derivatives of Linear Functions from the Definition

Derive the derivative of \(f(x)=mx+b\) directly from the definition and show that it equals the slope \(m\) at every point.

Intermediate 8 min read

What You'll Learn

  • Write the derivative at a point as a limit of difference quotients
  • Simplify the quotient for a linear function before taking the limit
  • Derive the derivative of \(f(x)=mx+b\) for arbitrary \(m\), \(b\), and point \(a\)
  • Explain why the intercept has no effect on the derivative
  • Identify common errors involving the increment and the limit

Why Start with a Linear Function?

A linear function has a constant slope: equal changes in the input produce equal changes in the output. The derivative is defined through a limit of nearby secant slopes, so a line provides a direct setting in which to see how that definition works. In particular, the calculation shows that the derivative at a point is the line’s slope and does not depend on which point is chosen.

We will derive this result from the difference quotient, rather than assume a differentiation rule. The only function considered here is \(f(x)=mx+b\), where \(m\) and \(b\) are real constants.

The Derivative at a Point

For a function \(f\), the derivative at \(x=a\), when it exists, is the limit of the difference quotient as a nonzero increment \(h\) approaches zero:

$$ f'(a)=\lim_{h\to 0}\frac{f(a+h)-f(a)}{h}. $$

The quotient compares the change in function value, \(f(a+h)-f(a)\), with the change in input, \(h\). It is the slope of the secant line through the points on the graph with inputs \(a\) and \(a+h\). The derivative is the limit of those slopes as the second input approaches \(a\).

The condition \(h\ne 0\) matters: before taking the limit, the quotient is defined only for nonzero increments. We simplify it for such \(h\), then determine its limit as \(h\to 0\).

Definition: The derivative of \(f\) at \(a\) is \(f'(a)=\lim_{h\to 0}\frac{f(a+h)-f(a)}{h}\), provided this limit exists. The increment \(h\) is nonzero in the quotient and approaches zero in the limit.

Deriving the Derivative of a Linear Function

Let \(f(x)=mx+b\), with \(m,b\in\mathbb R\), and choose any point \(a\in\mathbb R\). Since this function is defined for every real input, both \(a\) and \(a+h\) are in its domain for every real \(h\). For \(h\ne 0\), substitute the function into the difference quotient:

$$ \begin{aligned} \frac{f(a+h)-f(a)}{h} &=\frac{\bigl(m(a+h)+b\bigr)-(ma+b)}{h}\\ &=\frac{ma+mh+b-ma-b}{h}\\ &=\frac{mh}{h}\\ &=m. \end{aligned} $$

The cancellation of \(h\) in the last step is valid because the difference quotient is being evaluated for \(h\ne 0\). The quotient is therefore exactly \(m\) for every nonzero \(h\). Its limit as \(h\) approaches zero is also \(m\).

$$ f'(a)=\lim_{h\to 0}\frac{f(a+h)-f(a)}{h} =\lim_{h\to 0}m =m. $$
Theorem: If \(f(x)=mx+b\) for real constants \(m,b\), then \(f'(a)=m\) for every \(a\in\mathbb R\). The derivative is independent of the point \(a\) and of the intercept \(b\).

This conclusion comes from the calculation itself. The terms \(ma\) cancel because both function values use the same base input \(a\), and the terms \(b\) cancel because the same constant is added to both values. The remaining change in output is \(mh\). Dividing by the input change \(h\) leaves \(m\).

Worked Examples

Worked Example: A Line with Positive Slope

Find the derivative of \(f(x)=4x-7\) at \(a=3\) from the definition. Here \(m=4\), \(b=-7\), and \(a=3\).

First evaluate the function at the two inputs in the quotient:

$$ f(3+h)=4(3+h)-7=12+4h-7=5+4h $$
$$ f(3)=4(3)-7=12-7=5. $$

For \(h\ne 0\), form and simplify the difference quotient:

$$ \begin{aligned} \frac{f(3+h)-f(3)}{h} &=\frac{(5+4h)-5}{h}\\ &=\frac{4h}{h}\\ &=4. \end{aligned} $$

Because the quotient equals \(4\) for every nonzero \(h\), its limit as \(h\to 0\) is \(4\). Thus \(f'(3)=4\). Checking against the quotient, the proposed derivative is precisely its constant value, so taking the limit gives the same answer.

Worked Example: A Line with Negative Slope

Find the derivative of \(g(x)=-2x+5\) at \(a=-1\) from the definition. Here \(m=-2\), \(b=5\), and \(a=-1\).

Compute each function value, keeping the parentheses around the negative input:

$$ g(-1+h)=-2(-1+h)+5=2-2h+5=7-2h $$
$$ g(-1)=-2(-1)+5=2+5=7. $$

For \(h\ne 0\), the quotient becomes

$$ \begin{aligned} \frac{g(-1+h)-g(-1)}{h} &=\frac{(7-2h)-7}{h}\\ &=\frac{-2h}{h}\\ &=-2. \end{aligned} $$

The quotient is \(-2\) for every nonzero \(h\), so \(\lim_{h\to 0}\frac{g(-1+h)-g(-1)}{h}=-2\). Therefore \(g'(-1)=-2\). As a check, the computed quotient itself is constant at \(-2\), confirming that its limit has that value.

Worked Example: A Constant Function

A constant function is included in the form \(f(x)=mx+b\) by taking \(m=0\). Find the derivative of \(q(x)=6\) at an arbitrary point \(a\in\mathbb R\). For this function, \(q(a+h)=6\) and \(q(a)=6\).

For \(h\ne 0\), the difference quotient is

$$ \begin{aligned} \frac{q(a+h)-q(a)}{h} &=\frac{6-6}{h}\\ &=\frac{0}{h}\\ &=0. \end{aligned} $$

The quotient is zero for every nonzero \(h\), and therefore its limit as \(h\to 0\) is zero. Thus \(q'(a)=0\) for every real \(a\). Checking the result directly, the function has no change in output between \(a\) and \(a+h\), so its difference quotient is indeed zero.

Why the Derivative Does Not Depend on the Point

In the general derivation, \(a\) was not assigned a particular value. It represented any real point. After substitution, the base-point terms \(ma\) and \(-ma\) cancel, leaving a quotient that contains neither \(a\) nor \(b\). Since the resulting quotient is \(m\) for every allowed increment, its limit is \(m\) at every point.

There is also a direct interpretation in terms of changes. Starting at any input \(a\), moving to \(a+h\) changes the function value by

$$ f(a+h)-f(a)=m(a+h)+b-(ma+b)=mh. $$

The output change is \(m\) times the input change. Thus the ratio of output change to input change is \(m\), regardless of the starting point. The intercept \(b\) shifts every function value by the same amount and so contributes nothing to a difference of function values.

For the graph of a linear function, this agrees with its geometric meaning: the slope of every secant through two distinct points on the line is \(m\). As the second point approaches the first, the secant slope stays \(m\), so the limiting tangent slope is \(m\) as well. The difference-quotient calculation establishes this without needing to infer it from a drawing.

Key takeaway: For \(f(x)=mx+b\), changing \(a\) changes the location where the derivative is evaluated but not the value of the derivative. The difference quotient simplifies to \(m\) before the limit is taken.

A Common Mistake: Substituting Zero Too Soon

A tempting but incorrect approach is to set \(h=0\) immediately in the difference quotient. For example, at a point \(a\) for \(f(x)=3x+2\), this gives

$$ \frac{f(a+0)-f(a)}{0} =\frac{f(a)-f(a)}{0} =\frac{0}{0}. $$

It is incorrect to conclude from this calculation that the derivative does not exist. The difference quotient is defined for \(h\ne 0\), and the derivative asks for the limit of those quotient values as \(h\) approaches zero. The value \(h=0\) is not substituted into the quotient.

Instead, simplify while \(h\ne 0\):

$$ \begin{aligned} \frac{f(a+h)-f(a)}{h} &=\frac{(3a+3h+2)-(3a+2)}{h}\\ &=\frac{3h}{h}\\ &=3. \end{aligned} $$

Now the limit is immediate: the quotient equals \(3\) for every nonzero \(h\), so its limit as \(h\to 0\) is \(3\). The correction is to simplify the quotient on its domain before taking the limit, not to evaluate the original quotient at the excluded value.

When This Result Applies

The conclusion depends on the function having the form \(f(x)=mx+b\), with fixed real constants \(m\) and \(b\), and on evaluating at a real point in its domain. Here the domain is all of \(\mathbb R\), so the difference quotient is available for every nonzero real \(h\). The proof does not establish a formula for other kinds of functions; their difference quotients may require different simplifications and separate limit arguments.

For a line, the derivative at every point is its slope. This gives a basic reference case for interpreting the derivative as a local rate of change: a constant rate produces a constant derivative. The role of the definition remains essential, because it shows exactly why the rate is constant and why neither the chosen point nor a vertical shift changes it.

Check Your Understanding

Use the definition of the derivative to reason through these questions.

  1. For \(f(x)=7x-4\), write the difference quotient at \(x=a\) and simplify it for \(h\ne 0\).
  2. For \(g(x)=-5x+1\), what is the derivative at \(a=2\)? Show which terms cancel in the quotient.
  3. Why is it valid to cancel \(h\) in the difference quotient, and why is it not valid to set \(h=0\) first?
  4. In the derivation for \(f(x)=mx+b\), identify separately why the terms involving \(a\) and the terms involving \(b\) disappear.
  5. What does the calculation imply about the derivative of a constant function, viewed as a linear function with \(m=0\)?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon