Zum Inhalt springen

Computing derivatives

Aus Wikibooks

In the last chapter we defined the derivative function f:D of another differentiable function f:D as follows: f(x~):=limxx~f(x)f(x~)xx~. However, evaluating this limit can be a very cumbersome way to determine the derivative. For example, take the function g: with g(x)=x2ln(x). To calculate their derivatives we would have to determine limxx~x2ln(x)x~2ln(x~)xx~ for every x~.

It would be great to apply some rules to directly find an expression for the derivative function, which saves us the differential quotient computation. And luckily there are indeed derivative rules that trace derivatives of a complicated function back to derivatives of some very basic functions that are known exactly.

Overview

[Bearbeiten]

If f and g are differentiable functions, with the compositions af (with a), f+g, fg, fg and fg being all well-defined and differentiable, Then the following derivative rules apply:

Name Regel
Factor rule (af)=af
Sum rule (f±g)=f±g
Product rule (fg)=fg+fg
Quotient rule (fg)=gffgg2
Inverse rule (1g)=gg2
Chain rule (fg)=(fg)g
Special cases of the chain rule (fn)=nfn1f(f)=f2f(expf)=(expf)f(lnf)=ff
Inverse rule (yet missing) (f1)=1ff1

All rules at one glance

[Bearbeiten]

The derivatives rules can be explained in simple words:

  • Factor rule (af)=af: The derivative is linear, so we can pull out any real (or even complex) number.
  • Sum and difference rule (f±g)=f±g: The derivative is linear, so for a sum, we can take the derivative of both summands separately.
  • Product rule (fg)=fg+fg: "Derive the first function and the second remains unchanged plus derive the second function and the first remains unchanged".
  • Quotient rule (fg)=gffgg2: DDE-EDD is a simple memorization rule for the numerator ("denominator derivative enumerator minus enumerator derivative denominator")
  • Inverse rule (1g)=gg2: This is the special case of the quotient rule with f1 (enumerator is constant 1).
  • Chain rule (fg)=(fg)g: "Derive the outer function times derive the inner function". Caution, the derivative of the outer function must be taken with the inner function inserted (f(g(x))). The differentiation of the inner function must not be forgotten either.

Factor rule

[Bearbeiten]

Theorem (Factor product)

Let f:D be a differentiable function with derivative f:D and let λ be a scalar factor. Then (λf):D is differentiable and

(λf)=λf

Proof (Factor product)

We need to show that limxx~(λf)(x)(λf)(x~)xx~ exists and equals λf. For x~D there is

limxx~(λf)(x~)(λf)(x)x~x= limxx~λf(x~)λf(x)x~x= limxx~λf(x~)f(x)x~x limxaλg(x)=λlimxag(x)= λlimxx~f(x~)f(x)x~x= λf(x~)

So (λf)=λf.

Sum rule

[Bearbeiten]

Theorem

[Bearbeiten]

Now we want to determine the derivative of a function g+f, where g:D and f:D are both differentiable functions.

Theorem (Sum rule)

Let f,g:D with D be two differentiable functions with derivatives f:D and g:D. Then f+g:D is differentiable and for all xD there is:

(f+g)(x)=f(x)+g(x)

Proof (Sum rule)

We need to prove that the limit limxx~(f+g)(x)(f+g)(x~)xx~ exists. We have

limxx~(f+g)(x)(f+g)(x~)xx~= limxx~f(x)+g(x)f(x~)g(x~)xx~= limxx~(f(x)f(x~)xx~+g(x)g(x~)xx~) f and g are differentiable= limxx~f(x)f(x~)xx~+limxx~g(x)g(x~)xx~= f(x~)+g(x~)

So (f+g)(x)=f(x)+g(x).

Example

[Bearbeiten]

Example (Sums of lines)

We consider two straight lines f,g: with f(x)=m1x+t1 and g(x)=m2x+t2. Then

(f+g)(x)=m1x+t1+m2x+t2=(m1+m2)x+(t1+t2)

The derivative of a function at the position x is the slope of the function at this position. The slope of the straight lines f and g are m1 and m2 respectively. So f(x)=m1 and g(x)=m2 for all x.

