Tutorials › Real Analysis › Derivative of a Constant

Differentiation · Tutorial 395 of 1000

Derivative of a Constant

Use the difference quotient to find the derivative of a constant function and understand how vertical shifts affect differentiability.

Advanced 9 min read

What You'll Learn

  • Define a constant function on an interval and identify the points where its derivative is considered
  • Prove directly from the difference quotient that a constant function has derivative zero
  • Explain why a function’s value at one point does not make it constant nearby
  • Verify that adding a constant preserves differentiability and leaves the derivative unchanged
  • Relate a zero derivative at a point to the local linear approximation

Why a Constant Function Has No First-Order Change

In “Derivative as Local Linear Approximation,” differentiability at a point was described by comparing the change in a function with a linear term. A constant function provides the simplest case: no matter how the input changes, the output does not change. Its difference quotient is therefore zero, and there is no nonzero linear change to approximate.

Here, “constant function” means that the function takes the same value at every point of its domain. This is stronger than saying that the function has a particular value at one point. The distinction matters: a function can equal \(C\) at \(a\), vary at nearby points, and still have derivative zero at \(a\). We will use the definition of the derivative to establish the constant-function result and then examine how adding a constant affects a derivative.

Definition: Let \(I\) be an interval and let \(C\in\mathbb{R}\). The function \(f:I\to\mathbb{R}\) defined by \(f(x)=C\) for every \(x\in I\) is called a constant function with value \(C\). Its derivative is considered at interior points \(a\) of \(I\), where nearby inputs on both sides of \(a\) belong to the domain.

At such an interior point, the derivative is the limit of the difference quotient as \(h\to0\) with \(h\ne0\) and \(a+h\in I\). Since both function values in that quotient equal \(C\), their difference is exactly zero for every allowed nonzero \(h\). This is an exact identity, not merely an estimate that becomes accurate near \(a\).

