Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

The rules of differentiation

Differentiating from the definition costs a paragraph of algebra per function, and the answers are tidy enough to suggest that most of that work is repeated in the same way each time.

This lesson extracts the repetition into four rules. Each is proved from the difference quotient of the previous lesson, because a rule you have seen derived is one you can rebuild when memory garbles it, and because two of the four have plausible wrong versions that a derivation immediately kills. After this, the limit definition retires: it stays as the justification and stops being a method.

Linearity

Start with the two easiest. If f and g are differentiable, so is f+g, and (f+g)=f+g. The proof is one line of rearrangement: the difference quotient of f+g is

[f(x+h)+g(x+h)]-[f(x)+g(x)]h=f(x+h)-f(x)h+g(x+h)-g(x)h

and the limit of a sum is the sum of the limits, which is one of the limit laws. Similarly (cf)=cf for a constant c, since the constant factors out of the quotient and then out of the limit.

Together these say that differentiation is linear, which is the property that lets a polynomial be differentiated term by term. It is worth noticing what is not claimed, because the pattern does not continue: there is no rule saying the derivative of a product is the product of the derivatives, and the next section shows why in one line.

A constant function has derivative zero, since every difference in the numerator is zero before any limit is taken. Geometrically it is a horizontal line, and the consequence for later work is that adding a constant to a function never changes its derivative, so a derivative cannot possibly determine its function uniquely.

The power rule

The pattern noticed at the end of the previous lesson, that xn differentiates to nxn-1, can be proved for every positive integer n using a factorisation from the earlier course:

xn-an=(x-a)(xn-1+xn-2a++xan-2+an-1)

Use the second form of the definition, with the quotient (f(x)-f(a))/(x-a). The factor (x-a) cancels exactly, leaving the long bracket, which is a polynomial and so may be evaluated at x=a by substitution. Every one of its terms becomes an-1, and there are n of them, so the limit is nan-1. Since a was arbitrary, f(x)=nxn-1 everywhere.

That covers positive integers. The quotient rule below extends it to negative integers, and the lesson on implicit differentiation extends it to every rational exponent; the result is the same formula in all cases, and it holds for irrational exponents too. So x7 differentiates to 7x6, which at x=2 is 448, and x=x1/2 differentiates to 12x-1/2, agreeing with the conjugate calculation done from scratch earlier.

With linearity, every polynomial is now immediate. The derivative of 3x4-5x2+7x-2 is 12x3-10x+7, written down in one pass with no limits anywhere.

The product rule

The plausible guess is (fg)=fg, and it is wrong. Test it on f(x)=g(x)=x: the product is x2, whose derivative is 2x, while the product of the derivatives is 1. A rule that fails on the simplest possible case needs no further refutation. Leibniz himself conjectured the product of the differentials in his early notes in 1675 and corrected it within days, which is a good indication that the correct rule is not obvious.

Here is the derivation. The numerator of the difference quotient is f(x+h)g(x+h)-f(x)g(x), and the trick is to add and subtract a hybrid term, f(x+h)g(x), which changes nothing and splits the difference into two differences that each move only one factor:

f(x+h)g(x+h)-f(x+h)g(x)+f(x+h)g(x)-f(x)g(x)

Group the first pair and the second pair, divide by h, and the quotient becomes

f(x+h)g(x+h)-g(x)h+g(x)f(x+h)-f(x)h

Now take the limit. The two quotients tend to g(x) and f(x). The stray factor f(x+h) tends to f(x), and it does so because f is differentiable and therefore continuous, which is where that theorem from the previous lesson earns its place. The result is

(fg)=fg+fg

The rule is symmetric, which is a useful check, and it explains the failed guess: the true derivative has two terms because a product can change by either factor moving, and fg counts neither of them.

Example. Differentiate (x2+1)(x3-2x) and evaluate the derivative at x=2.

With f=x2+1 and g=x3-2x, the derivatives are f=2x and g=3x2-2. The rule gives 2x(x3-2x)+(x2+1)(3x2-2). At x=2 the first term is 4×4=16 and the second is 5×10=50, so the derivative is 66. Check by expanding first: the product is x5-x3-2x, whose derivative is 5x4-3x2-2, giving 80-12-2=66. The two routes agree, as they must.

Now you. Differentiate (2x-1)(x2+3) and evaluate at x=1.

Answer

The rule gives 2(x2+3)+(2x-1)(2x), which at x=1 is 2×4+1×2=10. Expanding first gives 2x3-x2+6x-3, with derivative 6x2-2x+6, again 10 at x=1.

The quotient rule

For a quotient the result is

(fg)=fg-fgg2