For the straight line f+g , the slope is m1+m2 . So we have (f+g)(x)=m1+m2=f(x)+g(x). Hence, the summation rule holds for straight lines.

Difference rule

[Bearbeiten]

Exercise (Difference rule)

Prove the difference rule for derivatives, in analogy to the summation rule: Let f,g:D with D be two differentiable functions with derivative f:D and g:D. Then fg is also differentiable. And for all xD, there is:

(fg)(x)=f(x)g(x)

Proof (Difference rule)

For x~D there is

limxx~(fg)(x)(fg)(x~)xx~= limxx~f(x)g(x)f(x~)+g(x~)xx~= limxx~(f(x)f(x~)xx~g(x)g(x~)xx~) f and g are differentiable= limxx~f(x)f(x~)xx~limxx~g(x)g(x~)xx~= f(x~)g(x~)

Product rule

[Bearbeiten]

Theorem (Product rule)

Let f:D and g:D with D be differentiable functions with known derivative functions f,g:D. Then, fg:D,(fg)(x):=f(x)g(x) is differentiable and there is

(fg):D,(fg)(x)=f(x)g(x)+g(x)f(x)

Proof (Product rule)

Let xD. Then, there is:

limxx~(fg)(x)(fg)(x~)xx~ definition of (fg)= limxx~f(x)g(x)f(x~)g(x~)xx~ f(x~)g(x)+f(x~)g(x)=0= limxx~f(x)g(x)f(x~)g(x)+f(x~)g(x)f(x~)g(x~)xx~= limxx~f(x)g(x)f(x~)g(x)xx~+f(x~)g(x)f(x~)g(x~)xx~ pull apart the limit= limxx~f(x)g(x)f(x~)g(x)xx~+limxx~f(x~)g(x)f(x~)g(x~)xx~ factor out g(x) and f(x~)= limxx~g(x)f(x)f(x~)xx~+limxx~f(x~)g(x)g(x~)xx~ limit theorems= limxx~g(x)g(x~)limxx~f(x)f(x~)xx~f(x~)+f(x~)limxx~g(x)g(x~)xx~g(x~)= g(x~)f(x~)+f(x~)g(x~)

In order to justify that the limits may be pulled apart, one must look at the calculation from back to front. Since all sub-expressions converge, the limit sets are allowed to be used.

Alternative proof (Product rule)

We look at any x~D. Since f and g are differentiable according to the condition in x~, there are functions δf,δg:D, such that for all xD there is

f(x)=f(x~)+f(x~)(xx~)+δf(x)g(x)=g(x~)+g(x~)(xx~)+δg(x)

In addition, there is limxx~δf(x)xx~=0 and limxx~δf(x)xx~=0. Hence, for all xD we have

f(x)g(x)= (f(x~)+f(x~)(xx~)+δf(x))(g(x~)+g(x~)(xx~)+δg(x))= f(x~)g(x~)+(f(x~)g(x~)+g(x~)f(x~))(xx~)+δf(x)g(x~)(xx~)+δg(x)f(x~)(xx~)+f(x~)g(x~)(xx~)2+f(x~)δg(x)+g(x~)δf(x)+δf(x)δg(x)

Now, we define the function δfg:D by

δfg(x):=δf(x)g(x~)(xx~)+δg(x)f(x~)(xx~)+f(x~)g(x~)(xx~)2+f(x~)δg(x)+g(x~)δf(x)+δf(x)δg(x)

So for all xD:

f(x)g(x)=f(x~)g(x~)+(f(x~)g(x~)+g(x~)f(x~))(xx~)+δfg(x)

If we can show that limxx~δfg(x)xx~=0, then fg is differentiable at x~ and (fg)(x~)=f(x~)g(x~)+g(x~)f(x~). It is sufficient to show that all summands of the term δfg(x) converge faster than xx~ towards 0:

