1 basic calculus - damtp€¦ · 1 basic calculus 1.1 differentiation ... developed a much simpler...

29
Basic calculus Differentiation as a limit 10 1 Basic calculus 1.1 Differentiation as a limit 1.1.1 DEFINITION x x x + h f x f Figure 1: Approximation of slope over finite range of x. Let x x+h x = h f f(x+h) f(x) Define the derivative as ( ) ( ) ( ) 0 0 0 lim lim lim tan "slope" of curve "gradient" of curve h x x df f dx h f x f x f x θ ∆→ ∆→ = = = = = Other notations , , , , , , x x df d f f f f Df dx dx Additionally, especially when f = f(t), the notation f # is often used to represent df/dt.

Upload: ledieu

Post on 02-Apr-2018

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Differentiation as a limit

� 10 �

1 Basic calculus 1.1 Differentiation as a limit 1.1.1 DEFINITION

x x x + h

∆f

∆x

f

Figure 1: Approximation of slope over finite range of x.

Let ∆x ≡ x+h � x = h

∆f ≡ f(x+h) − f(x)

Define the derivative as

( )( )

( )

0

0

0

lim

lim

lim tan

"slope" of curve

"gradient" of curve

h

x

x

df fdx h

fx

f x

f x

θ

∆ →

∆ →

∆⎛ ⎞= ⎜ ⎟⎝ ⎠∆⎛ ⎞= ⎜ ⎟∆⎝ ⎠

=

=

=

Other notations

,, , , , ,x xdf d f f f f Dfdx dx

Additionally, especially when f = f(t), the notation f# is often used to represent df/dt.

Page 2: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Differentiation as a limit

� 11 �

1.1.2 DIFFERENTIABILITY The derivative f′ exists if it is finite and defined.

Must have left- and right-hand limits the same:

( ) ( ) ( ) ( )0 0

lim limh h

f x f x h f x h f xh h→ →

⎛ ⎞ ⎛ ⎞− − + −=⎜ ⎟ ⎜ ⎟

⎝ ⎠ ⎝ ⎠

If f′ exists, then f is said to be differentiable.

If f′ exists, then ∆f → 0 as ∆x → 0 ⇒ f is continous.

Note: Converse is not necessarily true, i.e. continuous f does not necessarily mean f is differentiable.

x

f

Figure 2: A function with a cusp is continuous, but not differentiable at the cusp as left- and right-hand derivatives are not the same.

1.1.3 EXAMPLES f(x) = ax, for a = const

( ) ( )0 0 0

lim lim limh h h

d ax a x h axdf ah a adx dx h h→ → →

+ −= = = = =

Can check that left-hand derivative is equal to right-hand derivative.

f(x) = 1/x2

Page 3: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Rules for differentiating

� 12 �

( ) ( )

( )( )

( )

( )

2 22

0

22

22

0

2

220

220

4

3

1 1

lim

lim

2lim

2lim

2

2

h

h

h

h

xd x x hdfdx dx h

x x hx x h

hxh h

hx x hx h

x x hx

xx

−+

= =

− +

+=

− −=

+

− −=

+

−=

= −

f(x) = xn

( ) ( )

0lim

nn n

h

d x x h xdfdx dx h→

+ −= =

Use binomial expansion

( ) ( )( )

( ) ( )( )

( ) ( )( )

1 2 2 3 3

0

1 2 2 3 3

0

1 2 2 3

0

1

1 1 22! 3!lim

1 1 22! 3!lim

1 1 2lim

2! 3!

n n n n n n

h

n n n n

h

n n n

h

n

n n n n nx nhx h x h x h x

hn n n n n

nhx h x h x h

hn n n n n

nx hx h x

nx

− − −

− − −

− − −

− − −+ + + + + −

=

− − −+ + + +

=

⎛ ⎞− − −= + + +⎜ ⎟

⎝ ⎠=

!

!

!

Also works for n < 0.

1.2 Rules for differentiating 1.2.1 SUMS AND DIFFERENCES Consider y = f(x) + g(x)

Page 4: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Rules for differentiating

� 13 �

( ) ( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

0

0

0 0

lim

lim

lim lim

h

h

h h

f x h g x h f x g xdy d f gdx dx h

f x h f x g x h g xh h

f x h f x g x h g xh h

df dgdx dx

→ →

+ + + − −= + =

⎛ ⎞+ − + −= +⎜ ⎟

⎝ ⎠+ − + −

= +

= +

provided f and g are differentiable.

Similarly ( )d df dgf gdx dx dx

− = − .

f(x) = ex

Exponential function can be defined in a number of ways:

lim 1n

x

n

xen→∞

⎛ ⎞= +⎜ ⎟⎝ ⎠

Can use binomial expansion

( ) ( )( )2 3

2 3

2 3

2

2 3

0

1 1 2lim 1

2! 3!

1 3 2lim 1 1 12! 3!

12! 3!

!

x

n

n

n

n

n n n n nx x xe nn n n

x xxn n n

x xx

xn

→∞

→∞

=

⎛ ⎞− − −= + + + +⎜ ⎟

⎝ ⎠⎛ ⎞⎛ ⎞ ⎛ ⎞= + + − + − + +⎜ ⎟⎜ ⎟ ⎜ ⎟

⎝ ⎠ ⎝ ⎠⎝ ⎠

= + + + +

= ∑

!

!

!

[Should really look at convergence, etc., but not part of this course.]

Differentiate term-by-term:

( )

( )

0

0

1

11

1

0

!

!

!

1 !

!

nx

n

n

n

n

nn

n

n

nx

d d xedx dx n

d xdx n

nxn

xn

xn

e

=

=

−∞

=

−∞

=

=

⎛ ⎞= ⎜ ⎟

⎝ ⎠⎛ ⎞

= ⎜ ⎟⎝ ⎠

=

=−

=

=

Page 5: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Rules for differentiating

� 14 �

since d1/dx = 0

1.2.2 THE CHAIN RULE Consider y = f(g(x)):

( )( ) ( )( )

( )( ) ( )( )( ) ( )

( ) ( )

( ) ( )

( ) ( )

0

0

0

0 0

lim

lim

lim

lim lim

x

x

x

g x

f g x x f g xdydx x

f g x x f g x g x x g xg x x g x x

f g g f g gg x

f g g f g gg x

df dgdg dx

∆ →

∆ →

∆ →

∆ → ∆ →

+ ∆ −=

∆⎛ ⎞+ ∆ − + ∆ −

= ⎜ ⎟⎜ ⎟+ ∆ − ∆⎝ ⎠⎛ ⎞+ ∆ − ∆

= ⎜ ⎟∆ ∆⎝ ⎠⎛ ⎞+ ∆ − ∆⎛ ⎞= ⎜ ⎟ ⎜ ⎟∆ ∆⎝ ⎠⎝ ⎠

=

since ∆g → 0 as ∆x → 0 for g(x) (and hence y) to be continuous.

y = eλx

Write as y = f(g(x)) where f(g) = exp(g) = eg and g(x) = λx.

Now f′(g) = eg and g′(x) = λ,

so g

x

dy df dg edx dg dx

λ

λ

= =

=

y = f(λx)

Similar to above example, yielding ( ) ( )( ) ( )df xd f x f x

dx d xλ

λ λ λ λλ

′= = .

y = eix (i2 = −1)

⇒ ix ixd e iedx

=

So

( )

( )

( )

1cos2

12

12

sin

ix ix

ix ix

ix ix

d dx e edx dx

ie ie

e ei

x

= +

= −

−= −

= −

Page 6: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Rules for differentiating

� 15 �

Similarly

( )

( ) ( )

1sin2

1 12 2

cos

ix ix

ix ix ix ix

d dx e edx dx i

ie ie e ei

x

− −

= −

= + = +

=

End of Lecture 1

1.2.3 PRODUCTS AND QUOTIENTS Consider y = f⋅g:

( ) ( ) ( ) ( ) ( )

( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )

( ) ( ) ( ) ( ) ( )

( ) ( ) ( ) ( ) ( ) ( )

0

0

0

0 0

lim

lim

lim ( )

lim lim

h

h

h

h h

f x h g x h f x g xdy d f gdx dx h

f x h g x h f x h g x f x h g x f x g xh

g x h g x f x h f xf x h g x

h h

g x h g x f x h f xf x g x

h hdg dff gdx dxf g fg

→ →

+ + −= ⋅ =

+ + − + + + −=

⎛ ⎞+ − + −= + +⎜ ⎟

⎝ ⎠+ − + −

= +

= +

′ ′= +

The product rule

y = excosx

Let f(x) = ex ⇒ f′ = ex

and g(x) = cosx ⇒ g′ = −sinx

so dy/dx = f′g + fg′ = ex(cosx − sinx).

Similarly y = f/g:

Page 7: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Rules for differentiating

� 16 �

( )( )

( )( )

( ) ( ) ( ) ( )( ) ( )

( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )( ) ( )

( ) ( ) ( )( ) ( ) ( ) ( ) ( )

( ) ( )

0

0

0

0 0

2

2

lim

lim

lim

lim lim

h

h

h

h h

f x h f xg x h g xdy d f

dx dx g h

f x h g x f x g x hh g x h g x

f x h g x f x g x f x g x h f x g xh g x h g x

f x h f x g x h g xg x f x

h g x h g x h g x h g x

df dgg fdx dx

gf g fg

g

→ →

+−

+⎛ ⎞= =⎜ ⎟

⎝ ⎠+ − +

=+

+ − − + +=

+

⎛ ⎞ ⎛ ⎞+ − + −= −⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟+ +⎝ ⎠ ⎝ ⎠

−=

′ ′−=

The quotient rule

Clearly need g ≠ 0!

1.2.4 HIGHER DERIVATIVES

First derivative ,x xdf f f f Dfdx

′= = = =

Second derivative 2

2, ,2 xx x x

d df d d d ff f f f D fdx dx dx dx dx

′′≡ ≡ = = = =

Third derivative 2 3

3, , ,2 3 xxx x x x

d d f d d d d ff f f f D fdx dx dx dx dx dx

′′′≡ ≡ = = = =

nth derivative ( )1

1

n nn n

n n

d d f d d d d ff f D fdx dx dx dx dx dx

− ≡ ≡ = =!

Derivatives of xn:

1n nd x nxdx

−=

( )2

1 22 1n n nd dx n x n n x

dx dx− −= = −

( ) ( )( )3

2 33 1 1 2n n nd dx n n x n n n x

dx dx− −= − = − −

( ) ( ) ( )!1 1

!

mn n m n m

m

d nx n n n m x xdx n m

− −= − − + =−

!

!n

nn

d x ndx

= for integer n

Page 8: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Rules for differentiating

� 17 �

1

1 0n

nn

d xdx

+

+ =

1.2.5 LEIBNITZ� THEOREM For the nth derivative of a product

Let f = f(x) and g = g(x).

( )d fg f g fgdx

′ ′= +

( ) ( ) ( )2

2

2

d d dfg f g fg f g f g f g fgdx dx dx

f g f g fg

′ ′ ′′ ′ ′ ′ ′ ′′= + = + + +

′′ ′ ′ ′′= + +

( ) ( ) ( ) ( )

( )

3

3 2

23 3

d d d dfg f g f g fgdx dx dx dx

f g f g f g f g f g fgf g f g f g fg

′′ ′ ′ ′′= + +

′′′ ′′ ′ ′′ ′ ′ ′′ ′ ′′ ′′′= + + + + +

′′′ ′′ ′ ′ ′′ ′′′= + + +

which suggests

( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )1 2 112!

nn n n n m m n n

n

nn nd fg f g nf g f g f g nf g fgmdx

− − − −− ⎛ ⎞′ ′′ ′= + + + + + + +⎜ ⎟⎝ ⎠

! !

Can prove by induction. Exercise

• Establish true for n = 1

• Assume true for arbitrary n

• Show true for n+1

In Cambridge we like Newton, but�

Calculus was invented by Sir Isaac Newton and Gottfried Wilhelm Leibniz at around the same time, each claiming to have been first. Leibniz published in 1686 whereas Newton published in 1687, but it appears that Newton actually made the breakthrough some 20 years earlier (1665/66). This led to animosity between them (at least Newton hated Leibniz), and there is/was some suggestion of plagiarism on the part of Leibniz.

Newton�s approach was based on the ideas of limits whereas Leibniz used geometric arguments and developed a much simpler notation, including the d/dx and integral symbols we still use. Newton�s notation was almost incomprehensible, changing it depending on the context (find example), so was difficult to use and understand. (Was this Newton trying to show off?) British mathematicians used Newton�s notation during the 18th century, whereas the rest of the world adopted Leibniz�s notation and made more progress. Some of Newton�s notation, for example x# to represent dx/dt, is still used.

http://www.angelfire.com/md/byme/mathsample.html

Use Leibniz rule for y = xm+n = xm⋅xn:

Page 9: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Rules for differentiating

� 18 �

( )( ) ( )

( )( )( )

2 2

2 2

2 1 1 2

2 2 2

2

1 2 1

2

1

m n m n

m n m n m n

m n

m n

d dx x xdx dx

m m x x mx nx x n n x

m m mn n n x

m n m n x

+

− − − −

+ −

+ −

=

= − + + −

= − + + −

= + + −

as expected.

Second derivative of y = 2sinx cosx:

( ) ( ) ( )2

2 2sin cos 2 sin cos 2cos sin sin cos

8sin cos4sin 2

d x x x x x x x xdx

x xx

⎡ ⎤= − + − + −⎣ ⎦

= −= −

As expected from d2/dx2(sin 2x).

There are a few somewhat more complicated functions on the examples sheet.

1.2.6 PARTIAL DIFFERENTIATION Frequently functions may depend on more than one variable. How do we differentiate these?

Consider f(x,y). This might, for example, represent the height of a hill. In general, the slope will depend on the direction in which we are looking.

Define ( ) ( )0

, ,limh

f x h y f x yfx h→

+ −∂=

∂, the partial derivative of f with respect to x. This is the slope,

at a given x,y in the x direction (i.e. holding y constant).

Similarly ( ) ( )0

, ,limh

f x y h f x yfy h→

+ −∂=

∂. Note the use of ∂ in place of d to represent the derivative.

Other common notations: ,x x xf f f fx

∂∂

∂ and ,y y y

f f f fy

∂∂

∂.

f(x,y) = 1 − x2 � x sin y + y3

Then

( ) ( )( ) ( )

( ) ( )

( ) ( )

2 3 2 3

0

2 2

0 0

0 0

1 sin 1 sinlim

lim sin lim

lim 2 sin lim 1

2 sin

h

h h

h h

x h x h y y x x y yfx h

x h x x h xy

h hx h y

x y

→ →

→ →

− + − + + − − − +∂=

+ − + −= − −

= − − −

= − −

which is the same as df/dx if we treat y as a constant.

Page 10: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Rules for differentiating

� 19 �

Similarly

( ) ( )( ) ( )

( ) ( )

32 2 3

0

3

0 0

2

1 sin 1 sinlim

sin sinlim lim

cos 3

h

h h

x x y h y h x x y yfy h

y h y y h yx

h hx y y

→ →

− − + + + − − − +∂=

+ − + −= − +

= − +

What happens if we wish to move in another direction, say at an angle θ to the x axis? Let s = s(cos θ, sin θ) be a unit vector in this direction, then the slope will be

( ) ( )

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

( ) ( )

0

0

0 0

cos 0 si

cos , sin ,lim

cos , sin , sin , sin ,lim

cos , sin , sin , sin ,lim cos lim sin

cos sincos , ,

lim cos limcos

h

h

h h

h h

f x h y h f x ydfds h

f x h y h f x y h f x y h f x yh

f x h y h f x y h f x y h f x yh h

f x h y f x yhθ

θ θ

θ θ θ θ

θ θ θ θθ θ

θ θθ

θθ

→ →

+ + −=

+ + − + + + −=

+ + − + + −= +

+ −= +

( ) ( )n 0

, sin ,sin

sin

cos sin

f x y h f x yh

f fx y

θ

θθ

θ

θ θ

+ −

∂ ∂= +

∂ ∂

Now since x = s cos θ ⇒ dx/ds = cos θ and y = s sin θ ⇒ dy/ds = sin θ, we may rewrite this as

cos sindf f f f dx f dyds x y x ds y ds

θ θ∂ ∂ ∂ ∂= + = +

∂ ∂ ∂ ∂

We shall not be using the above in this course, although you will require it in other courses.

More generally, we may have a function f that depends on the variables x0, x1, �xn-1, from which we may form the derivatives ∂f/∂xi for i = 0,1,�n−1.

Higher order derivatives are handled in a similar way to functions of a single variable

( ) ( ) ( ) ( )

2, ,

2 0

0 0

0

lim

, , , ,lim lim

lim

x h y x y

h

a a

h

f fx xf

x hf x h a y f x h y f x a y f x y

a ah

+

→ →

∂ ∂−

∂ ∂∂=

∂+ + − + + −

−=

,

but of course we have the possibility of taking the derivatives in different directions.

So long as the limits are well behaved, then

Page 11: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Curve sketching

� 20 �

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

2, ,

0

0 0

0

0 0

0 0

lim

, , , ,lim lim

lim

, , , ,lim lim

, , , ,1lim lim

lim

x h y x y

h

a a

h

h a

a h

a

f fy yf

x y hf x h y a f x h y f x y a f x y

a ah

f x h y a f x h y f x y a f x yah

f x h y a f x y a f x h y f x ya h h

+

→ →

→ →

→ →

∂ ∂−

∂ ∂∂=

∂ ∂

+ + − + + −−

=

⎛ ⎞⎡ ⎤+ + − + − + += ⎜ ⎟⎢ ⎥⎜ ⎟⎣ ⎦⎝ ⎠

⎛ ⎞⎡ ⎤+ + − + + −= −⎜ ⎟⎢ ⎥⎜ ⎟⎣ ⎦⎝ ⎠

= , ,

0

2

x y a x y

f fx x

af

y x

+

∂ ∂−

∂ ∂

∂=

∂ ∂

f(x,y) = 1 − x2 � x sin y + y3

2 sinf x yx

∂= − −

∂ ⇒ ( )

2

2 sin cosf f x y yy x y x y

∂ ∂ ∂ ∂= = − − = −

∂ ∂ ∂ ∂ ∂

2cos 3f x y yy

∂= − +

∂⇒ ( )

22cos 3 cosf f x y y y

x y x y x∂ ∂ ∂ ∂

= = − + = −∂ ∂ ∂ ∂ ∂

Other courses will require partial differentiation more than is the case for this course.

1.3 Curve sketching Knowing the stationary points of a function f(x) can help you sketch the function. Stationary points are where df/dx = 0 and the curve is horizontal.

Suppose df/dx = 0 at x = x0. Four possible cases:

x

f

x0

x

f

x0

(a) (b)

Page 12: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Curve sketching

� 21 �

x

f

x0

x

f

x0

(c) (d)

(a) df/dx > 0 for x < x0 and df/dx < 0 for x > x0 ⇒ local maximum; d2f/dx2 < 0.

(b) df/dx < 0 for x < x0 and df/dx > 0 for x > x0 ⇒ local minimum; d2f/dx2 > 0.

(c) df/dx > 0 for x < x0 and df/dx > 0 for x > x0 ⇒ point of inflection; d2f/dx2 = 0.

(d) df/dx < 0 for x < x0 and df/dx < 0 for x > x0 ⇒ point of inflection; d2f/dx2 = 0.

Note: A point of inflection is where d2f/dx2 = 0 irrespective of the value of df/dx (provided d3f/dx3 ≠ 0).

End of Lecture 2 More generally, if d(n)f/dx(n) = 0 at x = x0 ∀ n < m and d(m)f/dx(m) ≠ 0 then x0 is a turning point if m is even, or a point of inflection if m is odd. Further, if m is even, then x0 is a local maximum if d(m)f/dx(m) < 0 or a local minimum if d(m)f/dx(m) > 0.

f(x) = sinx

f(x) = 0 at x = nπ

df/dx = cosx = 0 at x = (n+ ½)π → turning points

d2f/dx2 = −sinx = 0 at x = nπ → inflection points where f = 0.

x

f

π 2π 3π 4π

Local maximum

Local minimum

Points of inflection

Page 13: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Curve sketching

� 22 �

f(x) = x3 + 2x2 + x + 1

As x → ±∞, have f → x3

At x = 0, f = 1

df/dx = 3x2 +4 x + 1 = (3x + 1)(x + 1) = 0 at x = −1 and x = −1/3.

d2f/dx2 = 6x+4. At x = −1, d2f/dx2 = −2 ⇒ maximum, f = 1.

At x = −1/3, d2f/dx2 = 2 ⇒ minimum, f = 23/27.

Point of inflection at d2f/dx2 = 6x+4 = 0 ⇒ x = −2/3 ⇒ f = 25/27

x

f

1

-1/3-2/3-1

1.3.1 ROLLE�S THEOREM Let f(x) be a function such that

• f(x) is continuous in x ∈ [a,b]

• f(x) is differentiable in x ∈ (a,b)

• f(a) = f(b)

then there exists at least one point x = x0 ∈ (a,b) such that f′(x0) = 0.

Proved in Part IB Analysis course, but intuitively obvious:

Page 14: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Curve sketching

� 23 �

x

f

a b x0

Consider ϕ = f(x) − f(a) [giving ϕ = 0 at x=a,b]

Either ϕ = 0 everywhere in [a,b], in which case ϕ′ = 0 in (a,b)

or ϕ > 0 somewhere or ϕ < 0 somewhere.

If ϕ > 0 somewhere then ϕ′ > 0 in some places and ϕ′ < 0 in some places as ϕ must be continuous and differentiable. Hence ϕ′ passes through zero at some point and ϕ must have a (locally) greatest value at the point.

Note that if f(x) is continuous but not differentiable, then it must still have either a local maximum, a local minimum or be constant. The extremum may occur at a point where f′ = 0 or at a point where f′ is not defined (e.g. at a cusp).

1.3.2 MEAN VALUE THEOREM Let f(x) be continuous in [a,b] and differentiable in (a,b), then ∃ x0 in (a,b) for which

( ) ( ) ( )0

f b f af x

b a−

′ =−

.

Page 15: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Curve sketching

� 24 �

x

f

a b x0

This is simply Rolle�s theorem relative to the line ( ) ( ) ( ) ( )f b f ay f a x a

b a−

= + −−

.

Define new function ( ) ( ) ( )( ) ( )( )f a b x f b x ax f x f y

b aϕ

− + −= − = −

− which has ϕ(a) = ϕ(b) = 0

and apply Rolle�s theorem.

1.3.3 CAUCHY�S FORMULA Consider two functions f(x) and g(x) which satisfy the conditions of the mean value theorem (i.e. continuous in [a,b] and differentiable in (a,b)), and suppose g′(x) ≠ 0 everywhere in (a,b).

Then, ∃ x0 in (a,b) such that ( )( )

( ) ( )( ) ( )

0

0

f x f b f ag x g b g a

′ −=

′ −.

[Note that since g′ ≠ 0, then g(b) ≠ g(a).]

Proof: Define ( ) ( ) ( ) ( )( ) ( ) ( )f b f a

x f x g xg b g a

ϕ−

= −−

(so that ( ) ( ) ( ) ( ) ( ) ( )( ) ( )

f a g b f b g aa b

g b g aϕ ϕ

−= =

−),

and apply Rolle�s theorem shows that ( ) ( ) ( ) ( )( ) ( ) ( )f b f a

x f x g xg b g a

ϕ−

′ ′ ′= −−

must vanish for some

x = x0, thus proving the result.

Note that cannot apply mean value theorem separately to f and g then divide as the corresponding x0 will not generally be the same.

Corollary 1

Suppose f(0) = 0 and g(0) = 0,

then ( )( )

( ) ( )( ) ( )

( )( )

00

f x f x f f xg x g x g g x

αα

′−= =

′− for some 0 < α < 1.

Page 16: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Taylor series

� 25 �

Corollary 2

If f(x0) = 0 and g(x0) = 0, then ( )( )

( )( )0

0

0

limx x

f x f xg x g x→

′=

′. l�Hôpital�s rule. (Sometimes spelt as

l�Hospital�s rule; the two are equivalent in Old French.)

1.4 Taylor series Useful to represent some function f(x) as a linear combination (sum) of simpler functions. Particularly important in computing, but also when dealing with more complex functions.

In some cases we might be happy to approximate the function in x ∈ [a,b] rather than represent it accurately.

• f(x) ~ ψ0(x) ≡ c0

◊ Can select c0 so that f(a) = ψ0(a).

• f(x) ~ ψ1(x) ≡ c0 + c1(x-a)

◊ Could use linear interpolation to have ( ) ( ) ( ) ( ) ( )1

f b f ax f a x a

b aψ

−= + −

−, which will give

f(x) = ψ1(x) at x = a and x = b.

◊ Using the ideas from the mean value theorem (§1.3.2) we may rewrite this as ( ) ( ) ( )( )1 0x f a f x x aψ ′= + − , for some x0.

◊ Often more convenient to have function and derivative at same location, using ( ) ( ) ( )( )*

1 x f a f a x aψ ′= + − . This will give f(a) = ψ1(a), but in general f(b) ≠ ψ1(b). We will, however, have f′(a) = ψ′1(a).

• f(x) ~ ψ2(x) ≡ c0 + c1(x−a) + c2(x−a)2

◊ We can apply the mean value theorem to the first derivative, ( ) ( ) ( )1

f b f af x

b a′ ′−

′′ =−

for

some x1, and thus ( ) ( ) ( )( ) ( )( )22 0 1x f a f x x a f x x aψ ′ ′′= + − + − .

More convenient to have all derivatives at the same place, with the approximation improving with the more derivatives that are matched.

Recall from §1.2.4 that

1n nd x nxdx

−=

( )2

1 22 1n n nd dx n x n n x

dx dx− −= = −

( ) ( )( )3

2 33 1 1 2n n nd dx n n x n n n x

dx dx− −= − = − −

( ) ( ) ( )!1 1

!

mn n m n m

m

d nx n n n m x xdx n m

− −= − − + =−

!

Page 17: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Taylor series

� 26 �

!n

nn

d x ndx

= for integer n

and that xn, dxn/dx, d2xn/dx2, � d(n−1)xn/dx(n−1) all vanish at x = 0.

Similarly, (x−x0)n and its first n−1 derivatives all vanish at x = x0.

1.4.1 TAYLOR�S THEOREM

Consider ( ) ( ) ( )( ) ( )( ) ( ) ( )( )20 0 0 0 0 0 0

1 12! !

nnx f x f x x x f x x x f x x xn

ϕ ′ ′′≡ + − + − + + −!

[we assume f(n) exists]

Note that for any m ≤ n, this definition gives ϕ(m)(x0) = f(m)(x0) since ( )01 ! 1

! !

mm

m

d mx xm dx m

− = =

Define the remainder Rn(x;x0) such that f(x) = ϕ(x) + Rn(x;x0).

This is generally called Taylor�s theorem, but is actually a tautology. Its usefulness is in ignoring Rn if Rn is small, and thus approximating f(x) with just ϕ(x).

The remainder Rn(x;x0) may be considered the error in the approximation f(x) ≈ ϕ(x), when ϕ(x) contains all derivatives up to and including the nth at the point x0.

For smooth functions, Rn is small if x − x0 is sufficiently small.

1.4.2 LAGRANGE ESTIMATE OF REMAINDER There are several ways of estimating Rn. One of the more useful is Lagrange�s estimate:

( ) ( )( )

( ) ( )( )1

100 0;

1 !

nn

n

x xR x x f x x x

++−

= + −+

,

where θ ∈ [0,1]. The residual is equal to the next term in the series with the f(n+1) derivative evaluated at some point between x and x0.

This estimate comes from repeated application of Corollary 1 of Cauchy�s formula to ( )

( ) ( )( ) ( )

( ) ( )0

1 10 0

;

1 ! 1 !n

n n

R x x f x x

x x n x x n

ϕ+ +

−=

− + − +, noting that ϕ(n+1) = 0.

Let h = x − x0 so that ( ) ( )( ) ( )

( ) ( )( )

0 01 1

01 !1 !n n

f x h x hf x xh nx x n

ϕϕ+ +

+ − +−=

+− +

and define Rn(x,x0) = ψ(h) = f(x0+h) − ϕ(x0+h) and χ(h) = hn+1/(n+1)!

Now ψ(0)= f(x0) − ϕ(x0) = 0 χ(0) = 0 ψ′(0) = f′(x0) − ϕ′(x0) = 0 χ′(0) = 0 � � ψ(n)(0) = 0 χ(n)(0) ψ(n+1)(0) = f(n+1)(x0) and χ(n+1)(h) = 1 ∀ h. since ϕ(n+1)(x) = 0.

Cauchy�s formula gives

Page 18: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Taylor series

� 27 �

( )( )

( ) ( )( ) ( )

( )( )

1

1

00

h h hh h h

ψ ψ ψ ψχ χ χ χ

′−= =

′− where 0 < h1 < h

but ( )( )

( ) ( )( ) ( )

( )( )

1 1 2

1 1 2

00

h h hh h h

ψ ψ ψ ψχ χ χ χ

′ ′ ′′−= =

′ ′ ′′− where 0 < h2 < h1 < h

⇒ ( )( )

( )( )

( )( )

( ) ( )( ) ( )

( ) ( )11

1 0 11 21

1 2 1 1

nnn n

nn

h f x hh h hh h h h

ψψ ψ ψχ χ χ χ

+++ +

++

′ ′′ += = = = =

′ ′′! 0 < hn+1 < hn < ⋅⋅⋅ < h2 < h1 < h

whence ( ) ( ) ( )( ) ( ) ( )

( )( ) ( )

111 10

0 0 0;1 ! 1 !

nnn n

n n

x xhR x x h f x h f x hn n

ψ θ++

+ +−= = + = +

+ + with 0 < θ < 1.

QED.

1.4.3 TAYLOR SERIES EXAMPLES If all the derivatives of f exist and are finite, then one can take the limit n → ∞.

( ) ( ) ( )( )0 00

1!

nn

nf x f x x x

n

=

= −∑

This will provide an accurate representation of f(x) in the neighbourhood of x0 provided Rn(x;x0) → 0 as n → ∞. [This is a necessary but not sufficient condition for the summation to converge.] For some functions, convergence is achieved for any value of x, while for others, x may need to be very close to x0.

f(x) = ex

f′ = ex, ⋅⋅⋅, f(n) = ex.

Expand about x = 0 [f and all its derivatives are unity at x = 0].

⇒ ( )

2 3 1

12! 3! ! 1 !

n nx xx x x xe x e

n nθ

+

= + + + + + ++

!

Note that for ex the series converges for all x in limit n → ∞

• Mclaren series

f(x) = sin x

f = sin x = 0 at x = 0,

f′ = cos x = 1 at x = 0,

f″ = −sin x = 0 at x = 0,

f′″ = −cos x = −1 at x = 0,

⋅⋅⋅

⇒ 3 5

sin3! 5!x xx x= − + −!

Page 19: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Integration: fundamentals

� 28 �

[Can also derive from ( )1sin2

ix ixx e ei

−= − using expansion for ex]

f(x) = cos x

⋅⋅⋅

⇒ 2 4

cos 12! 4!x xx = − + −!

( ) 21/ xf x e−=

f(0) = 0 ( ) 2 21/

00 lim lim 0x y

x yf e e− −

→ →±∞= = =

f′(0) = 0 ( )

( )

2 2 2

2

1/ 1/ 1/

3 5 70 0 0

1/

2 10

2 4 80 lim lim lim3 15

2lim1 3 2 1

x x x

x x x

n x

nx

e e efx x x

en x

− − −

→ → →

+→

′ = = =

=× × × −!

f″(0) = 0

which suggests f(x) = Σ 0×xn = 0

This only works asymptotically close to x = 0.

1.5 Integration: fundamentals 1.5.1 INTEGRATION AS SUM OF AREAS

x

f

a =x0

b = xn

x1 x2 xn-1

h

�dxr� = xr − xr-1 = h, and nh = b − a.

Can approximate area as trapezoids passing through fn = f(xn):

Page 20: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Integration: fundamentals

� 29 �

( ) ( ) ( )1 1 11 0 1 2 12 2 2

1

b n

r r n nra

f x dx f f h f f f f f h+ −=

≈ + = + + + + +∑∫ !

This approximation is frequently referred to as the Trapezium Rule and may be used to estimate the integral, for example in a computer code. There are, however, better ways.

If we let h → 0 (n → ∞)

( ) ( )

( )

1120 1

1 10 1 2 12 20

lim

lim

b n

r rh ra

n nh

f x dx f f h

f f f f f h

+→=

−→

= +

= + + + + +

∑∫!

Since ( )1020

lim 0nhf f h

→+ = , then can rewrite

( ) ( )0 1 2 10 0lim lim

b

n n i ih h ia

f x dx f f f f f h f dx f dx−→ →= + + + + + = ≡∑∫ ∫!

It is obvious that

( ) ( ) ( )b c b

a a c

f x dx f x dx f x dx= +∫ ∫ ∫

and ( ) ( ) ( ) ( )b b b

a a a

f x dx g x dx f x g x dx⎡ ⎤+ = +⎣ ⎦∫ ∫ ∫

f(x) = x

( )11 2 20

0

lim 0X

n nhx dx h x x x x

→= + + + + −∫ ! , where xi = ih and n = X/h.

( )( )( )

2 120

2 120

2 212021

2

lim 0 1 2 1

1lim

2

lim

h

h

h

h n n n

n nh n

n h

X

= + + + + − + −

⎛ ⎞+= −⎜ ⎟

⎝ ⎠=

=

!

Note that ( )212

d X XdX

= , which anticipates that integration is the inverse of differentiation.

f(x) = ex

( )

( ) ( )( )1 20

00

2

0

lim

lim 1

n

Xxx xx

h

nh h h

h

e dx h e e e e

h e e e

= + + + +

= + + + +

∫ !

!

= +½ xn

Page 21: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Integration: fundamentals

� 30 �

Recall that for a geometric series ( )2 11

; 11

nn

a ra ar ar ar r

r−

−+ + + + = ≠

−! , so

( )

( )

1

00

0

00

1lim

1

1lim1

1 lim

1

nhXx

hh

X h

hh

Xhh

X

ee dx h

e

e ehe

hee e

e

+

−=

−=

= −−

= −

noting eXeh → eX and eh−1 → h as h → 0

Further on examples sheet.

End of Lecture 3

1.5.2 FIRST MEAN-VALUE THEOREM FOR INTEGRALS If m ≤ f(x) ≤ M in (a,b)

then ( ) ( ) ( )b

a

b a m f x dx b a M− ≤ ≤ −∫

Corollary

If f(x) is continuous in (a,b) then ∃ c: a < c < b such that

( ) ( ) ( )b

a

f x dx b a f c= −∫

Page 22: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Fundamental theorem of calculus

� 31 �

x

f

a b

M

m

c

1.6 Fundamental theorem of calculus

If f(x) is continuous in (a,x), and if ( ) ( )x

a

F x f t dt= ∫ , then ( )dF f xdx

= .

Proof: ( ) ( ) ( )0 0

1lim limx h

h hx

F x h F xf t dt

h h

+

→ →

+ −= ∫

More rigorously:

First mean value theorem for integrals gives

( ) ( ) ( ) ( )x h

x

F x h F x f t dt hf x hθ+

+ − = = +∫ , where 0 < θ < 1

giving ( ) ( )x h

x

f t dt hf x+

→∫ as h → 0.

Thus ( ) ( ) ( ) ( ) ( )1 x h

x

F x h F xf t dt f x h f x

h hθ

++ −= = + →∫ , QED.

The function F whose derivative is f(x) is called a primitive of f. Note that f will have more than one primitive: if F is a primitive, so is F + const.

The primitive is often called the indefinite integral and is written as

( )x

f t dt∫ or more simply as ( )f x dx∫

because changing the lower limit of integration simply adds a constant.

The definite integral specifies both limits:

Page 23: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Toolkit for basic integration

� 32 �

( ) ( ) ( ) ( )b b

b b

a aa a

dFf dx dx F b F a F x F xdx

⎡ ⎤= = − ≡ ≡ ⎣ ⎦∫ ∫

( )

( )

( ) ( )

0 1 20

10 1

11

0

lim

lim

b

nha

nk k

h kn

k kk

n

f dx h f f f f

F Fhh

F F

F FF b F a

→=

−=

= + + +

−=

= −

= −

= −

!

1.7 Toolkit for basic integration Differentiation Integration

1n nd x nxdx

−= 111

n nx dx xn

+=+∫ ; n ≠ −1

sin cosd x xdx

= cos sinx dx x=∫

cos sind x xdx

= − sin cosx dx x= −∫

x xd e edx

= x xe dx e=∫

2tan secd x xdx

= 2sec tanx dx x=∫

sinh coshd x xdx

= cosh sinhx dx x=∫

What about integral of x−1?

Consider binomial expansion, 2 31 11

x x xx

= − + − ++

! (only converges for x ∈ (−1,1])

Integrate this term-by-term

( ) ( )

2 3

2 3 4

1 11

2 3 4ln 1 log 1e

dx x x x dxx

x x xx

x x

= − + − ++

= − + − +

= + = +

∫ ∫ !

! (only converges for x ∈ (−1,1])

More generally, the definition of the natural logarithm gives 0

1lnx

x dtt

= ∫ for x > 0, hence

1lnd xdx x

= .

Page 24: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Integration of more complex functions

� 33 �

1.8 Integration of more complex functions In general we shall encounter more complex functions than those listed in §1.7, so we need to know how to deal with them. The main approach is to transform an integral into a form you can recognise and know the integral of.

There are some standard techniques you should know, and often more than one way of solving the problem. Knowing the best approach is largely a matter of practice.

1.8.1 INTEGRATION BY PARTS Useful approach when the integrand is the product of recognisable functions.

[ ]b b

b

aa a

dg dff dx fg g dxdx dx

= −∫ ∫ or fg dx fg f g dx const′ ′= − +∫ ∫

Proof (obvious from differentiation (fg)′ = f′g + fg′):

( ) [ ]b b

b

aa a

dg df df g dx fg dx fgdx dx dx

⎛ ⎞+ = =⎜ ⎟⎝ ⎠∫ ∫ , by fundamental theorem.

cosx x dx∫

Let f = x and g′ = cos x ⇒ f′ = 1 and g = sin x

cos sin sin sin cosx x dx x x x dx x x x const= − = + +∫ ∫

Note: if we had selected f = cos x and g′ = x, then integration by parts would have given 2 21 1

2 2cos cos sinx x dx x x x x dx= +∫ ∫ , which is a more complex form.

cosnnI x x dx≡ ∫

Need to apply integration by parts repeatedly.

( ) ( )( ) ( )

1

2 2

22

cos sin sin

sin 1 cos 1 cos

sin 1 cos 1

n n nn

n n n

n nn

I x x dx x x nx x dx

x x n n x x n n x x dx

x x n n x x n n I

− −

−−

≡ = −

= + − − −

= + − − −

∫ ∫∫

Have recurrence relation for In. Need to know 0 cos sinI x dx x≡ =∫ (for In with n even) and

1 cos sin cosI x x dx x x x= = +∫ (for n odd) from earlier example.

Note that as In is an indefinite integral, then there is also an arbitrary constant.

1.8.2 INTEGRATION BY SUBSTITUTION

When integrating ( )f x dx∫ , suppose we choose to express x as a function of some other variable

s, i.e., x = x(s) and consider ( )( )f x s dx∫ . Now dxdx dsds

= , so

( )( ) dxf x s dx f dsds

=∫ ∫

Page 25: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Integration of more complex functions

� 34 �

This is desirable if the new integrand, dxfds

is a simpler function of s which we know how to

integrate.

( )nI x a dx= +∫

Suppose x + a = s ⇔ x = s − a

Then dx = (dx/ds) ds = ds

( ) ( ) 111 11 1

n nn nI x a dx s ds s const x a constn n

++= + = = + = + ++ +∫ ∫

In this (trivial) example, the substitution effectively translated the x axis.

If dealing with a definite integral, then need to remember to transform the limits:

( ) ( ) ( )11 1

00 0

1111 0

1 11 1

x ax x ann nn n

x ax x a

x a dx s ds s x a x an n

+++++

++

⎡ ⎤ ⎡ ⎤+ = = = + − +⎢ ⎥ ⎣ ⎦+ +⎣ ⎦∫ ∫

2

11

I dxx

=−

This only makes sense (with real arithmetic) when |x| ≤ 1.

Noting that cos2θ + sin2θ = 1 suggests the substitution x = sin θ ⇒ dx = cos θ dθ

hence 1

2 2 2

1 cos cos sin1 1 sin cos

dx d d xx

θ θθ θ θθ θ

−= = = =− −

∫ ∫ ∫

(omitting the arbitrary constant)

Common substitutions

1 − sin2θ = cos2θ 1 − x2 → x = sin θ if |x| < 1 better than using x = cos θ since dx/ds > 0 in (0,π/2)

1 + tan2θ = sec2θ 1 + x2 → x = tan θ no limit on x

1 − tanh2θ = sech2θ 1 − x2 → x = tanhθ

cosh2θ − 1 = sinh2θ x2 − 1 → x = coshθ

1 + sinh2θ = cosh2θ x2 + 1 → x = sinhθ

These combinations often arise from Cartesian geometry as a consequence of the theorem of Pythagoras.

21dxI

x=

+∫

We could use x = tanθ or x = sinhϕ.

Option 1: Let x = tanθ ⇒ dx = sec2θ dθ

Page 26: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Differentiation under integrals

� 35 �

⇒ 2 2

12 2 2

sec sec tan1 1 tan sec

dxI d d xx

θ θθ θ θθ θ

−= = = = =+ +∫ ∫ ∫

Option 2: Let x = sinhϕ ⇒ dx = coshϕ dϕ

⇒ 22 2 2

cosh cosh 1 tanh1 1 sinh cosh cosh

dx dI d d dx

ϕ ϕ ϕϕ ϕ ϕ ϕϕ ϕ ϕ

= = = = = −+ +∫ ∫ ∫ ∫ ∫

Obviously we need to do some further manipulations.

Now let tanh ϕ = sin ξ ⇒ sech2ϕ dϕ = cos ξ dξ ⇒ 2cosh cosd dϕ ϕ ξ ξ=

Note that tanh ϕ = sin ξ ⇒ sinh2ϕ = cosh2ϕ sin2ξ ⇒ 1 − cosh2ϕ = cosh2ϕ sin2ξ ⇒

cosh2ϕ (1−sin2ξ) = 1 ⇒ cosh2ϕ cos2ξ = 1 ⇒ 22

1cosh cos coscos cos

dd d d ξϕ ϕ ξ ξ ξ ξξ ξ

= = =

22

2

1 1 1

2 2

1 sin cos1 tanh1 cos cos

sinhsin tanh sin sin1 sinh 1

dxI d d dx

xx

ξ ξϕ ϕ ξ ξξ ξ

ϕξ ϕϕ

− − −

−= = − = =

+

= = = =+ +

∫ ∫ ∫ ∫

Two different answers� Or are they?

1 1 1 1 12 2 2 2

tan sinsin sin sin sin sin tan1 1 tan cos sin

x xx

θ θξ θ θθ θ θ

− − − − −= = = = = =+ + +

⇒ They are the same!

1.9 Differentiation under integrals

Consider the definite integral ( ) ( ),b

a

F x f t x dt= ∫ that depends on a parameter x.

Now, in the case when the limits a and b do not depend on x, then

( ) ( )

( ) ( )

0

0

1lim , ,

1lim , ,

b b

ha a

b

ha

b

a

dF f t x h dt f t x dtdx h

f t x h f t x dth

f dtx

⎡ ⎤= + −⎢ ⎥

⎣ ⎦

⎡ ⎤= + −⎣ ⎦

∂=

∫ ∫

from our definition of the partial derivative in §1.2.6.

( )0

sin tF x x dtx

π

= ∫

Integrate ( ) 2 2 2

00

0sin cos cos cos 1 cost tF x x dt x x xx x x x x

ππ π π⎡ ⎤ ⎛ ⎞ ⎛ ⎞= = − = − − = −⎜ ⎟ ⎜ ⎟⎢ ⎥⎣ ⎦ ⎝ ⎠ ⎝ ⎠∫

Page 27: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Differentiation under integrals

� 36 �

then differentiate

2 221 cos 2 1 cos sin

2 1 cos sin

dF d x x xdx dx x x x x

xx x

π π π π

π ππ

⎡ ⎤⎛ ⎞ ⎛ ⎞ ⎛ ⎞= − = − + −⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎢ ⎥⎝ ⎠ ⎝ ⎠ ⎝ ⎠⎣ ⎦⎛ ⎞= − −⎜ ⎟⎝ ⎠

Alternatively, differentiate then integrate:

20 0

0

0 0

0

sin sin cos

sin cos

cos sin sin

cos sin cos

2 1 cos sin

dF t t t tx dt x dtdx x x x x x

t t t dtx x x

t t tx t dtx x x

t t tx t xx x x

xx x

π π

π

π π

π

π ππ

∂ ⎛ ⎞ ⎛ ⎞= = + −⎜ ⎟ ⎜ ⎟∂ ⎝ ⎠ ⎝ ⎠

= −

⎡ ⎤= − − +⎢ ⎥⎣ ⎦

⎡ ⎤= − − −⎢ ⎥⎣ ⎦

⎛ ⎞= − −⎜ ⎟⎝ ⎠

∫ ∫

These are the same! QED.

If a = a(x) and b = b(x), then let ( ) ( )0

� , ,T

F x T f t x dt= ∫ so we may write

( ) ( )( ) ( )( ) ( )( )

( )� �, , ,

b x

a x

F x F x b x F x a x f t x dt= − = ∫

Applying the chain rule

( )( ) ( )( )( ) ( ) ( )

( )

( )

( ) ( )

� �, ,� �, ,

, ,b x

a x

dF F F da F dbdx x a dx b dx

F x a F x bda dbF x b x F x a xx a dx b dx

f da dbdt f x a f x bx dx dx

∂ ∂ ∂= + +

∂ ∂ ∂∂ ∂∂

= − − +∂ ∂ ∂

∂= − +

∂∫

.

( ) ( )2

2x

x

F x x t dt= −∫

Integrate: ( ) ( ) ( ) ( )22

2 3 331 1 13 3

xx

xx

F x x t dt t x x x⎡ ⎤= − = − = −⎢ ⎥⎣ ⎦∫

then differentiate ( ) ( ) ( )

( ) ( )

3 3 23 2 3

22

1 1 1 13

1 2 1

dF d x x x x x xdx dx

x x x

⎡ ⎤= − = − + −⎢ ⎥⎣ ⎦

= − −

Page 28: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Multiple integrals

� 37 �

Differentiating then integrating

( ) ( ) ( )

( ) ( ) ( )

( ) ( )

( ) ( )( ) ( )

2

2

2

2

22 2 2

22 2

2 23

22 3

22

2 2

2 1

1 2 1

1 2 1

x

t x t xx

x

x

x

x

dF dx dxx t dt x t x tdx x dx dx

x t dt x x x x x

x t x x

x x x x

x x x

= =

∂= − − − + −

= − − − + −

⎡ ⎤= − − + −⎣ ⎦

= − − + −

= − −

1.10 Multiple integrals 1.10.1 INTEGRATION OVER A RECTANGLE We frequently want to integrate functions of more than one variable. For example, if h(x,y) is the height of a pile of grain in the region a ≤ x ≤ b, c ≤ y ≤ d, we may wish to know the volume V of grain.

( ),b d

a c

V h x y dy dx⎡ ⎤

= ⎢ ⎥⎣ ⎦

∫ ∫

If c and d are independent of x then this is the same as

( ),d b

c a

V h x y dx dy⎡ ⎤

= ⎢ ⎥⎣ ⎦

∫ ∫

This equivalence is sometimes referred to as Fubini�s theorem for a rectangle. Proof can be constructed in a number of ways, but is obvious by noting that integration is the limit of summation and ( ) ( ), ,i j i j

i j j ih x y h x y=∑∑ ∑∑ .

We may also write the above repeated integrals as a double integral

( ) ( ) ( ), , ,b d d b

a c c a A

V h x y dy dx h x y dx dy h x y dA⎡ ⎤ ⎡ ⎤

= = =⎢ ⎥ ⎢ ⎥⎣ ⎦ ⎣ ⎦

∫ ∫ ∫ ∫ ∫∫

where A is the area a ≤ x ≤ b, c ≤ y ≤ d, and dA here is dx dy.

Note that the above integrals will often not be written with the square brackets and may be written in a number of different but equivalent ways. For example

( ) ( ) ( ), , ,b d b d b d

a c a c a c

h x y dy dx h x y dy dx dx dy h x y⎡ ⎤

= =⎢ ⎥⎣ ⎦

∫ ∫ ∫ ∫ ∫ ∫

1.10.2 INTEGRATION IN A GENERAL REGION Of course, the region over which we wish to integrate a function will not in general be rectangular. If we know that the area A of interest falls within a ≤ x ≤ b and that c(x) ≤ y ≤ d(x), then

Page 29: 1 Basic calculus - DAMTP€¦ · 1 Basic calculus 1.1 Differentiation ... developed a much simpler notation, including the d/dx and integral symbols we still use. ... yh y y h y x

Basic calculus Special functions

� 38 �

( ) ( )( )

( )

, ,d xb

A a c x

V h x y dA h x y dy dx⎡ ⎤

= = ⎢ ⎥⎢ ⎥⎣ ⎦

∫∫ ∫ ∫

Alternatively if we knew that y was in the range [c,d] and in this range we had a(y) ≤ x ≤ b(y), then

( ) ( )( )

( )

, ,b yd

A c a y

V h x y dA h x y dx dy⎡ ⎤

= = ⎢ ⎥⎢ ⎥⎣ ⎦

∫∫ ∫ ∫

Integrate f(x,y) = x2 + y2 in the triangle bounded by the lines x = 0, y = 0 and x + y = 1.

Can express area as 0 ≤ x ≤ 1 with 0 ≤ y ≤ 1 − x, so 1 1

2 2 2 2

0 01 1

12 3 2 313 0

0 01

2 3 4

0

1 423 3

1 1 2 1 13 2 3 3 6

x

A

x

V x y dA x y dy dx

x y y dx x x x dx

x x x x

= + = +

⎡ ⎤= + = − + −⎣ ⎦

⎡ ⎤= − + − =⎢ ⎥⎣ ⎦

∫∫ ∫ ∫

∫ ∫

Alternatively, can express area as 0 ≤ y ≤ 1 with 0 ≤ x ≤ 1 − y, which yields the same result.

1.10.3 INTEGRATION OF FUNCTIONS OF MORE VARIABLES The ideas for double integration and repeated integration may, of course, be extended further to integrate over three or more variables.

1.11 Special functions 1.11.1 HEAVISIDE STEP FUNCTION

( )0 0? 01 0

xH x x

x

<⎧⎪= =⎨⎪ >⎩

1.11.2 DIRAC DELTA FUNCTION Limit of off-on-off as width tends to zero.

( )0 0

00 0

xx x

<⎧⎪= ∞ =⎨⎪ >⎩

; ( ) ( )0

0

1x dx x dxδ δ+

−∞

= =∫ ∫

( ) dHxdx

δ = ; ( ) ( )x

H x t dtδ−∞

= ∫

End of Lecture 4