Differentiate a sum or difference
Adding a parabola and a line
The faint parabola is \(f(x) = \tfrac12 x^2\), and the faint line is \(g(x) = x\). The solid curve is their sum, so its height at every \(x\) is the height of the parabola plus the height of the line.
The orange point is at \(x = 2\), and the orange line joins it to a second point a step \(h\) to the right. The two green pieces at the second point are the rises of the parabola and the line, stacked to make the rise of the sum. For \(h = 1\), the parabola rises 2.5, the line rises 1, and the sum rises 3.5.
Narrow the step. For \(h = 0.1\), the rises are 0.205, 0.1 and 0.305, and dividing by \(h\) gives the slopes 2.05, 1 and 3.05. As \(h\) shrinks, these slopes approach 2, 1 and 3, so the slopes add.
Any two curves
The two faint curves can be any curves \(f\) and \(g\), and the solid curve is their sum. Over any step, the rise of the sum is the rise of \(f\) plus the rise of \(g\).
A piece of the stack is green where its curve goes up and red where it goes down. A red piece counts as negative, so it makes the rise of the sum smaller.
Use \(f\) minus \(g\). The faint curve \(g\) is reflected in the \(x\)-axis to become \(-g\). This means that the rise of the difference is the rise of \(f\) minus the rise of \(g\).
Narrow the step. In every case, the slope of the sum or the difference is the slope of \(f\) plus or minus the slope of \(g\).
Notation
The derivative of a sum is the sum of the derivatives.
\[\frac{d}{dx}\bigl[f(x) + g(x)\bigr] = \cy{f'(x) + g'(x)}\]Over a step \(h\), the rise of the sum is the rise of \(f\) plus the rise of \(g\). Dividing by \(h\) splits the slope of the orange line into a slope for \(f\) and a slope for \(g\). As \(h \to 0\), each one approaches its derivative.
\[\begin{aligned} &\frac{(f+g)(x+h) - (f+g)(x)}{h} \\ &= \frac{f(x+h) - f(x)}{h} \\ &\quad + \frac{g(x+h) - g(x)}{h} \end{aligned}\]If both limits exist, the limit of a sum is the sum of the limits.
A difference is a sum with \(-g\), so the rule is the same and keeps the minus sign.
\[\begin{aligned} \frac{d}{dx}\bigl[f(x) - g(x)\bigr] &= f'(x) - g'(x) \end{aligned}\]For three or more terms, differentiate every term separately. Keep the plus or minus sign in front of each term.
\[\begin{aligned} \frac{d}{dx}\bigl[x^5 + x^2 - x\bigr] &= 5x^4 + 2x - 1 \end{aligned}\]The rule holds at an input \(x\) only if both \(f\) and \(g\) are differentiable at \(x\).
When it fails
Change \(g\) to \(|x|\), which has a corner at 0, so it is not differentiable there.
Move the point to 0. The corner of \(g\) stays in the sum, and the red half-lines show its slopes, \(-1\) on the left and \(1\) on the right. These slopes differ, so the sum has no derivative at 0.
Example 1: two terms
Find the derivative of \(y = x^4 + x^3\).
Treat \(x^4\) and \(x^3\) as two separate curves, and differentiate each with the power rule.
\[\frac{d}{dx}\,x^4 = 4x^3, \qquad \frac{d}{dx}\,x^3 = 3x^2\]Add the two derivatives.
\[y' = \cy{4x^3 + 3x^2}\]At \(x = 1\), the faint tangents have slopes 4 and 3. The sum has slope \(4 + 3 = 7\), and its orange tangent is steeper than both.
Example 2: a difference
Find the derivative of \(y = x^6 - x^2\). Then decide whether the curve rises or falls at \(x = 0.5\).
The curve is the difference of \(x^6\) and \(x^2\), so differentiate each term.
A tempting wrong move: Add the derivative of the second term.
\[y' = 6x^5 + 2x\]At \(x = 0.5\), this formula gives \(6 \cdot 0.5^5 + 2 \cdot 0.5 = 1.1875\), so the curve would rise. The red line has that slope, but the orange tangent falls, because the curve goes down until about \(x = 0.76\).
The minus sign stays in front of the second term, so its derivative is subtracted.
\[y' = 6x^5 - 2x\]At \(x = 0.5\), the slope is \(6 \cdot 0.5^5 - 2 \cdot 0.5 = -0.8125\), which is negative, so the curve falls.
Practice
Find the derivative of \(y = x^5 + x^3 - x\).
The solid curve is the sum of three faint curves, so its slope at \(x = 1\) is the total of their three slopes there.
Solution
Differentiate each term with the power rule.
\[\begin{aligned} \frac{d}{dx}\,x^5 &= 5x^4 \\ \frac{d}{dx}\,x^3 &= 3x^2 \\ \frac{d}{dx}\,x &= 1 \end{aligned}\]Add the first two derivatives, and subtract the third.
\[y' = 5x^4 + 3x^2 - 1\]At \(x = 1\), the three faint tangents have slopes 5, 3 and \(-1\), because the third curve is \(-x\). The sum has slope \(5 + 3 - 1 = 7\), which is the slope of the orange tangent.
Questions
Questions 1 and 2 use the graph of \(f(x) = x^3\), \(g(x) = x\) and the sum \(x^3 + x\). Question 3 needs a calculation.
At \(x = 1\), the tangent of \(x^3\) has slope 3, and the tangent of \(x\) has slope 1. What is the slope of \(x^3 + x\)?
- 4
- 3
- 2
Answer
4
The curve is now the difference \(x^3 - x\). What is its slope at \(x = 1\)?
- 2
- 4
- 3
Answer
2
Let \(g(x) = x^4 - x^3\). Find \(g'(2)\).
- 20
- 8
- 44
- 32
Answer
20
Summary
You differentiate a sum or a difference by differentiating each term and adding or subtracting the results.
This works because the rise of a sum over any step is the sum of the rises, so the slopes add.
If every term is differentiable at \(x\), the rule works for any number of terms.
This is one of four skills in topic 2.6 of Which & Why: AP Calculus.