limxx~δg(x)f(x~)(xx~)xx~=limxx~δf(x)0g(x~)=0limxx~δg(x)f(x~)(xx~)xx~=limxx~δg(x)0f(x~)=0limxx~f(x~)g(x~)(xx~)2xx~=limxx~f(x~)g(x~)(xx~)0=0limxx~f(x~)δg(x)xx~=limxx~f(x~)δg(x)xx~0=0limxx~g(x~)δf(x)xx~=limxx~g(x~)δf(x)xx~0=0limxx~δf(x)δg(x)xx~=limxx~δf(x)0δg(x)xx~0=0

Quotient rule

[Bearbeiten]

Theorem (Quotient rule)

Let f,g:D be two differentiable functions with g(x)0 for all xD. Then the derivative of the function fg:D, defined by (fg)(x)=f(x)g(x), is differentiable and for (fg):D there is

(fg)(x)=f(x)g(x)f(x)g(x)g2(x)

Here, g2(x)=g(x)g(x). In particular, we have the inverse rule:

(1g)(x)=g(x)g2(x)

Proof (Quotient rule)

To prove the statement we first show that (1g)(x)=g(x)g2(x) holds. Here, g:D is a differentiable function with g(x)0 for all xD. Let now x~D. We consider limxx~(1g)(x)(1g)(x~)xx~. There is

limxx~(1g)(x)(1g)(x~)xx~= limxx~1g(x)1g(x~)xx~= limxx~g(x~)g(x)g(x)g(x~)xx~= limxx~g(x~)g(x)g(x~)g(x)(xx~)= limxx~(g(x)g(x~)xx~1g(x~)g(x)) limit theorems= limxx~(g(x)g(x~)xx~)limxx~1g(x~)g(x) factor rule= limxx~g(x)g(x~)xx~g(x~)1g(x~)limxx~g(x)g(x~)= g(x~)1g(x~)g(x~)= g(x~)g2(x~)

In the end, we see that all sub-expressions converge. That is why the limit theorems are allowed to be used. Now we derive the quotient rule for fgg from this. Here we have f,g:D and g(x)0 for all xD. The quotient rule can then be derived from the product rule:

(fg)(x)=(f(x)g(x))=(f(x)1g(x)) product rule= f(x)1g(x)+f(x)(g(x)g2(x))= f(x)g(x)f(x)g(x)g2(x)

Chain rule

[Bearbeiten]

Theorem (Chain rule)

Let f:AB and g:CD be two real-valued and differentiable functions with A,B,C,D and f(A)C. Then, for the derivative function of gf:AD, there is:

(gf):A,(gf)(x)=g(f(x))f(x)

How to get to the proof? (Chain rule)

We could first try to conduct the proof directly via the differential quotient:

