Skip to content
Glacius
CalculusConcept reference

Constant rule

The derivative of a constant scalar function is zero.

On this page 7 sections
  1. Overview
  2. A constant function has the same output for every input
  3. The letter used for the fixed output does not matter
  4. Check your understanding
  5. Key takeaway
  6. Sources & further reading
  7. Concept connections

01A constant function has the same output for every input#

A constant function has the same output for every input. The graph of f(x)=7f(x)=7 is horizontal: its height is 77, but its slope is 00.

A horizontal graph labeled f(x)=7. The two marked inputs x=1 and x=3 have equal output 7, so their output change is 0 and every nonzero-increment quotient is 0. The horizontal separation represents a change of input, not output.A horizontal graph labeled f(x)=7. The two marked inputs x=1 and x=3 have equal output 7, so their output change is 0 and every nonzero-increment quotient is 0. The horizontal separation represents a change of input, not output.
Figure 1A horizontal graph labeled f(x)=7. The two marked inputs x=1 and x=3 have equal output 7, so their output change is 0 and every nonzero-increment quotient is 0. The horizontal separation represents a change of input, not output.
Link to this figure ↗Download SVGDownload PNG

If f(x)=cf(x)=c with cc fixed, both f(a+h)f(a+h) and f(a)f(a) equal cc. For h0h\ne0, their difference quotient is zero.

cch=0  0\frac{c-c}{h}=0\ \longrightarrow\ 0

So f(a)=0f\prime(a)=0 at every real input aa.

Check your reasoning

f(x)=4f(x)=-4 for every real xx. Find f(2)f\prime(2).

Show answer and explanation
0

Equal outputs give zero change.

02The letter used for the fixed output does not matter#

The letter used for the fixed output does not matter. If kk is fixed while xx varies, then f(x)=kf(x)=k has derivative zero. A fixed negative output also has zero rate.

Check your reasoning

A sensor returns 1212 for every input xx. What is its rate of change with respect to xx?

Show answer and explanation
0

The output stays fixed as the input changes.

03Check your understanding#

Check your reasoning

Constant f(x)=5f(x)=5. Claim: slope 55. Repair.

  1. A00: every function has zero rate.
  2. B00: zero output change.
  3. CUndefined: 0/00/0.
Show answer and explanation
00: zero output change.

Equal outputs give zero difference.

Key takeaway

A fixed output gives zero output change and zero derivative.

  • Differentiate a constant scalar function.

Sources & further reading

  1. [1]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Constant rule.” Math behind ML. /learn/c-constant