The Sum and Difference Rule

The derivative of a sum is the sum of the derivatives: $(u+v)' = u'+v'$, and likewise $(u-v)' = u'-v'$. You can therefore differentiate any sum or difference term by term.

📜 Formula

$$ \frac{d}{dx}\big(u(x)\pm v(x)\big) = u'(x) \pm v'(x) $$

Together with the constant factor rule this is the linearity of the derivative:

$$ \big(a\,u + b\,v\big)' = a\,u' + b\,v' $$

It holds for any number of terms: $(u+v-w+\dots)' = u'+v'-w'+\dots$ Proof: the difference quotient of a sum is the sum of the difference quotients, and limits of sums are sums of limits.

✏️ Examples

Example 1: polynomial $4x^3 - 2x^2 + 7x - 5$

Each term with the power rule; the constant $-5$ gives $0$.

$f'(x) = 12x^2 - 4x + 7$


Example 2: $x^2 + \sin x - e^x$

$f'(x) = 2x + \cos x - e^x$


Example 3: $\sqrt{x} + \dfrac{1}{x} + \ln x$

$f'(x) = \dfrac{1}{2\sqrt{x}} - \dfrac{1}{x^2} + \dfrac{1}{x}$


Example 4: $3\cos x - 5x^4 + \pi$

$f'(x) = -3\sin x - 20x^3$

⚠️ Careful

The sum rule only splits sums. Products and quotients are not differentiated factor by factor: $(x^2\sin x)' \neq 2x\cos x$ – use the product rule.

A sum inside another function needs the chain rule: $\big((x^2+x)^3\big)' = 3(x^2+x)^2(2x+1)$.

🪜 A longer example, term by term

Differentiate $f(x) = 2x^5 - \dfrac{3}{x} + 4\sqrt{x} - 7\cos x + e^2$.

  1. Split into terms (sum rule) and keep the signs.
  2. Rewrite where useful: $\frac{3}{x} = 3x^{-1}$, $\;4\sqrt{x} = 4x^{1/2}$.
  3. Differentiate each term: $(2x^5)' = 10x^4$, $\;(-3x^{-1})' = 3x^{-2}$, $\;(4x^{1/2})' = 2x^{-1/2}$, $\;(-7\cos x)' = 7\sin x$, $\;(e^2)' = 0$.
  4. Collect the results.

$f'(x) = 10x^4 + \dfrac{3}{x^2} + \dfrac{2}{\sqrt{x}} + 7\sin x$

💡 Two signs flip in this example: $-3x^{-1}$ becomes $+3x^{-2}$ because the exponent $-1$ comes down as a factor, and $-7\cos x$ becomes $+7\sin x$ because $(\cos x)' = -\sin x$. These are the places where most mistakes happen.

✂️ Rewrite first, then use the sum rule

Products and fractions sometimes turn into sums after a little algebra – then no product or quotient rule is needed:

  • $(x^2+1)^2 = x^4 + 2x^2 + 1$, so $f'(x) = 4x^3 + 4x$.
  • $\dfrac{x^3 - x}{x} = x^2 - 1$ (for $x \neq 0$), so $f'(x) = 2x$.
  • $\dfrac{x + 1}{\sqrt{x}} = x^{1/2} + x^{-1/2}$, so $f'(x) = \frac{1}{2\sqrt{x}} - \frac{1}{2x\sqrt{x}}$.

Both ways – expanding or using the chain rule – give the same result; expanding is usually faster for small powers.

🧮 Try it with the step-by-step calculator

Open any of these examples in the calculator to see every single differentiation step:

Or enter your own function on the derivative calculator.

❓ Frequently asked questions

What is the sum rule in differentiation?

$(u+v)' = u' + v'$: the derivative of a sum is the sum of the derivatives of its terms.

Is there a difference rule?

Yes, it works the same way with a minus sign: $(u-v)' = u'-v'$. It is often called the sum and difference rule.

How do you differentiate a polynomial?

Term by term with the sum rule, using the power rule for each term and dropping constants: $(x^3 + 2x - 1)' = 3x^2 + 2$.