limxx~(gf)(x)(gf)(x~)xx~= limxx~(g(f(x))(g(f(x~))xx~ expand by f(x)f(x~)= limxx~(g(f(x))(g(f(x~))f(x)f(x~)f(x)f(x~)xx~ limit theorems= limxx~(g(f(x))(g(f(x~))f(x)f(x~)g(f(x~))limxx~f(x)f(x~)xx~f(x~)= g(f(x~))f(x~)

These arithmetic steps reflect the basic idea behind a proof of the chain rule. But this argumentation is problematic (i.e. wrong) for several reasons:

  • We expand by f(x)f(x~). But what happens if f(x~)=f(x)? Then we have expanded by zero, which is not allowed. So the found limit value doesn't need to be correct any more.
  • In the last step we claim that limxx~g(f(x))(g(f(x~)f(x)f(x~)=g(f(x~)) would hold. All we know is that limf(x)f(x~)g(f(x))(g(f(x~)f(x)f(x~)=g(f(x~)), but we cannot say anything about how this limit value behaves in the limit xx~ instead of f(x)f(x~).

To save the proof, we take a way around, using an auxiliary function. This function will be well defined at the position x~, so we avoid the extension with f(x)f(x~).

Proof (Chain rule)

Let x~A. We define the following auxiliary function:

g~:C,u{g(u)g(f(x~))uf(x~);uf(x~)g(f(x~));u=f(x~)

Then, there is for all uC:

g(u)g(f(x~))=g~(u)(uf(x~))

Further, g~ is continuous at all uf(x~): it is just a combination of continuous functions.g~ is even continuous at u=f(x~), since differentiability of g implies

limuf(x~)g~(u)=limuf(x~)g(u)g(f(x~))uf(x~)=g(f(x~))=g~(f(x~))

So:

limxx~(gf)(x)(gf)(x~)xx~= limxx~(g(f(x))(g(f(x~))xx~ g(f(x))(g(f(x~))=g~(f(x))(f(x)f(x~))= limxx~g~(f(x))(f(x)f(x~))xx~ limit theorems= limxx~(f(x)f(x~))xx~f(x~)limxx~g~(f(x))= f(x~)limxx~g~(f(x)) g~ is continuous= f(x~)g~(limxx~f(x)) f is continuous = f(x~)g~(f(x~))= f(x~)g(f(x~))

Alternative proof (Chain rule)

Let x~A. Since f and g are differentiable , there are functions δf:A~:={ax~|aA} and δg:C~:={cf(x~)|cC}, such that for all hA~ and all iC~ there is

f(x~+h)=f(x~)+f(x~)h+δf(h)g(f(x~)+i)=g(f(x~))+g(f(x~))i+δg(i)

In addition limh0δf(h)h=0 as well as limi0δg(i)i=0. So:

(gf)(x~+h)= g(f(x~)+f(x~)h+δf(h))= g(f(x~))+g(f(x~))(f(x~)h+δf(h))+δg(f(x~)h+δf(h))= g(f(x~))+g(f(x~))f(x~)h+g(f(x~))δf(h)+δg(f(x~)h+δf(h))

We now define

δgf:A~,xg(f(x~))δf(h)+δg(f(x~)h+δf(h))

In order to prove that gf is differentiable at x~ with (gf)(x~)=g(f(x~))f(x~) we need to show that limh0δgf(h)h=0 holds. There is:

limh0δgf(h)h= limh0g(f(x~))δf(h)+δg(f(x~)h+δf(h))h pull apart the limit= limh0g(f(x~))δf(h)h+limh0δg(f(x~)h+δf(h))h= g(f(x~))limh0δf(h)h+limh0δg(f(x~)h+δf(h))h limh0δf(h)h=0= g(f(x~))0+limh0δg(f(x~)h+δf(h))h= limh0δg(f(x~)h+δf(h))h

To calculate this limit, we consider any sequence (hn)n in {0} which converges towards 0. For all n with f(x~)hn+δf(hn)=0 , there is δg(0)=0 so δg(f(x~)hn+δf(hn))hn=0.

If only there are finally many n with δg(f(x~)hn+δf(hn))hn0, then we have limnδg(f(x~)hn+δf(hn))hn=0. So let us consider the case that for infinitely many n there is δg(f(x~)hn+δf(hn))hnis0. Let (hnk)k be the subsequence of elements of (hn)n with δg(f(x~)h+δf(h))0. There is

limkδg(f(x~)hnk+δf(hnk))hnk= limkδg(f(x~)hnk+δf(hnk))f(x~)hnk+δf(hnk)f(x~)hnk+δf(hnk)hnk pull apart the limit= limkδg(f(x~)hnk+δf(hnk))f(x~)hnk+δf(hnk)limkf(x~)hnk+δf(hnk)hnk sincelimkhnk=0 there is limkf(x~)hnk+δf(hnk)=0= limĥ0δg(ĥ)ĥ(limkf(x~)hnkhnk+limkδf(hnk)hnk) limĥ0δg(ĥ)ĥ=0 and limkhnk=0= 0(f(x~)+limh~0δf(h~)h~) limh~0δg(h~)h~=0 = 0(f(x~)+0)= 0

So we have

limh0δg(f(x~)h+δf(h))h=0

Hint

Using the chain rule, we may prove the inverse rule (1f)=ff2 . If we set the "outer function" g(x)=1x, then there is g(x)=1x2. So we have

(1f)(x)=(gf)(x)=g(f(x))f(x)=1f2(x)f(x)=f(x)f2(x)

We used this rule above to derive the quotient rule. That means, the quotient rule can be shown with the chain rule and the product rule at hand. Conversely, we may prove the product rule using the chain rule. For the exercise we recommend our exercise (yet missing).