Unit 2 · Topic 2.6

Differentiate sums and constants

Builds on the definition of the derivative and the power rule. 12 minutes.

  1. Example 1Differentiate a sum or difference
  2. Example 2Handle constants correctly
  3. Example 3Rewrite powers before differentiating
  4. Example 4Use the derivative at a point

The power rule gives the derivative of a single power of \(x\) (topic 2.5). Many functions are built from powers by multiplying them by constants and adding the results, as in the polynomial \(4x^3-5x+7\). This topic finds the derivative of such a function from the derivatives of its terms. Each rule comes from the definition of the derivative (topic 2.2):

\[f'(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]

The quotient is the slope of the secant line through the points of the graph at \(x\) and \(x+h\). Its numerator, \(f(x+h)-f(x)\), is the rise of the secant, and \(h\) is its run.

The rises of a sum add

Two faint curves: f, a wave, and g, a gently rising curve that stays below f until it crosses f near the right end. Above both lies the chalk curve f plus g. Each of the three curves has a point at the input x and a point at x plus h, with a dashed level run from the first point to x plus h and a green rise from there up to the curve. The rises of f and g appear again on the chalk curve, stacked one on top of the other with a short mark where they meet, and together they reach the point of the chalk curve at x plus h. A chalk secant joins the two points of the chalk curve, and an orange tangent touches it at x. A button puts a corner in g at x, and there two red half-lines replace the tangent.

Figure 1The chalk curve is the sum of the faint curves \(f\) and \(g\). Green segments show the rises from \(\cy{x}\) to \(x+h\), with those of \(f\) and \(g\) stacked again on the chalk curve. The orange line is the tangent at \(\cy{x}\), and red half-lines replace it at a corner.

In Figure 1, the faint curves are the graphs of \(f\) and \(g\), and the chalk curve is the graph of \(f+g\). Its height at each input is the height of \(f\) plus the height of \(g\). Faint dashed lines mark the inputs \(\cy{x}\) and \(x+h\). On each curve, a dashed run goes level from the point above \(\cy{x}\) to the line at \(x+h\). From there, a green rise goes up to the curve. On the chalk curve, the rises of \(f\) and \(g\) appear again, one on top of the other, with a short mark between them. Together they make up the rise of the chalk secant through the points of \(f+g\) above \(\cy{x}\) and \(x+h\). For every step \(h\ne0\), the rise of the sum is the sum of the rises, so dividing by \(h\) gives

\[\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 \(f\) and \(g\) are differentiable at \(x\), the two quotients on the right approach \(f'(x)\) and \(g'(x)\) as \(h\) approaches 0. By the sum law for limits (topic 1.5), the quotient on the left then approaches \(f'(x)+g'(x)\). Its limit is the derivative of \(f+g\), so \(f+g\) is differentiable at \(x\), and \((f+g)'(x)=f'(x)+g'(x)\). This result is the sum rule. Narrow the step in Figure 1. The secant turns onto the orange tangent at \(\cy{x}\), whose slope is this sum.

The same steps with minus signs and the difference law for limits give the difference rule, \((f-g)'(x)=f'(x)-g'(x)\). With three or more terms, the rule applies again for each further term. The derivative of a sum or difference of differentiable functions is therefore the sum or difference of their derivatives, each with its sign.

The rule needs both functions to be differentiable at \(x\). A function has no derivative at a corner, a point where its slopes from the left and from the right differ (topic 2.4). Use the button under Figure 1 to put a corner in \(g\) at \(\cy{x}\). The chalk curve then has a corner there too. Two red half-lines, with the slopes of \(f+g\) from the left and from the right, replace its tangent. The sum has no derivative at \(\cy{x}\), because if it had one, the difference rule would give \(g=(f+g)-f\) a derivative there. If both functions have a corner, the rule gives no answer: \(|x|+|x|\) has a corner at 0, but \(|x|+\left(-|x|\right)=0\) has the derivative 0.

Constant factors and constant terms

Above, a faint curve f that rises, falls and rises again, and the chalk curve c times f plus k, with an orange point and an orange tangent at the input x and a faint dashed tangent to f at the same input. Below, the slopes of both curves: a faint curve for f and a chalk curve for the other, with an orange bar from the axis up or down to the slope of the orange tangent, and a faint bar to the slope of f. With c = 2 and k = 1, the chalk curve is twice as tall as f and lifted by 1, and its slopes are twice those of f. Sliders change c and k.

Figure 2The faint curve is the graph of \(f\), and the chalk curve is the graph of \(c\,f(x)+k\), with an orange tangent at the orange point. The lower graph plots the slopes of both curves, and its orange bar is the slope of the orange tangent. The faint marks belong to \(f\).

In Figure 2, the faint curve is the graph of a function \(f\), and the chalk curve is the graph of \(c\,f(x)+k\). Here \(c\) and \(k\) are constants, numbers that do not depend on \(x\). The lower graph plots the slopes of both curves as heights, and its orange bar is the slope of the orange tangent above it.

Multiplying \(f\) by \(c\) multiplies its heights at \(x\) and at \(x+h\) by \(c\). Because \(c\) is a constant, it is the same at both inputs, so it comes out of the quotient:

\[\begin{aligned}&\frac{c\,f(x+h)-c\,f(x)}{h}\\&=c\cdot\frac{f(x+h)-f(x)}{h}\end{aligned}\]

If \(f\) is differentiable at \(x\), the quotient on the right approaches \(f'(x)\). By the constant multiple law for limits, the left side then approaches \(c\,f'(x)\). This result is the constant multiple rule, \((cf)'(x)=c\,f'(x)\). Slide \(c\) in Figure 2. At every input, the chalk curve on the lower graph is \(c\) times the faint one. A negative \(c\) reflects both chalk curves vertically, so where \(f\) rises, the chalk curve falls. A factor that depends on \(x\) does not come out of the quotient: \(x\cdot x^3=x^4\) has the derivative \(4x^3\), not \(x\cdot 3x^2=3x^3\).

A constant function has the same value \(k\) at every input, so its graph is a horizontal line. Every rise is 0, so its derivative is 0. This result is the constant rule. With \(c=0\), the chalk curve in Figure 2 is such a line, and the chalk curve on the lower graph lies on its axis. By the sum rule, a constant term therefore adds nothing to a derivative: \((f+k)'(x)=f'(x)+0=f'(x)\). Slide \(k\). The chalk curve moves up or down, its tangent moves with it without turning, and the lower graph stays where it is.

With the power rule, these rules differentiate any sum of terms \(c\,x^n\), one term at a time. Each term \(c\,x^n\) has the derivative \(c\,n\,x^{n-1}\) by the constant multiple and power rules, and a constant term has the derivative 0. For example, the derivative of \(4x^3-5x+7\) is \(12x^2-5\).

These rules need each term written as a constant times a power of \(x\). For \(x>0\) and a positive integer \(m\), the laws of exponents give \(\frac{c}{x^n}=c\,x^{-n}\) and \(c\sqrt[m]{x^n}=c\,x^{n/m}\). A constant in a denominator divides the term, as in \(\frac{5}{2x^3}=\frac52x^{-3}\). A quotient with a single term in its denominator splits into one term for each term of its numerator: \(\frac{x^2+3}{\sqrt x}=x^{3/2}+3x^{-1/2}\). A denominator with two or more terms does not split this way, because at \(x=1\), \(\frac{1}{x+1}=\frac12\) but \(\frac1x+\frac11=2\). The two forms are equal only where the original is defined, so the derivative of \(\frac{x^2+3}{\sqrt x}\) found this way holds for \(x>0\).

Slopes and tangent lines

The slope of the graph of \(f\) at \(x=a\) is \(f'(a)\) (topic 2.1). To find it, differentiate term by term. Then substitute \(a\) into \(f'\). The tangent line at \(\big(a,f(a)\big)\) is the line through that point with slope \(f'(a)\), so its equation in point-slope form is \(y-f(a)=f'(a)(x-a)\).

A condition on a slope, such as “the slope at \(x=2\) is 7”, is the equation \(f'(2)=7\). If \(f\) contains an unknown constant, treat it as a constant while you differentiate. The slope condition is then an equation for the unknown. A condition on a value, such as \(f(2)=5\), is a different equation, about the height of the graph.

Example 1

Differentiate a sum or difference

Find \(\dfrac{dy}{dx}\) for \(y=x^4-x-x^{-1}\).

Solution

Each term is a power of \(x\), so each term is differentiable at every \(x\ne0\), where \(y\) is defined. By the sum and difference rules, \(\dfrac{dy}{dx}\) is the sum of the derivatives of the terms, each with its sign. The power rule gives \(\frac{d}{dx}\,x=1\) and \(\frac{d}{dx}\,x^{-1}=-x^{-2}\), so

\[\begin{aligned}\frac{dy}{dx}&=4x^3-1-\left(-x^{-2}\right)\\&=4x^3-1+x^{-2}\end{aligned}\]

For \(x\ne0\), the derivative is \(\dfrac{dy}{dx}=4x^3-1+\dfrac{1}{x^2}\).

Example 2

Handle constants correctly

Let \(f\) and \(g\) be differentiable functions with \(f'(3)=5\) and \(g'(3)=12\). Let \(p(x)=4f(x)-\dfrac{g(x)}{2}+\pi^2\). Find \(p'(3)\).

Solution

The functions \(f\) and \(g\) are differentiable, and 4, \(\frac12\) and \(\pi^2\) are constants, numbers that do not depend on \(x\). By the sum and difference rules, each term is differentiated on its own. Each constant factor stays in front, and the constant term has the derivative 0:

\[p'(x)=4f'(x)-\frac{g'(x)}{2}+0\]

At \(x=3\), with the two given derivatives,

\[p'(3)=4\cdot 5-\frac{12}{2}=20-6=14\]

Example 3

Rewrite powers before differentiating

Let \(f(x)=\dfrac{x^3+4\sqrt{x}}{2x}\) for \(x>0\). Find \(f'(x)\).

Solution

The denominator \(2x\) is a single term, so each term of the numerator can be divided by it. With \(\sqrt{x}=x^{1/2}\), the laws of exponents give

\[\begin{aligned}f(x)&=\frac{x^3}{2x}+\frac{4x^{1/2}}{2x}\\&=\frac12x^2+2x^{-1/2}\end{aligned}\]

The two forms agree for every \(x>0\), the domain of \(f\). Each term is now a constant times a power of \(x\), so the rules apply term by term:

\[\begin{aligned}f'(x)&=\frac12\cdot 2x+2\left(-\frac12\right)x^{-3/2}\\&=x-x^{-3/2}\end{aligned}\]

In root form, \(f'(x)=x-\dfrac{1}{x\sqrt{x}}\) for \(x>0\).

Example 4

Use the derivative at a point

Let \(f(x)=x^3+bx^2-10\), where \(b\) is a constant. The line tangent to the graph of \(f\) at \(x=1\) has slope 11. Find \(b\), and write an equation for this tangent line.

Solution

The function \(f\) is a polynomial, so it is differentiable at every \(x\). Differentiate term by term, with \(b\) as a constant factor:

\[f'(x)=3x^2+2bx\]

The slope of the tangent line at \(x=1\) is \(f'(1)\), so the condition is an equation for \(b\):

\[\begin{aligned}f'(1)=3+2b&=11\\b&=4\end{aligned}\]

With \(b=4\), the point of tangency has the height \(f(1)=1+4-10=-5\). The tangent line passes through \((1,-5)\) with slope 11:

\[\begin{aligned}y-(-5)&=11(x-1)\\y&=11x-16\end{aligned}\]

Each example is one of the four skills of topic 2.6 in Which & Why: AP Calculus.