The Constant Rule: Derivative of a Constant

The derivative of a constant is always zero: $\dfrac{d}{dx}\,c = 0$. A constant function is a horizontal line – its slope is $0$ everywhere.

📜 Formula and reason

$$ f(x) = c \quad\Longrightarrow\quad f'(x) = \lim_{h\to0}\frac{c-c}{h} = 0 $$

"Constant" means: does not depend on the differentiation variable. That includes numbers like $\pi$, $e^2$, $\ln 5$, $\sqrt{3}$ and also other letters when you differentiate with respect to $x$ (e.g. $a$, $b$, $k$ – see partial derivatives).

✏️ Examples

FunctionDerivativeNote
$7$$0$
$-\frac{3}{4}$$0$
$\pi^2$$0$a number, even if it looks like a power
$\ln 5$, $e^3$$0$no $x$ involved
$x^2 + 9$$2x$the constant term disappears (sum rule)
$a^2$ (w.r.t. $x$)$0$$a$ is a constant here

Do not confuse it with the constant factor rule: a constant that is added disappears ($(x^2+5)' = 2x$), a constant that is multiplied stays ($(5x^2)' = 10x$).

💡 This is also why antiderivatives have a "$+C$": all functions $F(x)+C$ have the same derivative.

🕵️ Constants in disguise

Many expressions that look complicated are just numbers, and their derivative is $0$. The test is always the same: does the expression change when $x$ changes?

  • $\sin\!\big(\frac{\pi}{3}\big) = \frac{\sqrt3}{2}$, $\;\ln 2$, $\;e^2$, $\;\sqrt{7}$, $\;\big(\frac{\pi}{2}\big)^2$ – all constant, derivative $0$.
  • $x^0 = 1$ for $x \neq 0$ – constant, derivative $0$. (The power rule agrees: $0\cdot x^{-1} = 0$.)
  • $\ln(e^5) = 5$ – constant. But $\ln(e^x) = x$ is not constant; its derivative is $1$.
  • $a\cdot b^2$ when differentiating with respect to $x$ – constant, derivative $0$.

A common exam trap is $\frac{d}{dx}\,e^2$. Students write $2e$ or $e^2\cdot 2$, but there is no $x$ anywhere, so the answer is simply $0$.

📚 Two important consequences

Partial derivatives

For a function of several variables, every variable except the one you differentiate with respect to is treated as a constant. For $f(x, y) = x^2y + y^3$:

$$ \frac{\partial f}{\partial x} = 2xy \qquad\qquad \frac{\partial f}{\partial y} = x^2 + 3y^2 $$

In $\frac{\partial f}{\partial x}$ the term $y^3$ is a constant and disappears – exactly the constant rule.

The converse: zero derivative means constant

If $f'(x) = 0$ for every $x$ in an interval, then $f$ is constant on that interval (a consequence of the mean value theorem). This is why two antiderivatives of the same function differ only by a constant – and why every indefinite integral ends with $+\,C$.

❓ Frequently asked questions

What is the derivative of a constant?

Zero: $\frac{d}{dx}c = 0$ for every constant $c$.

What is the derivative of pi?

$\pi$ is a constant number, so its derivative is $0$. The same holds for $e$, $\pi^2$ or $\sqrt{2}$.

What is the derivative of 2x?

That is not a constant: by the constant factor rule $(2x)' = 2\cdot 1 = 2$.