valid wherever g0. It can be derived from the definition by the same add-and-subtract manoeuvre, but the quicker route is to write q=f/g, so that f=qg, and apply the product rule: f=qg+qg. Solving for q gives q=(f-qg)/g, and substituting q=f/g and tidying over the common denominator produces the formula.

The minus sign and the order of the terms are the two things people get wrong, and the way to check them is a special case you already know. Take f=1 and g=x. The rule gives (0x-11)/x2=-1/x2, which matches the first-principles calculation of the derivative of 1/x done earlier. If a misremembered version gives +1/x2, that test catches it at once.

The same special case extends the power rule downward. For f=1 and g=xn the rule gives -nxn-1/x2n=-nx-n-1, which is the power rule with the exponent -n in place of n. So the formula holds for negative integers too.

Example. Differentiate xx2+1 and evaluate at x=2.

Here f=x, f=1, g=x2+1, g=2x. The rule gives [(1)(x2+1)-x(2x)]/(x2+1)2=(1-x2)/(x2+1)2. At x=2 that is (1-4)/25=-0.12. The sign is negative, and it should be: this function peaks at x=1 and declines thereafter, and the formula makes the peak visible, since the numerator 1-x2 vanishes exactly at x=1.

Now you. Differentiate 3x+1x-2 and evaluate at x=3.

Answer

The rule gives [3(x-2)-(3x+1)]/(x-2)2=-7/(x-2)2. At x=3 that is -7. The derivative is negative for every x2, so the function is decreasing on each side of its asymptote.

The chain rule

The last rule is the one that matters most, because almost every function met in practice is a composition. Its statement, in Lagrange notation, is that if y=f(u) and u=g(x) then

dydx=dydududx

or equivalently (fg)(x)=f(g(x))g(x): differentiate the outside function, leave the inside alone in it, and multiply by the derivative of the inside.

The reason it is a product is a statement about rates. If a car's fuel use rises by 3 litres for each extra hour driven, and the cost rises by 1.60 for each extra litre, then the cost rises by 4.80 per extra hour, and the two rates multiply. The Leibniz form makes this look like cancellation of du, which is exactly why the notation was designed that way and exactly why the appearance is dangerous: the honest proof multiplies and divides by Δu, which is illegitimate whenever Δu happens to be zero, and repairing that gap takes a page. The gap is real, the repair is standard, and the rule is true.

Example. Differentiate x2+9 and evaluate at x=4.

The outside function is u, with derivative 1/(2u); the inside is u=x2+9, with derivative 2x. Multiplying gives 2x/(2x2+9)=x/x2+9. At x=4 the square root is 25=5, so the derivative is 4/5=0.8. That number has a geometric meaning: this function is the distance from the origin to a point moving along a horizontal line nine units up, and 0.8 is the component of the motion along the line of sight.

Now you. Differentiate (x3+1)5 and evaluate at x=1.

Answer

The outside is u5 with derivative 5u4; the inside is x3+1 with derivative 3x2. So the derivative is 5(x3+1)43x2=15x2(x3+1)4, which at x=1 is 15×16=240.

Compositions can be nested, and the rule composes with itself: each layer contributes its own derivative as a factor, working from the outside in. Differentiating (3x2+1)10 gives 10(3x2+1)96x, and at x=1 that is 60×49=15{,}728{,}640. The size of that number is a reminder that a modest-looking function can have an enormous rate of change, which is why exponents are where numerical trouble usually starts.

Assembling them

Real functions need several rules at once, and the only skill involved is deciding which structure is outermost before touching anything.

Take y=x2(2x+1)3x-1. The outermost structure is a quotient, so the quotient rule applies with f=x2(2x+1)3 and g=x-1. Differentiating f needs the product rule, with the second factor needing the chain rule: f=2x(2x+1)3+6x2(2x+1)2. Assembling, y=[f(x-1)-f]/(x-1)2. At x=2 the pieces are f=4×125=500 and f=4×125+6×4×25=1100, so y=(1100×1-500)/1=600.

The habit worth building is to name the pieces before differentiating anything, write the rule with the names, and only then substitute. Skipping that step is where the sign errors and the missing chain factors come from, and they come from it reliably.

Where the rules stop

Everything above is closed under the operations of algebra. Any function built from powers by adding, multiplying, dividing and composing can now be differentiated mechanically, and that class is large: all polynomials, all rational functions, all algebraic combinations of roots.

It does not include sinx, and it does not include 2x. No amount of the power rule reaches them, because they are not built from powers by algebra: the sine is defined by a rotation and the exponential by repeated multiplication extended to the continuum. Their difference quotients lead to limits that no factoring or conjugate will resolve, in particular limh0(sinh)/h and limh0(ah-1)/h.

Those two limits are the subject of the next lesson, and the second of them turns out to select a particular number as the natural base for an exponential, which is where e actually comes from.