Theorem (Derivative of a Constant Function): Let \(I\) be an interval, let \(C\in\mathbb{R}\), and define \(f:I\to\mathbb{R}\) by \(f(x)=C\) for every \(x\in I\). At every interior point \(a\in I\), \(f\) is differentiable and \(f'(a)=0\).

Proof. Fix an interior point \(a\in I\). For every nonzero \(h\) sufficiently close to zero with \(a+h\in I\), the definition of \(f\) gives \(f(a+h)=C\) and \(f(a)=C\). Therefore

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

The difference quotient is identically zero for all such \(h\), so its limit as \(h\to0\) exists and equals zero. Hence \(f'(a)=0\). Since \(a\) was any interior point of \(I\), the conclusion holds at every interior point. \(\square\)

The qualification “interior point” is part of the usual two-sided derivative definition used here. At an endpoint, inputs on one side may lie outside the domain, so the two-sided difference quotient may not be defined there. A one-sided derivative can be considered under a separate definition, but it is not needed for the theorem above.

Worked Examples from the Difference Quotient

Worked Example: A Constant Function with a Negative Value

Let \(f:\mathbb{R}\to\mathbb{R}\) be given by \(f(x)=-6\), and fix any \(a\in\mathbb{R}\). For every \(h\ne0\),

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

Thus the difference quotient has limit zero as \(h\to0\), and \(f'(a)=0\). The value \(-6\) does not affect the calculation: the key fact is that the two function values being subtracted are equal.

Worked Example: The Same Constant on a Bounded Interval

Let \(f:(1,5)\to\mathbb{R}\) be defined by \(f(x)=12\). Choose \(a=3\), which is an interior point. If \(0<|h|<1\), then \(3+h\in(1,5)\), so the difference quotient is permitted and satisfies

$$ \frac{f(3+h)-f(3)}{h} = \frac{12-12}{h} =0. $$

It follows that \(f'(3)=0\). The same calculation works at every \(a\in(1,5)\): for each such \(a\), sufficiently small changes \(h\) keep \(a+h\) in the interval, and the output remains 12. The boundedness of the domain does not alter the derivative calculation at an interior point.

Worked Example: Having Value \(C\) at a Point Is Not Being Constant

Define \(g:\mathbb{R}\to\mathbb{R}\) by \(g(x)=5+(x-2)^2\). At \(a=2\), the function has value \(g(2)=5\), but it is not constant: for example, \(g(3)=6\). For \(h\ne0\),

$$ \frac{g(2+h)-g(2)}{h} = \frac{\bigl(5+((2+h)-2)^2\bigr)-5}{h} = \frac{h^2}{h} =h. $$

As \(h\to0\), this quotient tends to zero, so \(g'(2)=0\). The function is not constant on any neighborhood of 2: if \(h\ne0\), then \(g(2+h)=5+h^2>5=g(2)\). This example shows both that a function can vary while having derivative zero at a point and that the hypothesis of the Derivative of a Constant Function Theorem concerns the function’s values throughout its domain, not just its value at \(a\).

Adding a Constant Does Not Change a Derivative

The difference quotient also explains what happens when the entire graph of a function is shifted vertically. Adding a fixed number \(C\) raises or lowers every output by the same amount. In a difference of two output values, that common amount cancels. This observation applies to any function differentiable at the point, not only to constant functions.

Theorem (Invariance Under Addition of a Constant): Let \(I\) be an interval, let \(a\) be an interior point of \(I\), and let \(f:I\to\mathbb{R}\). For a fixed \(C\in\mathbb{R}\), define \(g(x)=f(x)+C\). Then \(g\) is differentiable at \(a\) if and only if \(f\) is differentiable at \(a\). Whenever they are differentiable, \(g'(a)=f'(a)\).

Proof. For every nonzero \(h\) sufficiently close to zero with \(a+h\in I\),

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

The two difference quotients are equal for every such \(h\). If \(f\) is differentiable at \(a\), the right-hand quotient has a finite limit, so the equal left-hand quotient has the same limit; consequently, \(g\) is differentiable at \(a\) and \(g'(a)=f'(a)\). Conversely, if \(g\) is differentiable at \(a\), equality of the quotients shows that the quotient for \(f\) has the same finite limit. Thus \(f\) is differentiable at \(a\), with \(f'(a)=g'(a)\). \(\square\)

The theorem is an equivalence. It does not depend on the direction of the shift: adding a constant preserves differentiability, and subtracting that same constant reverses the shift. The derivative measures change in output relative to change in input, so a fixed amount added to every output has no effect on that measurement.

Worked Example: Comparing a Function with Its Vertical Shift

Let \(f(x)=x^2\), let \(g(x)=x^2+7\), and examine both functions at \(a=3\). Direct calculation gives

$$ \frac{f(3+h)-f(3)}{h} = \frac{(3+h)^2-9}{h} = \frac{6h+h^2}{h} =6+h $$

for \(h\ne0\). For the shifted function, the quotient is

$$ \frac{g(3+h)-g(3)}{h} = \frac{\bigl((3+h)^2+7\bigr)-(9+7)}{h} = \frac{6h+h^2}{h} =6+h. $$

Both quotients tend to 6, so both derivatives at 3 equal 6. The cancellation can also be seen directly: the added 7 appears once in the numerator’s first function value and once in the value being subtracted, and so contributes \(7-7=0\).

Worked Example: Shifting a Function with Zero Derivative at One Point

Return to \(g(x)=5+(x-2)^2\) at \(a=2\), and define \(q(x)=g(x)-11=-6+(x-2)^2\). The difference quotient for \(q\) is

$$ \frac{q(2+h)-q(2)}{h} = \frac{\bigl(-6+h^2\bigr)-(-6)}{h} = \frac{h^2}{h} =h. $$

Thus \(q'(2)=0\), just as \(g'(2)=0\). In this calculation, the two constant terms are both \(-6\) and cancel; the remaining quotient is determined by the change \(h^2\). The example illustrates that the invariance result works whether the derivative at the point is zero or nonzero.

Reading Zero Derivative Correctly

For a constant function, the local linear approximation at any interior point \(a\) is simply \(C+0h=C\), and in this case it agrees exactly with the function at every nearby input. In general, however, \(f'(a)=0\) says only that the first-order linear term vanishes at \(a\). The First-Order Approximation Characterization from “Definition of the Derivative” then says that the remainder is small relative to \(|h|\); it does not say that the remainder is identically zero.

The function \(g(x)=5+(x-2)^2\) makes this distinction explicit. It has derivative zero at 2, but for every nonzero \(h\), its change is \(g(2+h)-g(2)=h^2\), which is positive. Dividing by \(h\) gives \(h\), which tends to zero, even though the function does change. A zero derivative at a single point therefore does not establish that the function is constant, either on the whole domain or in a neighborhood of that point.

Conversely, when the function really is constant throughout its domain, its change is zero for every allowed input change, so the derivative is zero at every interior point. These statements have different hypotheses: one concerns a global description of the function and yields a conclusion at each interior point; the other concerns one derivative at one point and does not imply global constancy.

A useful practical check is to write the difference quotient before making a geometric claim. If the function is constant, both function values in the numerator are the same. If a fixed constant has been added to another function, it appears in both values and cancels. If the function merely takes a specified value at \(a\), no such cancellation is guaranteed for nearby inputs; the difference quotient must still be calculated.

Check Your Understanding

Use the difference quotient and the results above to answer these questions.

  1. Why must the point \(a\) be an interior point in the stated derivative theorem?
  2. For a constant function with value \(C\), what is the difference quotient at an interior point, and why does its limit exist?
  3. Can a function have derivative zero at \(a\) without being constant near \(a\)? Give the example from this tutorial and compute its difference quotient.
  4. Why does adding a fixed number \(C\) to a differentiable function leave its derivative unchanged?
  5. Does knowing that \(f'(a)=0\) prove that \(f\) is constant on its domain? Explain the difference between this claim and the theorem about a constant function.