Вы находитесь на странице: 1из 57

Integration

1 Antiderivatives
Consider the function f (x) = 3x2 . Suppose that instead of finding the derivative of f we wish
to find a function F , which when differentiated yields f , i.e. we seek a function F such that
F 0 (x) = 3x2 .
It is fairly easy to see that F (x) = x3 will do. We shall then say that F is an antiderivative
of f .

Antiderivative
Definition 1.1 If f is a given function, then F is an antiderivative of f provided that F 0 (x) =
f (x).

Note that we have said “an antiderivative” not “the antiderivative”. The reason is that a
function may have many antiderivatives. For example consider again f (x) = 3x2 . We have
seen that F (x) = x3 is one antiderivative, since F 0 (x) = f (x). Equally well, so are
17
G(x) = x3 + 1, H(x) = x3 −
26739
etc., since they also give 3x2 when differentiated. Indeed it is plain that
K(x) = x3 + C
where C is any constant is an antiderivative of f .

Theorem 1.2 If F (x) is an antiderivative of f (x), then so is F (x) + C, for any constant C.

Proof. We know F 0 (x) = f (x). Then


d d d
[F (x) + C] = F (x) + C = F 0 (x) + 0 = f (x).
dx dx dx

Example 1.1

Find antiderivatives for:


(a) 4x3 (b) x2 + 1 (c) x4 + x3 + x (d) 3 sin 3x.

Solution

We must find functions which when differentiated yield the above.


(a) It is fairly obvious that x4 + C will do for any constant C.
(b) It is not hard to see that x3 /3 + x + C will suffice.
(c) Again we take x5 /5 + x4 /4 + x2 /2 + C.
(d) Clearly − cos 3x + C will do.

We have seen that any function K(x) = x3 + C is an antiderivative of 3x2 . Now we are
entitled to ask, “Are there any more antiderivatives?” Could there be some other strange
function, not of the form K(x) = x3 + C, which when differentiated also gives 3x2 ?
The answer is that there is not. A rigorous proof of this depends on the following two
results, the first of which we shall not prove here, as it would take us too far afield.

1
Rolle’s Theorem
Theorem 1.3 (Rolle’s Theorem) . Suppose a < b and f is continuous on [a, b] and differ-
entiable on (a, b) and that f (a) = f (b). Then there exists a point ξ ∈ (a, b) such that

f 0 (ξ) = 0.

This has a very simple geometric interpretation.

..
.....................
..
..
... f (x)
..
..
..
..
..
..
..
a ξ b

Figure 1.1

The Theorem says that in Figure 1.1, there must exist a point ξ, at which there is a horizontal
tangent to the graph of f .

Mean Value Theorem


Theorem 1.4 (Mean Value Theorem) Suppose a < b and f is continuous on [a, b] and
differentiable on (a, b). Then there exists a point ξ ∈ (a, b) such that

f (b) − f (a)
= f 0 (ξ). (1)
b−a

Proof. Let
f (b) − f (a)
g(x) = f (x) − f (a) − (x − a).
b−a
Then g(a) = g(b) = 0. Thus g satisfies then conditions of Rolle’s Theorem. Hence there exists
a point ξ at which g 0 (ξ) = 0, i.e.

f (b) − f (a)
0 = f 0 (ξ) − .
b−a

The geometrical interpretation of this is as follows.

f (b) ................................................. Q
.... ..
.. . ..... ..
..
.... .
. ..
.... .. ..
.. ..
.. ..
.. ..
P .
. ..
... ...
f (a) ............................................... .. R
.. .. ..
.. .. ..
.. .. ..
.. .. ..
a ξ b

Figure 1.2

2
Let P and Q be the points (a, f (a)) and (b, f (b)) as shown in Figure 1.2 and let R be the point
(b, f (a)). Then QR = f (b) − f (a) and P R = b − a. Hence the left hand-side of (1) is just
QR/P R which is the slope of P Q.
On the other hand, f 0 (ξ) is the slope of the tangent at ξ.
What the theorem says is that there is at least one point ξ, at which the tangent is parallel
to the chord P Q.
An immediate consequence of this is the following result.

Theorem 1.5 If f 0 (x) ≡ 0 then f (x) ≡ constant.

Proof. Let a and b be any two distinct points. We shall show that f (a) = f (b), which means
that the value of f is the same at any two points, i.e. f is a constant function.
For convenience, suppose a < b. Then for some ξ ∈ (a, b)
f (b) − f (a)
= f 0 (ξ).
b−a
But the right-hand side is zero by hypothesis, and so f (a) = f (b).

This result can be used to prove the following theorem.

Theorem 1.6 If F1 and F2 are antiderivatives of f then

F1 (x) − F2 (x) ≡ constant.

Proof. We have F10 (x) = f (x) and F20 (x) = f (x). Hence

(F1 − F2 )0 (x) = f (x) − f (x) = 0.

Then by Theorem 1.5,


F1 (x) − F2 (x) ≡ constant.

What this theorem says is that once we have found one antiderivative, then all others differ
from that one only by a constant. Thus returning to f (x) = 3x2 , we know F (x) = x3 is an
antiderivative. Then by Theorem 1.2, so is x3 + C, and by Theorem 1.6 there are no others.

Indefinite Integral
We now introduce some special notation. If F is an antiderivative of f we write
Z
f (x) dx = F (x) + C (2)
Z
and say that f (x) dx is the indefinite integral of f with respect to x, or often more simply
the integral of f . The reason for this symbolization will become clear later.
It follows that F 0 (x) = f (x), i.e.
Z
d n o
f (x) dx = f (x), (3)
dx
and Z
F 0 (x) dx = F (x) + C.

3
Thus integration is just the reverse of differentiation. If f is the derivative of g, then g is an
integral of f , and if g is an integral of f , then f is the derivative of g. Thus since

d 3
(x ) = 3x2
dx
we have Z
3x2 dx = x3 + C;

since
d 4
(x ) = 4x3
dx
we have Z
4x3 dx = x4 + C.

In general, since
d ³ xn+1 ´
= xn
dx n + 1
for n 6= −1, we have the following result.

Integral of xn

Z
xn+1
xn dx = +C provided n 6= −1 (4)
n+1

Further since
d ³ sin kx ´ d ³ cos kx ´
= cos kx and = − sin kx
dx k dx k
it follows that we have the following formulae.

Integrals of sine and cosine

Z Z
sin kx cos kx
cos kx dx = +C and sin kx dx = − + C, (k 6= 0) (5)
k k

Note the signs in (5) with care.


Also using the derivatives of tan kx and cot kx (for k 6= 0), we have the following.

Integrals of sec2 x and csc2 x

Z Z
2 tan kx cot kx
sec kx dx = +C and csc2 kx dx = − +C (6)
k k

The following simple results enable us to evaluate integrals in a natural way.

Theorem 1.7 Suppose f and g have antiderivatives. Then so do f + g and kf (where k ∈ R)


and moreover

4
Z Z Z
(a) {f (x) + g(x)} dx = f (x) dx + g(x) dx
Z Z
(b) kf (x) dx = k f (x) dx where k ∈ R.

Proof. (a) Using (3) we have


Z Z Z Z
d n o d d
f (x) dx + g(x) dx = f (x) dx + g(x) dx
dx dx dx
= f (x) + g(x).
Thus Z Z
f (x) dx + g(x) dx

is an antiderivative of f (x) + g(x), i.e.


Z Z Z
f (x) dx + g(x) dx = {f (x) + g(x)} dx.

(b) is left as an exercise.

Please note carefully what (b) says. It permits one to take a constant out of the integral
sign. ONE MAY NOT TAKE THE VARIABLE OF INTEGRATION OUT !!! It is
incorrect to think that Z Z
xf (x) dx = x f (x) dx.

For example, consider f (x) = x. Then


Z Z
x3
xf (x) dx = x2 dx = + C,
3
while Z Z n x2 o x3
x f (x) dx = x x dx = x +C = + Cx.
2 2
Also Z Z Z
f (x)g(x) dx 6= f (x) dx g(x) dx.

To see this take f (x) = g(x) = x. Then a simple calculation shows that the left-hand side is
x3 /3 + C, while the right-hand side is {x2 /2 + C}2 .

Example 1.2

Evaluate
Z : Z Z
x+1
(a) (x − 3x2 + x + 1) dx
4
(b) (5 sin 2x + 3 sec2 x) dx (c) √ dx
x
Z
(d) x(x + 1)2 dx.

Solution
Z
x5 x2
(a) (x4 − 3x2 + x + 1) dx = − x3 + + x + C (by Theorem 1.6, and (4)).
5 2
Z
5
(b) (5 sin 2x + 3 sec2 x) dx = − cos 2x + 3 tan x + C by (5), (6).
2
Z Z
x+1 1/2 −1/2 2
(c) √ dx = (x + x ) dx = x3/2 + 2x1/2 + C by (4).
x 3
Z Z
x4 2x3 x2
(d) x(x + 1)2 dx = (x3 + 2x2 + x) dx = + + + C.
4 3 2

5
2 Definite Integrals. Area
One of the most powerful and important applications of calculus lies in evaluating the areas of
plane figures whose boundary does not consist of straight line segments.
Let us pause for a moment to consider the meaning of the word “area”. Commonly area
will be defined to be something like “the amount of space a figure occupies”. If this definition
has any meaning at all (which seems highly doubtful), it is certainly quite useless from a
mathematical point of view, because it yields no method of determining what the area of any
figure actually is.

Area
Let us agree therefore that area must have, at least, the following properties:

A1 . If X is a subset of R2 , then, provided it exists, the area of X, denoted a(X), is a


non-negative real number.
A2 . If X ⊆ Y , and X and Y have areas, then a(X) ≤ a(Y ).
A3 . If X ∩ Y = ∅, and X and Y have areas, then a(X ∪ Y ) = a(X) + a(Y ).
A4 . If R is a rectangle of sides ` and b, then a(R) = `b.

The first of these says that area is never negative; the second says that larger sets have larger
area; the third says that if a set is composed of two disjoint “pieces”, then the area of the whole
set is the sum of the areas of the two “pieces”; the last gives the usual formula for the area of
a rectangle.
Now suppose we wish to find the area A between the curve f (x) = x2 , the x-axis and the
line x = 1. Divide the interval from 0 to 1 into, say, four pieces by the points 0, 1/4, 1/2, 3/4
and 1.

Figure 2.1

Draw rectangles L1 , L2 , L3 , L4 below f (x) and U1 , U2 , U3 , U4 above f (x), as shown in Figure


2.1. (L1 will have in this case zero height.) Each rectangle has base 1/4. Now since

f (0) = 0, f (1/4) = 1/16, f (1/2) = 1/4, f (3/4) = 9/16 and f (1) = 1,

we obtain by A4 that
1 1 9
a(L1 ) = 0, a(L2 ) = , a(L3 ) = , a(L4 ) = ,
64 16 64
1 1 9 1
a(U1 ) = , a(U2 ) = , a(U3 ) = , a(U4 ) = .
64 16 64 4

6
Then by A2 and A3,
a(L1 ) + a(L2 ) + a(L3 ) + a(L4 ) ≤ A ≤ a(U1 ) + a(U2 ) + a(U3 ) + a(U4 ),
i.e.
1 1 9 1 1 9 1
0+ + + ≤A≤ + + + ,
64 16 64 64 16 64 4
so
7 15
≤A≤ .
32 32
This gives us some idea of the value of A. Now it is easy to see that if we divide up the interval
into more pieces, we shall obtain a more accurate estimate of the area. Let us therefore divide
up the interval [0, 1] into n equal pieces of length 1/n each, by the points
0 = x0 < x1 < x2 < ... < xn = 1
(see Figure 2.2).
0 1/n 2/n

x0 x1 x2 xn−2 xn−1 xn

Figure 2.2

Then
1 1
xk = and f (xk ) = .
k k2

k 2 .......................
(k − 1)2 ....................... n2
n2

0 xk−1 xk 1 0 xk−1 xk 1

Figure 2.3

Drawing the rectangles above and below the graph of f as shown in Figure 2.3, we have

Rectangle Area of Rectangle below Area of Rectangle above


1 ³ 1 ´2 1
1st 0× ×
n n n
³ 1 ´2 1 ³ 2 ´2 1
2nd × ×
n n n n
³ 2 ´2 1 ³ 3 ´2 1
3rd × ×
n n n n
··· ··· ···
³ k − 1 ´2 1 ³ k ´2 1
kth × ×
n n n n
··· ··· ···
³ n − 1 ´2 1 ³ n ´2 1
nth × ×
n n n n

7
Hence
12 22 (n − 1)2 12 22 n2
0+ 3
+ 3 + ··· + 3
≤ A ≤ 3 + 3 + ··· + 3
n n n n n n
that is
1 2 1
[1 + 22 + · · · + (n − 1)2 ] ≤ A ≤ 3 [12 + 22 + · · · + n2 ]
n3 n
i.e.
n−1 n
1 X 2 1 X 2
k ≤ A ≤ k . (7)
n3 n3
k=1 k=1
Now recall that
n
X n(n + 1)(2n + 1)
k2 = .
n
k=1
Then eqrefArea1 yields
(n − 1)n(2n − 1) n(n + 1)(2n + 1)
3
≤A≤ ,
6n 6n3
or, on multiplying out,
2n3 − 3n2 + n 2n3 + 3n2 + n
≤ A ≤ .
6n3 6n3
On letting n → ∞, only the highest order terms will matter, and we obtain 1/3 ≤ A ≤ 1/3, so
1
A= .
3
(Do not worry, we shall demonstrate a much quicker and simpler method than this.)
Now let us repeat the above process in a more general way. Suppose that f is a continuous
function on the interval [a, b] such that f (x) ≥ 0 for all x ∈ [a, b]. Divide the interval [a, b] into
n pieces by the points
a = x0 < x1 < x2 < · · · < xn = b,
where each piece has length
xk − xk−1 = ∆x.
(For clarity Figure 2.4 shows a subdivision into only four pieces.)

y = f (x)
f (c4 ) .....................................................
..
..
..
..
..
. . . . . . . . . . . . . . ..
f (c1 ) ... ..
..
... ..
... ..
..
... .
a c1 x1 x2 x3 c4 x4 = b
= x0

Figure 2.4

For each subinterval [xk−1 , xk ], choose a point ck such that

xk−1 ≤ ck ≤ xk , k = 1, . . . , n,

(in Figure 2.4, c1 and c4 are shown) and draw a rectangle of height f (ck ) and base consisting
of the corresponding subinterval. Each of these rectangles has area

f (ck )(xk − xk−1 ).

8
The total area under the rectangles is then
n
X n
X
f (ck )(xk − xk−1 ) = f (ck )∆x.
k=0 k=0

Now let n → ∞. This will give the area under the curve. Thus
n
X
A = lim f (ck )∆x (8)
n→∞
k=1

which we shall write as Z b


A= f (x) dx.
a

Definite Integral
This is called the definite integral of f between a and b.

More generally, suppose f is defined on [a, b], and a = x0 < x1 < x2 < . . . < xn = b. Let

∆xi = xi − xi−1 , i = 1, . . . , n.

Thus we do not assume that the xi ’s are necessarily evenly spaced. Suppose

ci ∈ [xi , xi−1 ].

Let n → ∞, in such a way that maxi ∆xi → 0.

Integrable Function
n
X
Definition 2.1 Suppose lim f (ck )∆xi exists (and is independent of the choice of xi and
n→∞
k=1
Z b
ci ), then we say f is integrable and denote the limit by f (x) dx.
a

It may be shown that if f is continuous then it is integrable. On the other hand, the function
f defined by ½
1 , 0≤x≤1
f (x) =
2 , 1<x≤2
is not continuous but Z 2
f (x) dx
0
exists and indeed has value 3, (since clearly this is the area under the graph) although f is not
continuous. Thus there exist integrable functions which are not continuous.
On the other hand (
1/x , 0<x≤1
g(x) =
0 , x=0
is not integrable on [0, 1] because of its vertical asymptote at 0.
Now it may not be clear why we are using an integral sign again. The reason is that there
is a remarkable relationship between areas and the antiderivatives of the previous section. This
fact is one of the most astounding in all of mathematics and enables us to compute areas
without going through all the hard work we have indulged in so far.

9
In passing, let us note that the integral sign is nothing but an elongated s, which shows
that the integral sign is the limit of a sum – s being the first letter of “sum”.
Before proceeding, we note that in Definition 2.1 we assumed a < b. Now suppose a > b.
We define Z a
f (x) dx = 0
a

and
Z b Z a
f (x) dx = − f (x) dx.
a b

We conclude this section with some elementary properties of definite integrals.

Theorem 2.2 If f and g are integrable functions, then so are f + g and kf (where k ∈ R) and
moreover
Z b Z b Z b
(a) {f (x) + g(x)} dx = f (x) dx + g(x) dx
a a a
Z b Z b
(b) kf (x) dx = k f (x) dx
a a
Z c Z b Z c
(c) f (x) dx = f (x) dx + f (x) dx
a a b
Z b Z b
(d) If f (x) ≤ g(x) for all x ∈ [a, b], then f (x) dx ≤ g(x) dx
a a
Z b
(e) If f (x) ≡ K on [a, b], then f (x) dx = K(b − a)
a

¯Z b ¯ Z b
¯ ¯
(f) ¯ f (x) dx¯ ≤ |f (x)| dx.
a a

Proof. (a)
Z b n
X
{f (x) + g(x)} dx = lim [f (ck ) + g(ck )] ∆xk (by definition)
a n→∞
k=1
Xn n
X
= lim [ f (ck ) ∆xk + g(ck ) ∆xk ]
n→∞
k=1 k=1
Xn n
X
= lim f (ck ) ∆xk + lim g(ck ) ∆xk
n→∞ n→∞
k=1 k=1
Z b Z b
= f (x) dx + g(x) dx.
a a

(b) is left as an exercise.

(c) This result is actually true no matter what the order of a, b and c. In the case that
a < b < c, it expresses the intuitively obvious fact that finding the area between a and c
is the same as first finding the area from a to b and then adding on the area from b to c
(see Figure 2.5).

10
y = f (x)

a b c

Figure 2.5

The whole result is somewhat too technical to prove rigorously here.


(d)
Z b n
X
f (x) dx = lim f (ck )∆xk (by definition)
a n→∞
k=1
Xn
≤ lim g(ck )∆xk (by hypothesis)
n→∞
k=1
Z b
= g(x) dx.
a

(e) This expresses the fact that if f is a constant K, on [a, b], then the area of the rectangle
so formed is the length of the interval multiplied by K (see Figure 2.6).

K .........

a b

Figure 2.6

To prove the result formally, we proceed as follows:


Z b Xn
f (x) dx = lim f (ck )∆xk (by definition)
a n→∞
k=1
Xn
= lim K∆xk (by hypothesis)
n→∞
k=1
n
X
= K lim ∆xk
n→∞
k=1
= K lim [∆x1 + ∆x2 + · · · + ∆xn ]
n→∞
= K lim [(x1 − x0 ) + (x2 − x1 ) + · · · + (xn − xn−1 )]
n→∞
= K lim [xn − x0 ]
n→∞
= K lim (b − a) (since x0 = a and xn = b)
n→∞
= K(b − a).

11
(f) First note that
f (x) ≤ |f (x)| and − f (x) ≤ |f (x)|.
It follows from (d) that
Z b Z b Z b Z b
f (x) dx ≤ |f (x)| dx and (−f (x)) dx ≤ |f (x)| dx.
a a a a

Hence by (b) with k = −1


Z b Z b Z b Z b
f (x) dx ≤ |f (x)| dx and − f (x) dx ≤ |f (x)| dx,
a a a a

and the result follows.

An immediate consequence of Theorem 2.2 is the following result.

Theorem 2.3 Suppose f is integrable on [a, b] and m ≤ f (x) ≤ M for all x ∈ [a, b]. Then
Z b
m(b − a) ≤ f (x) dx ≤ M (b − a).
a

Proof. Let g(x) ≡ m. Then by Theorem 2.2(d) and (e)


Z b Z b
m(b − a) = g(x) dx ≤ f (x) dx.
a a

The right-hand inequality in the statement is proved in the same way.

This result may be understood from Figure 2.7.

M ... .. ..

f (x)

m.......

a b

Figure 2.7

The area under the curve lies between the area of the lower rectangle of height m, and the
higher of height M .

3 The Fundamental Theorem of Calculus


We shall now show how to compute areas using integration and show what the connection is
between the definite integrals of Section 2 and the indefinite integrals of Section 1.

12
First Fundamental Theorem of Calculus
Theorem 3.1 (First Fundamental Theorem of Calculus) Suppose f is a continuous func-
tion. Then for any constant a,
Z
d n x o
f (t) dt = f (x).
dx a

Proof. Let Z x
A(x) = f (t) dt.
a

Then
Z x+h
A(x + h) = f (t) dt
a
Z x Z x+h
= f (t) dt + f (t) dt (by Theorem 2.2(c))
a x
Z x+h
= A(x) + f (t) dt.
x

Hence Z x+h
A(x + h) − A(x) = f (t) dt.
x

[We can consier this geometrically as follows. A(x) denotes the area between f and the x-axis
between the points a and x.
y
A(x)

A(x + h) − A(x)
9
?

a t
x x+h

Figure 3.1

Then

A(x + h) = area between f and the x-axis from a to x + h


= A(x) + (area between f and the x-axis from x to x + h)

as shown in Figure 3.1.]


Resuming our proof, we have
Z x+h
A(x + h) − A(x) 1
= f (t) dt. (9)
h h x

Now suppose, for simplicity, h > 0. Using Theorem 2.3, we have


Z x+h
mh ≤ f (t) dt ≤ M h (10)
x

13
where m and M denote respectively the least and greatest value of f on [x, x + h]. Hence, by
(9) and (10)
A(x + h) − A(x)
m≤ ≤ M. (11)
h
Letting h → 0,
A(x + h) − A(x)
lim = A0 (x),
h→0 h
while
m = min f (t) → f (x) and M = max f (t) → f (x),
[x,x+h] [x,x+h]

since f is continuous. Thus if h → 0 in (11), we have

f (x) ≤ A0 (x) ≤ f (x),

and so Z x
d
f (t) dt = f (x).
dx a
The case where h < 0 is dealt with similarly.

The First Fundamental Theorem thus says that first integrating then differentiating returns
the original function.

Example 3.1
Z x
Differentiate sin t2 dt with respect to x.
2

Solution

Applying the First Fundamental Theorem, the derivative is just sin x2 .

The Second Fundamental Theorem is of greater utility and concerns the case where differ-
entiation is performed first.

Second Fundamental Theorem of Calculus


Theorem 3.2 (Second Fundamental Theorem of Calculus) Suppose f is continuous on
[a, b] and F is an antiderivative of f . Then
Z b
f (t) dt = F (b) − F (a).
a

Proof. By definition F 0 (x) = f (x). Let


Z x
G(x) = f (t) dt. (12)
a

By the First Fundamental Theorem


Z
d n x o
G0 (x) = f (t) dt = f (x) = F 0 (x).
dx a

Thus G is also an antiderivative of f . Hence by Theorem 1.6

G(x) = F (x) + C (13)

14
for some constant C.
Now clearly, setting x = a in (12),
G(a) = 0.
Thus by (13),
0 = F (a) + C,
and so
C = −F (a).
Hence
G(x) = F (x) − F (a),
and so
G(b) = F (b) − F (a),
that is Z b
f (t) dt = F (b) − F (a).
a

Usually we write
¯b
¯
F (b) − F (a) as F (x)¯ .
a
Z b
Now what this theorem implies is that if we wish to evaluate f (t) dt, we must just find the
Z a

indefinite integral F (t) = f (t) dt and evaluate it at the end-points, a and b, then subtract.

Let us return to our example from Section 2. There, with very considerable labour, we
found Z 1
1
x2 dx = .
0 3
Now, using the second fundamental theorem, we have
Z
x3
x2 dx = + C,
3
and so Z 1
x3 ¯¯1 13 03 1
x2 dx = ¯ = − = .
0 3 0 3 3 3
The time saved is, of course, enormous.
Note that when evaluating the definite integral we did not include the usual “+C 00 . This is
because, if we had included it, it would merely have cancelled out, as we now show.
Z 1 ¯1 ³ 13 ´ ³ 03 ´ 1
x3 ¯
x2 dx = + C¯ = +C − +C = .
0 3 0 3 3 3
Thus when evaluating a definite integral omit the “+ C”, while when dealing with an indefinite
one, include it.

Example 3.2

Find the area enclosed by the parabola y = 4 − x2 and the x-axis.

Solution

The graph is an inverted parabola that cuts the x-axis at ±2 (see Figure 3.2).

15
4

−2 2

Figure 3.2

We must evaluate Z 2
I= (4 − x2 ) dx.
−2
We have ³ x3 ´¯¯2 ³ 23 ´ ³ (−2)3 ´ 32
I = 4x − ¯ = 8− − −8+ = .
3 −2 3 3 3

4 More on Areas
So far we have been careful to consider only functions f , where f (x) ≥ 0 for all x. What
happens when f (x) is negative? If we return to the definition, we see that
Z b Xn
f (x) dx = lim f (ck )∆xk ,
a n→∞
k=1

where ck ∈ [xk−1 , xk ].
Thus if f (ck ) ≤ 0 for each k, it is clear that the right-hand side cannot be positive, and
Z b
f (x) dx ≤ 0.
a
Z b
Hence if f (x) ≤ 0 then f (x) dx does not represent the area between f and the x-axis, but
a
rather (−1)× this area.

a b

y = f (x)

Figure 4.1
Z b
In Figure 4.1, the shaded portion has area − f (x) dx.
a
Now suppose the graph of f crosses the x-axis in a number of places, as in Figure 4.2. Here
Z b Z c Z d
area A1 = f (x) dx, area A2 = − f (x) dx, and area A3 = f (x) dx.
a b c
Thus the total area is Z Z Z
b c d
f (x) dx − f (x) dx + f (x) dx.
a b c

16
A1
A3

a b c d
A2

Figure 4.2

So, when computing area, we subtract the integral for those portions of the graph lying
below the x-axis and add it for those lying above.

Example 4.1

Find the area between the graph of y = x2 − 1 and the x-axis for x between 0 and 2.

Solution

y = x2 − 1

A2
A1 1 2

Figure 4.3

Now
total area = area A2 + area A1
Z 2 Z 1
= (x2 − 1) dx − (x2 − 1) dx
1 0
³ x3 ´¯2 ³ x3 ´¯1
¯ ¯
= −x ¯ − −x ¯
3 1 3 0
³8 ´ ³1 ´ ³1 ´
= −2 − −1 − − 1 = 2.
3 3 3
Example 4.2

Find the area enclosed by the graphs of y = x and y = x2 .

Solution

Evidently, the graphs meet at x = 0 and x = 1. We must find the area of the shaded region
shown in Figure 4.4.

17
B ... (1, 1)
..
..
..
..
..
..
..
..
..
..
.. 1
O A

Figure 4.4

This is equal to A1 − A2 , where A1 is the area below y = x and A2 is the area below y = x2 .
Thus
Z 1 Z 1
A = x dx − x2 dx
0 0
Z 1
= (x − x2 ) dx
0
³ x2 x3 ´¯¯1 1
= − ¯ = .
2 3 0 6

This idea can be generalized. Suppose f (x) ≥ g(x) (see Figure 4.5). Then the area between
the graphs of f and g is just
Z b
{f (x)) − g(x)} dx.
a

y = f (x)

..
.. ..
.. y = g(x) ..
.. ..
.. ..
. .
a b

Figure 4.5

Example 4.3

Find the area between the curves y = x2 + 2 and y = x2 /3 for 0 ≤ x ≤ 2.

Solution

By the above argument (see Figure 4.6), the area is


Z 2 Z 2
(x2 + 2 − x2 /3) dx = (2x2 /3 + 2) dx
0 0
³ 2x3 ´¯2
¯
= + 2x ¯
9 0
= 52/9.

18
y = x2 + 2

.. y = x2 /3
..
..
..
..
..
.
0 2

Figure 4.6

Example 4.4

Find the area lying between the curves f (x) = x2 and g(x) = (x − 2)2 for 0 ≤ x ≤ 2.

Solution

(1, 1)

A1 ? A2
y = f (x) y = g(x)

0 1 2

Figure 4.7

We must find the sum of the areas A1 and A2 . Now since g(x) ≥ f (x) for 0 ≤ x ≤ 1,
Z 1
area A1 = [g(x) − f (x)] dx,
0
whereas Z 1
area A2 = [f (x) − g(x)] dx.
0
Thus
Z 1 Z 2
total area = [(x − 2)2 − x2 ] dx + [x2 − (x − 2)2 ] dx
0 1
Z 1 Z 2
= (−4x + 4) dx + (4x − 4) dx
0 1
¯1 ¯2
¯ ¯
= (−2x2 + 4x)¯ + (2x2 − 4x)¯
0 1
= (−2 + 4) + (8 − 8) − (2 − 4)
= 4.

5 Techniques of Integration
At this stage the only functions that we can integrate are powers of x (but not x−1 ) and a few
simple trigonometric functions. In this section we shall show how to integrate a greater variety
of functions.

19
5.1 Reduction to Simple Form
Some functions can be reduced, by elementary manipulations, to forms that we know how to
integrate.

Example 5.1
Z Z
x2 + 3x + 1
Evaluate (a) (x + 2)2 dx (b) √ dx.
x

Solution

(a) We simply multiply out the bracket to obtain


Z Z
(x + 2)2 dx = (x2 + 4x + 4) dx

x3
= + 2x2 + 4x + C.
3
(b) Here we perform the indicated division before integrating.
Z 2 Z
x + 3x + 1
√ dx = (x3/2 + 3x1/2 + x−1/2 ) dx
x
2 5/2
= x + 2x3/2 + 2x1/2 + C.
5

The following two integrals are very useful indeed.

Example 5.2
Z Z
Evaluate (a) sin2 kx dx (b) cos2 kx dx.

Solution

(a) We note that cos 2θ = 1 − 2 sin2 θ.


Setting θ = kx, we have
1 − cos 2kx
sin2 kx = .
2
Thus
Z Z
2 1
sin kx dx = (1 − cos 2kx) dx
2
1³ sin 2kx ´
= x− + C.
2 2k

(b) Similarly, since cos 2θ = 2 cos2 θ − 1, we have


cos 2kx + 1
cos2 kx =
2
and so
Z Z
1
cos2 kx dx = (1 + cos 2kx) dx
2
1³ sin kx ´
= x+ + C.
2 2k

20
Example 5.3
Z
Evaluate sin θ cos 2θ dθ.

Solution

First we need some trigonometry. Recall that


sin(θ + φ) = sin θ cos φ + cos θ sin φ
and
sin(θ − φ) = sin θ cos φ − cos θ sin φ.
Adding gives
2 sin θ cos φ = sin(θ + φ) + sin(θ − φ)
Hence, setting φ = 2θ, and dividing by 2,
1
sin θ cos 2θ = [sin 3θ − sin θ],
2
and the integral becomes
Z
1³ cos 3θ ´
(sin 3θ − sin θ) dθ = cos θ − + C.
2 3

5.2 Integration by Substitution


We have seen that we could integrate 2x(x2 + 2)2 simply by multiplying out. What should we
have done if we were asked instead to evaluate
Z
(x2 + 2)17 2x dx?

We could multiply out, of course, but this would be extremely tedious. Let us therefore set
u = x2 + 2. Then certainly du/dx = 2x, and the integral becomes
Z
du
u17 dx.
dx
Now formally cancelling out the dx’s (this of course will need to be justified), we obtain
Z
u18
u17 du = +C
18
(x2 + 2)18
= + C.
18
That this is actually the correct answer is easy to check by differentiating and using the chain
rule. We have obtained the right solution, but our method is a little doubtful, to say the least
of it. Let us now try to justify the above procedure.
First recall that Z
F (x) dx = f (x) + C

means exactly the same as


df
= F (x),
dx
and so Z
df
dx = f (x) + C.
dx

21
Theorem 5.1 Suppose G and u have continuous derivatives. Then
Z Z
dG du dG
dx = du.
du dx du

Proof. Evidently Z
dG
du = G(u(x)) + C. (14)
du
However
d dG
[G(u(x)) + C] =
dx dx
dG du
= (by the Chain Rule)
du dx
0 0
= G (u)u (x),

so Z
G(u(x)) + C = G0 (u)u0 (x) dx. (15)

The result then follows from (14) and (15).

What the theorem amounts to is that we can formally replace u0 (x) dx by du.
Thus returning to our original example we had u = x2 + 2. Hence
du
= 2x,
dx
and we can replace
2x dx by du.
It follows that Z Z
(x2 + 2)17 2x dx = u17 du.

Example 5.4
Z
Evaluate (x3 + 1)4 x2 dx.

Solution

Set
u = x3 + 1.
Then du/dx = 3x2 or formally du = 3x2 dx, and so
du
x2 dx = .
3
The integral becomes
Z
1 u5 (x3 + 1)5
u4 du = +C = + C.
3 15 15

Example 5.5
Z

Evaluate 3x + 5 dx.

22
Solution

Set u = 3x + 5. Then du/dx = 3 so du = 3 dx. We obtain


Z
1 √ 2 2
u du = u3/2 + C = (3x + 5)3/2 + C.
3 9 9

Example 5.6
Z
Evaluate (sin2 θ + 1)2 cos θ dθ.

Solution

Set u = sin θ. Then du/dθ = cos θ, that is du = cos θ dθ and the integral is
Z Z
2 2
(u + 1) du = (u4 + 2u2 + 1) du

u5 2u3
= + +u+C
5 3
sin θ 2 sin3 θ
5
= + + sin θ + C.
5 3
R
[One might think that when evaluating (u2 + 1)2 du, another substitution, say v = u2 + 1
might help. Then dv = 2u du, and we should have
Z 2
v
dv.
2u
This is fruitless, since there is still a u in the integrand.]

Example 5.7
Z 1
Evaluate I = (1 + x3 /2) 3x1/2 dx.
0

Solution

Set
u = 1 + x3/2 .
Then
3 1/2
du =
x dx.
2
Thus Z Z
3/2 3 1/2 2
(1 + x ) x dx = u3 du + C.
3
However, we were asked to evaluate a definite integral. The limits were from x = 0 to x = 1.
Now when we have made the substitution, the integral is in terms of u, so the limits must
also be.
We note that when x = 0, then u = 1, while when x = 1, then u = 2. So
Z x=1
I = (1 + x3/2 )3 x1/2 dx
x=0
Z u=2
2
= u3 du
3 u=1

1 4 ¯¯2 5
= u ¯ = .
6 1 2

23
Z b
Note that when evaluating a definite integral f (x) dx, using a substitution u = g(x),
a
three things must be done:

1. The integrand f (x) must be expressed in terms of u.


2. The differential dx must be expressed in terms of u and du.
3. The limits must be converted to limits in terms of u.

Note also that once all these three steps have been taken, there is no need to change
the variable back from u to x after the integration has been carried out. This is not
the case in indefinite integration, where the antiderivative should, by the end of the
computation, be expressed in terms of the original variable

Example 5.8
Z 2
Evaluate (3x2 + 1)(x3 + x + 2)1/2 dx.
1

Solution

Set
u = x3 + x + 2.
Then
du = (3x2 + 1) dx.
Also when x = 1, u = 4, while when x = 2, u = 12. We obtain
Z 12
2 3/2 ¯¯12
u1/2 du = u ¯
4 3 4
16 3/2
= [3 − 1].
3
Example 5.9
Z
1
Evaluate dx.
1 + x2

Solution

Set
x = tan θ.
Then
dx = sec2 θ dθ,
and we have Z
sec2 θ
dθ.
1 + tan2 θ
But, recalling that 1 + tan2 θ = sec2 θ, this simplifies to
Z Z
dθ = 1 dθ = θ + C.

Since x = tan θ, then θ = tan−1 x, and so


Z
1
dx = tan−1 x + C.
1 + x2

24
This may well have seemed a fairly inspired substitution. It was, but do not worry, it
was not originally found without a lot of thought, and not by this author. In general, when
evaluating integrals involving terms in a2 + x2 , try the substitution x = a tan θ when all else
fails. Let us now generalize the previous example.

Example 5.10
Z
1
Evaluate dx.
a2 + x2

Solution

Let
x = a tan θ.
2
Then dx = a sec θ dθ, and

a2 + x2 = a2 + a2 tan2 θ = a2 sec2 θ.

We obtain
Z Z
a sec2 θ dθ 1
= dθ
a2 sec2 θ a
1
= θ+C
a
1
= tan−1 (x/a) + C.
a

This is a useful result in its own right.

Integral of 1/(x2 + a2 )

Z
1 1
dx = tan−1 (x/a) + C (16)
a2 + x2 a

Example 5.11
Z
dx
Evaluate I = .
x2 + 2x + 5

Solution

Completing the square, we have


Z
dx
I= .
(x + 1)2 + 4
Let u = x + 1. Then du = dx, and using (16),
Z
du
I =
u2 + 4
1
= tan−1 (u/2) + C
2
1 ³x + 1´
= tan−1 + C.
2 2

25
Example 5.12
Z
dx
Evaluate I = √ .
a2− x2

Solution

Now let
x = a sin θ.
Then dx = a cos θ dθ. Also, since
p p p
a2 − x2 = a2 − a2 sin2 θ = a 1 − sin2 θ = a cos θ,

we obtain Z
a cos θ dθ
=θ+C
a cos θ
Since x = a sin θ, then θ = sin−1 (x/a).

We have derived an important elementary integral.

Integral of (a2 − x2 )1/2

Z
dx
√ = sin−1 (x/a) + C. (17)
a2− x2

Note also that from (16) and (17) we obtain (setting a = 1)

d 1 d 1
tan−1 x = and sin−1 x = √ (18)
dx 1 + x2 dx 1 − x2

Example 5.13
Z
1
Evaluate I = √ dx.
5 − 4x − x2

Solution

Firstly,
5 − 4x − x2 = 9 − (x + 2)2 .
Thus we have Z
dx
I= p .
9 − (x + 2)2
Using (17) and the obvious substitution (u = x + 2), we obtain
³x + 2´
sin−1 + C.
3

Example 5.14

Find the area of a circle.

26
Solution

Let us find the area of a quarter circle of radius r and then multiply by 4.
Now the equation of a circle of radius r is x2 + y 2 = r2 , so
p
y = ± r2 − x2 .

Since y = 0 in the quarter we are interested in,


p
y = + r2 − x2 .

y
r

x
r

Figure 5.1

So we must find Z r p
I= r2 − x2 dx.
0

Set
x = r sin θ.
Then dx = r cos θ dθ and r2 − x2 = r2 cos2 θ.
Also when x = 0, θ = 0, while if x = r, sin θ = 1 and θ = π/2. Thus we have
Z π/2
I= r2 cos2 θ dθ.
0

Since
cos 2θ = 2 cos2 θ − 1,
this reduces to
Z ³
π/2
sin 2θ ´¯¯π/2
r2 [1 + cos 2θ)] dθ = r2 θ + ¯
0 2 0
2³ ´
r π sin π
= + −0
2 2 2
πr2
= .
4
So the area of a full circle is πr2 .

5.3 Integration by Parts


We have seen that Z Z Z
f (x)g(x) dx 6= f (x) dx g(x) dx.

27
What can then be said about the integral of a product? Since we know a formula for the
derivative of a product, it seems sensible to start from there. We have

{f (x)g(x)}0 = f 0 (x)g(x) + f (x)g 0 (x).

Thus Z Z Z
d
{f (x)g(x)} dx = f 0 (x)g(x) dx + f (x)g 0 (x) dx,
dx
or Z Z
f (x)g(x) = f 0 (x)g(x) dx + f (x)g 0 (x) dx.

On rearranging we obtain the following result.

Theorem 5.2 (Integration by Parts) If f and g have continuous derivatives, then


Z Z
f 0 (x)g(x) dx = f (x)g(x) − f (x)g 0 (x) dx. (19)

Z
Thus if we write an integral as f 0 (x)g(x) dx we must first evaluate f (x)g(x) – i.e. integrate
f 0 – and then differentiate g. The idea is illustrated below.

differentiate
-
Z Z
f 0 (x) g(x) dx = f (x) g(x) − f (x) g 0 (x) dx

-
integrate

Example 5.15
Z
Evaluate x cos x dx.

Solution

One term will have to be differentiated and one integrated. Now clearly it will make life easier
if we differentiate x, since its derivative is just 1.
Thus let g(x) = x and f 0 (x) = cos x in (19).
Then g 0 (x) = 1 and f (x) = sin x. Thus we have

differentiate
-
Z Z
x cos x dx = x sin x − 1 sin x dx
-
integrate
Completing the calculation gives
Z Z
x cos x dx = x sin x − sin x dx
= x sin x + cos x + C.

28
Example 5.16
Z 1
Evaluate x2 (x + 1)7 dx.
0

Solution

Letting f 0 (x) = (x + 1)7 and g(x) = x2 , we obtain


¯1 Z Z
x2 (x + 1)8 ¯¯ 1 1 8 1 1
¯ − x(x + 1) dx = 32 − x(x + 1)8 dx.
8 0 4 0 4 0
This needs another integration by parts. Let f 0 (x) = (x + 1)8 and g(x) = x in (19). We have
½ ¯1 Z 1 ¾ ¯1
1 x(x + 1)9 ¯¯ (x + 1)9 128 1 ¯
10 ¯
32 − ¯ − dx = 32 − + (x + 1) ¯
4 9 0 0 9 9 360 0

128 128 1 7423


= 32 − + − = .
9 45 360 360
Example 5.17
Z
Evaluate sin−1 x dx.

Solution

This demands a trick. We write the integral as


Z
1 sin−1 x dx.

Then, integrating by parts and remembering that


d 1
sin−1 x = √ ,
dx 1 − x2
we have Z Z
x
sin−1 x dx = x sin−1 x − √ dx.
1 − x2
Now set
u = 1 − x2 .
Then −2x dx = du and we have
Z
1
x sin−1 x + u−1/2 du = x sin−1 x + u1/2 + C
2
= x sin−1 x + (1 − x2 )1/2 + C.

6 Exponentials and Logarithms


Z
xn+1
We have seen that xn dx = + C provided n 6= −1. What can we say about the case
n+1
where n = −1? i.e. can we evaluate Z
1
dx ?
x
Let us set Z t
1
`(t) = dx,
1 x
where ` is some function of t, about which we know very little as yet. Geometrically `(t) is the
area under the curve y = 1/x between x = 1 and x = t (see Figure 6.1).

29
y

y = 1/x

6 x
1 t

`(t)

Figure 6.1

Now by definition
Z rt
1
`(rt) = dx
1 x
Z r Z rt
1 1
= dx + dx (by Theorem 2.2(c))
1 x r x
Z rt
1
= `(r) + dx.
r x
In the latter integral let x = rz. Then dx = r dz, and when x = r, z = 1 while when
x = rt, z = t. Hence
Z t
1
`(rt) = `(r) + r dz
1 rz
= `(r) + `(t).

[The fact that we have a z in the integrand is irrelevant. The integral is just the shaded area
in Figure 6.1, which depends only on t.]
Furthermore,
Z tn
n 1
`(t ) = dx.
1 x
n n−1
Letting x = z , we have dx = nz dz.
Also when x = 1, z = 1, and when x = tn , z = t. Thus
Z t
1
`(tn ) = n
nz n−1 dz
1 z
Z t
1
= n dz
1 z
= n`(t).

We have shown
`(rt) = `(r) + `(t) (20)
and
`(tn ) = n`(t). (21)
These properties of ` make us suspect that ` is in fact a logarithm to some base.
Now recall that if y > 0 then

y = ax if and only if loga y = x.

30
This means that if
f (x) = loga x then f −1 (x) = ax .
Furthermore, since
f (f −1 (x)) = x and f −1 (f (x)) = x,
we have
loga ax = x and aloga x = x.

Definition of e
Now let us define e to be the real number such that
Z e
1
dx = 1 (22)
1 x

i.e.
`(e) = 1.

y = 1/x

6 x
1 e

Area = 1

Figure 6.2

Thus e is the number such that the area under the curve y = 1/x between x = 1 and x = e is
1 (Figure 6.2). It may be shown that e ≈ 2.718.
Now by (21) and (22)
`(ex ) = x`(e) = x.
Thus ` must be the inverse function of ex . That is `(x) = loge x provided x > 0.

Natural Logarithm
We write loge x as ln x. This is known as the natural logarithm of x. We have shown
Z x
1
dt = ln x. (23)
1 t

Then by the First Fundamental Theorem of Calculus,


Z x
d 1 1
dt = for x > 0.
dx 1 t x

Substituting from (23), we obtain

d 1
(ln x) = for x > 0, (24)
dx x

31
or Z
1
dx = ln x + C for x > 0. (25)
x

Furthermore, since ln x is the inverse of ex ,

ln ex = x and eln x = x. (26)

The graphs of f (x) = ln x and g(x) = ex are similar to those of other powers and logarithms.

e
1

f (x) = ex

1 e
1

g(x) = ln x

Figure 6.3

Note that of course,


ln 1 = 0 and ln e = 1.

The Exponential Function


The function f (x) = ex is called the exponential function, and is sometimes written as
exp(x).
Now all the results so far derived for ln x were valid only for x > 0. Suppose on the other
hand, that x < 0.
Let y = −x. Then dy = −dx and y > 0. Thus
Z Z ³
1 1´
dx = − − dy
x y
Z
1
= dy
y
= ln y + C.

But since x < 0, y = −x = |x| and so


Z
1
dx = ln |x| + C for x < 0.
x

Also if x > 0, then x = |x| and we have already seen that


Z
1
dx = ln x + C = ln |x| + C.
x

32
Integral of 1/x
Hence in all cases (except when x = 0)
Z
1
dx = ln |x| + C, (27)
x

d 1
(ln |x|) = (28)
dx x

Now we know how to differentiate ln x, what can we say about the derivative of ex ? The
answer is surprising and interesting.
Suppose
y = ex .
Then
x = ln y.
Thus by (28),
dx d 1 1
= [ln y] = = x .
dy dy y e
Hence
dy
= ex .
dx

Derivative and Integral of ex


Thus we have the remarkable result

d x
e = ex . (29)
dx

It follows immediately that


Z
ex dx = ex + C. (30)

These last two formulae can be generalised using the chain rule. For

d kx
e = ekx .k = kekx ,
dx
and so
Z
d kx ekx
e = kekx and ekx dx = + C. (31)
dx k

We may now differentiate a number of other functions.

Example 6.1

Differentiate y = 10x .

33
Solution

We have y = 10x , so taking logarithms,

ln y = x ln 10.

Now using implicit differentiation,


1 dy
= ln 10,
y dx
or
dy
= y ln 10 = 10x ln 10.
dx
In general, if a > 0,
d x
a = ax ln a.
dx

Example 6.2

Differentiate y = xx (where x > 0).

Solution

Taking logarithms,
ln y = ln xx = x ln x.
Thus by the product rule and implicit differentiation,
1 dy 1
= ln x + x = ln x + 1.
y dx x
So
dy
= y(ln x + 1) = xx (ln x + 1).
dx

7 Further Integrations
In this section we shall combine together the results of the previous section with what we
learned earlier, to perform a number of other integrations. First let us generalize (27). Suppose
we wish to evaluate Z
dx
,
ax + b
where a and b are constants. Let u = ax + b. Then du = a dx and so
Z
dx 1
= ln |u| + C
ax + b a
1
= ln |ax + b| + C.
a
A word of caution is in order here. Although it is true that
Z
1
dx = ln |x| + C,
x
it does NOT follow in general that
Z
1
dx = ln |f (x)| + C.
f (x)

34
For example, Z
1
dx = −x−1 + C,
x2
and is not equal to ln |x2 | + C.

Example 7.1
Z Z
dx dx
Evaluate (a) (b) .
3x − 5 3 − 2x

Solution
Z
dx 1
(a) We have = ln |3x − 5| + C.
3x − 5 3
Z Z
dx dx 1
(b) Similarly, =− = − ln |2x − 3| + C.
3 − 2x 2x − 3 2

Now consider the integral Z


2x + 3
dx.
x2 + 3x + 5
Let u = x2 + 3x + 5. Then du = (2x + 3) dx and the integral reduces to
Z
du
= ln |u| + C = ln |x2 + 3x + 5| + C.
u
Why did this work? It was because the numerator of the integrand was just the derivative of
its denominator.
In general, we see that if we have to evaluate
Z 0
f (x)
dx,
f (x)

all we need do is set u = f (x). Then du = f 0 (x) dx and the integral becomes
Z
du
= ln |u| + C = ln |f (x)| + C.
u

Example 7.2
Z
3x2 + 2
Evaluate dx.
x3 + 2x + 3

Solution

Let u = x3 + 2x + 3. Then du = (3x2 + 2) dx, and we have


Z
du
= ln |x3 + 2x + 3| + C.
u

Integral of cotangent
Example 7.3
Z
Evaluate cot x dx.

35
Solution

We have Z Z
cos x
cot x dx = dx.
sin x
Letting u = sin x, du = cos xdx, and we arrive at
Z
du
,
u

which gives us
Z
cot x dx = ln | sin x| + C. (32)

Integral of tangent
In exactly the same way, Z
tan x dx = − ln | cos x| + C.

But since
− ln | cos x| = ln{| cos x|−1 } = ln | sec x|,
this implies that
Z
tan x dx = ln | sec x| + C. (33)

Sometimes a little more manipulation is needed.

Example 7.4
Z
x2 + 3x + 4
Evaluate I = dx.
x2 + x + 3

Solution

Dividing, we see that


x2 + 3x + 4 2x + 1
2
=1+ 2 .
x +x+3 x +x+3
Thus the integral is Z ³
2x + 1 ´
I= 1+ dx.
x2 + x + 3
The usual substitution yields
x + ln |x2 + x + 3| + C.

Example 7.5
Z
2x − 1
Evaluate √ dx.
x2 − x + 7

36
Solution

Now take care! The numerator is the derivative of the square of the denominator. Let

u = x2 − x + 7.

Then
du = (2x − 1) dx,
so the integral becomes
Z
du
√ = 2u1/2 + C = 2(x2 − x + 7)1/2 + C.
u

Using our knowledge of ex , we can also evaluate some integrals using integration by parts.

Example 7.6
Z
Evaluate xex dx.

Solution

We use integration by parts. Clearly it will be advantageous to differentiate the term x, so


we commence by integrating ex , to obtain
Z Z
xex dx = xex − ex dx.
= xex − ex + C.

Example 7.7
Z
Evaluate x2 e−2x dx.

Solution

We use integration by parts. Again it will be advantageous to differentiate the term x2 , so


we commence by integrating e−2x .
Z Z
2 −2x x2 e−2x
x e dx = − + xe−2x dx.
2

Another integration by parts yields


Z
x2 e−2x xe−2x 1 x2 e−2x xe−2x 1
− − + e−2x dx = − − − e−2x + C.
2 2 2 2 2 4

Example 7.8
Z
Evaluate I = e3x sin 2x dx.

37
Solution

Using parts twice we obtain


Z Z
1 3x 2
e3x sin 2x dx = e sin 2x − e3x cos 2x dx
3 3
Z
1 3x 2 n e3x cos 2x 2 o
= e sin 2x − + e3x sin 2x dx
3 3 3 3
Z
1 3x 2 3x 4
= e sin 2x − e cos 2x − e3x sin 2x dx.
3 9 9

Apparently we are going round in circles, but a moment’s thought will save the day. We have
shown that
1 2 4
I = e3x sin 2x − e3x cos 2x − I.
3 9 9
Hence
13 1 2
I = e3x sin 2x − e3x cos 2x + C,
9 3 9
so
3 3x 2 3x
I= e sin 2x − e cos 2x + C 0 ,
13 13
where C 0 = 9C/13.

We conclude by evaluating three elementary integrals. All involve some sleight of hand.

Integral of Secant
Example 7.9
Z
Evaluate sec x dx.

Solution

We have
Z Z h sec x + tan x i Z
sec x tan x + sec2 x
sec x dx = sec x dx = dx.
sec x + tan x sec x + tan x

Let
u = sec x + tan x.
Then
du = (sec x tan x + sec2 x) dx
and the integral reduces to Z
du
= ln |u| + C.
u
We have shown
Z
sec x dx = ln | sec x + tan x| + C. (34)

38
Integral of cosecant
Similarly,
Z
csc x dx = − ln | csc x + cot x| + C. (35)

Example 7.10
Z
Evaluate ln x dx, where x > 0.

Solution

First note that Z Z


ln x dx = 1 ln x dx.

Integrating by parts we obtain


Z
x ln x − x dx = x ln x − x + C.

Finally let us make a comment. Although we have seen how to integrate a large number
of functions, some integrals cannot be expressed in terms of elementary functions. Thus for
example Z Z
2
ex dx, sin x2 dx,

and many other integrals cannot be evaluated (in terms of functions we already know about).

8 Odd and Even Functions


Before continuing with our study of calculus and especially of integration, it will be worth our
while to take a short look at some integrals which are particularly easy to evaluate.
As we have seen, if f (x) ≥ 0 for x ∈ [a, b], then
Z b
f (x) dx
a

represents the area between the graph of f and the x-axis between x = a and x = b. Further-
more, if f (x) ≤ 0 for x ∈ [a, b], then the integral above represents minus the same area.
Hence if the graph of f is as shown in Figure 8.1

B
−a
a
A

Figure 8.1

39
where the areas of A and B are equal, then
Z a
f (x) dx = 0.
−a

Such an integration is, of course, very easy to perform and this technique will work whenever
the limits of integration are of the form −a to a the graph of f has the required form.

Odd and Even Functions


Definition 8.1 Suppose f : R → R. Then f is an odd function if

f (−x) = −f (x), x ∈ R,

and it is an even function if


f (−x) = f (x), x ∈ R.

f odd f even

Figure 8.2

Example 8.1

Let f (x) = cos x.

Then f (−x) = cos(−x) = cos x = f (x), so that f is even.

Example 8.2

Let f (x) = sin x.

Then f (−x) = sin(−x) = − sin x = −f (x), so that f is odd.

Example 8.3

Let f (x) = xn , where n ∈ N. Then


½
xn , n even
f (−x) = (−x)n = (−1)n xn =
−xn , n odd

Thus f is an odd/even function if and only if n is odd/even. (This is the reason for the names
in Definition 8.1.)

40
Example 8.4

Let f (x) = 0 for all x.

Clearly f (−x) = 0 = f (x) and also f (−x) = 0 = −f (x). Thus f is both odd and even!

Example 8.5

Let f (x) = ex .

Then f is neither odd nor even.

Thus unlike the case of integers, a function may be odd, even, both or neither.

Theorem 8.2 Suppose all the integrals below exist.


Z a
(a) If f is odd then f (x) dx = 0.
−a
Z a Z a
(b) If f is even then f (x) dx = 2 f (x) dx.
−a 0

Proof. Z Z Z
a 0 a
f (x) dx = f (x) dx + f (x) dx.
−a −a 0

Letting −x = u in the first integral, we obtain


Z a Z 0 Z a
f (x) dx = − f (−u) du + f (x) dx
−a a 0
Z 0 Z a
= f (u) du + f (x) dx (since f is odd)
a 0
Z a Z a
= − f (u) du + f (x) dx = 0.
0 0
Z a Z a
(Note that f (u) du = f (x) dx, since both integrals depend only on a and f and represent
0 0
the area under the same graph between the same limits – in a nutshell, the area is not affected
by the label given to the horizontal axis.)
The proof of the second part is similar and may be seen intuitively from Figure 8.3.

A B

−a a

Figure 8.3

Since f is even, area A = area B, hence the total area is 2B.

41
Example 8.6
Z π
Evaluate sin5 x dx.
−π

Solution

Clearly f (x) = sin5 x is odd, so that the integral is zero by Theorem 8.2(a).

Example 8.7

Z 3
1
Evaluate dx.
−3 x

Solution

It might be tempting to suppose that this integral is also 0. Unfortunately it does not even
exist! The reason for this is simply that 1/x is not defined when x = 0.

Example 8.8
Z π
Evaluate x sin x dx.
−π

Solution

Now f (x) = x sin x is even so that the integral is equal to


Z π n ¯π Z π o
¯
2 x sin x dx = 2 − x cos x¯ + cos x dx
0 0 0
= 2π.

9 Partial Fractions
Suppose we wish to evaluate Z
dx
.
x2 + 2x − 15
We note
1n 1 1 o 1 1
− = = 2 (36)
8 x−3 x+5 (x − 3)(x + 5) x + 2x − 15
The integral then becomes
Z
1 n 1 1 o 1n o
− dx = ln |x − 3| − ln |x + 5| + C
8 x−3 x+5 8
1 ¯¯ x − 3 ¯¯
= ln ¯ ¯ + C.
8 x+5

This is all very well provided we know the expression on the left-hand side of (36), but it is not
obvious how to obtain it. Before we show how this may be done systematically, some further
theory is necessary.

42
Identities and Equations
Definition 9.1 Suppose f and g are defined on some subset D of R. Then we say f is iden-
tically equal to g on D, written f ≡ g on D if f (x) = g(x) for every x ∈ D.

The symbols “ = ” and “ ≡ ” have quite different meanings. When we write


x2 = 1
(which is an equation), we are implicitly saying that x = ±1. This equation clearly does not
hold for all x.
On the other hand, the identity
(x + 1)2 ≡ x2 + 2x + 1
is true not matter what the value of x.
We shall also need some further notation.

Factorial
Definition 9.2 Let n ∈ N. Then n! = 1.2.3 . . . n. Also 0! = 1.

The symbol “n!” is called “n factorial”. Note that


(n + 1)n! = (n + 1)! (37)
The reason for defining 0! to be 1 will emerge later.

Theorem 9.3 Suppose


p(x) = an xn + an−1 xn−1 + · · · + a1 x + a0 and q(x) = bn xn + bn−1 xn−1 + · · · + b1 x + b0
are polynomials. If p ≡ q on any interval (a, b), then an = bn , an−1 = bn−1 , . . . , a0 = b0 .

Proof. We have
an xn + an−1 xn−1 + · · · + a1 x + a0 ≡ bn xn + bn−1 xn−1 + · · · + b1 x + b0 . (38)
Differentiating both sides n times, we obtain
an n! = bn n!
and so
an = bn .
Hence from (38)
an−1 xn−1 + · · · + a1 x + a0 ≡ bn−1 xn−1 + · · · + b1 x + b0 .
Now on differentiating (n − 1) times, we obtain in the same way that
an−1 = bn−1 ,
and proceeding in this manner the desired conclusion is reached.

Example 9.1

Suppose 3x2 − 2x + 5 ≡ ax2 + bx + c.


Then a = 3, b = −2, and c = 5.

43
Equating Coefficients
This process is known as equating coefficients.

Example 9.2

Suppose 5 ≡ Ax3 + Bx2 + Cx + D.


Then A = B = C = 0 and D = 5.

Corollary 9.4 Suppose p and q are as in Theorem 9.3, r is a polynomial and that
p(x) q(x)

r(x) r(x)

for all x such that r(x) 6= 0. Then

an = bn , an−1 = bn−1 , . . . , a0 = b0

and p(x) ≡ q(x) for all x ∈ R.

Proof. Firstly note that any polynomial r is zero at only finitely many points. Thus we may
find an interval (a, b) on which r(x) 6= 0. Since p(x)/r(x) ≡ q(x)/r(x) on (a, b) then p(x) ≡ q(x)
on (a, b) and the conclusion follows from Theorem 9.3.

Partial Fractions
Example 9.3

1 A B
Suppose ≡ + , x 6= 3, −5. Find A and B.
(x − 3)(x + 5) x−3 x+5

Solution

The right-hand side may be rewritten as


A(x + 5) + B(x − 3)
.
(x − 3)(x + 5)
Thus
1 A(x + 5) + B(x − 3)
≡ , x 6= 3, −5. (39)
(x − 3)(x + 5) (x − 3)(x + 5)
Hence by Corollary 9.4

1 ≡ A(x + 5) + B(x − 3) for all x. (40)

We may now proceed in one of two ways. Firstly we may rewrite this as

1 ≡ (A + B)x + (5A − 3B).

Equating coefficients, it follows that

A+B =0

and
5A − 3B = 1,

44
whence A = 1/8 and B = −1/8.
Alternatively, setting x = −5 in (40), we have

1 = −8B

and letting x = 3 again in (40), we obtain

1 = 8A

(Note that we could not set x = −5 in (39), which is why Corollary 9.4 was needed.)
Finally we arrive at
1 1h 1 1 i
= − .
(x − 3)(x + 5) 8 x−3 x+5

The process outlined above is known as a decomposition into partial fractions.

Example 9.4

1
Decompose into partial fractions .
x2 + 3x − 10

Solution

We have
1 1
= .
x2 + 3x − 10 (x + 5)(x − 2)
Now let
1 A B
≡ + , x 6= 2, −5.
(x + 5)(x − 2) x+5 x−2
Then, as before,
1 ≡ A(x − 2) + B(x + 5)
for all x.
Letting x = 2 and −5 respectively yields

1 = −7A and 1 = 7B.

Thus
1 1h 1 1 i
= − .
x2 + 3x − 10 7 x−2 x+5

The same idea works when the denominator has three factors.

Example 9.5

6x + 6
Decompose into partial fractions .
x3 + 4x2 + x − 6

Solution

Using the remainder theorem it is easy to see that


6x + 6 6x + 6
= .
x3 + 4x2 + x − 6 (x − 1)(x + 2)(x + 3)

45
Thus we set
6x + 6 A B C
= + + .
x3 2
+ 4x + x − 6 x−1 x+2 x+3
Then
6x + 6 ≡ A(x + 2)(x + 3) + B(x − 1)(x + 3) + C(x − 1)(x + 2).
Putting x = −2 gives −6 = −3B so B = 2,
while x = −3 yields −12 = 4C so that C = −3
and setting x = 1, we have 12 = 12A so A = 1.
Thus
6x + 6 1 2 3
= + − .
(x − 1)(x + 2)(x + 3) x−1 x+2 x+3

In the case that the numerator is a polynomial whose order is greater than or equal to that
of the denominator, we must first divide.

Example 9.6

x3 + 5x2 + 7x + 6
Decompose into partial fractions .
x2 + 3x + 2

Solution

Since the numerator is cubic and the denominator is quadratic, we first divide to obtain

x3 + 5x2 + 7x + 6 2−x
= x+2+
x2 + 3x + 2 (x + 1)(x + 2)
A B
= x+2+ + .
x+1 x+2
Then
A(x + 2) + B(x + 1) ≡ 2 − x.
Hence A = 3 and B = −4. Finally

x3 + 5x2 + 7x + 6 1h 3 4 i
= x + 2 + − .
x2 + 3x + 2 3 x+1 x+2

Now let us attempt some integrations using partial fractions.

Example 9.7
Z
dx
Evaluate .
x2 − x − 2

Solution

First we decompose the integrand into partial fractions. After factorising, we have
1 A B
= + .
x2 − x + 2 x+1 x−2
Then
1 ≡ A(x − 2) + B(x + 1).
Hence
A = −1/3 and B = 1/3.

46
So
Z Z
dx 1 ³ 1 1 ´
= − dx
x2 − x − 2 3 x−2 x+1
1
= {ln |x − 2| − ln |x + 1|} + C
3
1 ¯¯ x − 2 ¯¯
= ln ¯ ¯ + C.
3 x+1

Example 9.8
Z 2
x2 + x + 1
Evaluate dx.
0 2x2 − 5x − 3

Solution

Since both numerator and denominator are quadratic, we must first divide. Thus

x2 + x + 1 1 1 7x + 5
= +
2x2 − 5x − 3 2
2 2 2x − 5x − 3
1 1 7x + 5
= +
2 2 (2x + 1)(x − 3)

Set
7x + 5 A B
= + .
(2x + 1)(x − 3) 2x + 1 x − 3
Then
7x + 5 ≡ A(x − 3) + B(2x + 1).
Letting x = 3, we have 26 = 7B, or B = 26/7,
while putting x = −1/2 gives −7/2 + 5 = −7A/2, so that A = −3/7.
Thus the integral becomes
Z Z ³ 26 ¯2
2
1 1 2
3 ´ ¯ 1³ 3 ´¯2
¯
dx + − dx = x/2¯ + 26 ln |x − 3| − ln |2x + 1| ¯
0 2 14 0 x − 3 2x + 1 0 14 2 0
1³ 3 ´
= 1+ − 26 ln 3 − ln 5 .
14 2

Example 9.9
Z 3
dx
Evaluate .
−1 x2 +x−2

Solution

Now beware!
1 1
=
x2 + x − 2 (x + 2)(x − 1)
which is not defined in the region of integration (at x = 1), so that the integral does not
exist.

Up to now we have dealt with the case where the denominator may be factorized inot distinct
linear factors. If the factors are repeated, we must use slightly different tactics.

47
Example 9.10
Z
4
Evaluate dx.
(x − 1)(x + 1)2

Solution

We start by decomposing the integrand into partial fractions. If we try

4 A B
= + (41)
(x − 1)(x + 1)2 (x + 1)2 x−1

then
4 ≡ A(x − 1) + B(x + 1)2 .
Setting x = 1 gives 4 = 4B so that B = 1. On the other hand, equating the coefficent of
x2 gives B = 0! This seeming paradox arises because the decomposition (41) is not of the
correct form. Let us start again with

4 A B C
2
= + 2
+ .
(x − 1)(x + 1) x + 1 (x + 1) x−1

Then
4 ≡ A(x + 1)(x − 1) + B(x − 1) + C(x + 1)2 . (42)
Setting x = 1 and x = −1 gives

4 = 4C and 4 = −2B

respectively, so that
B = −2 and C = 1.
To find A we equate the coefficient of x2 in (42) to obtain

0 = A + C.

Thus A = −1 and the integral becomes


Z µ ¶
−1 −2 1 2
+ 2
+ dx = ln |x − 1| − ln |x + 1| + + C.
x + 1 (x + 1) x−1 x+1

In general if there is a repeated linear factor of the form (x+α)n in the denominator, try partial
fractions of the form
A1 A2 An
+ + ··· + .
(x + α) (x + α)2 (x + α)n
For example, if we considered
1
(x + 1)(x + 2)2 (x + 3)3
then we would have a decomposition of the form

A B C D E F
+ + + + + .
x + 1 x + 2 (x + 2)2 x + 3 (x + 3)2 (x + 3)3

Sometimes the denominator contains a quadratic which does not factorize.

48
Example 9.11

x+1
Decompose into partial fractions.
(x2 + x + 1)(x + 2)

Solution

First observe that x2 + x + 1 has no (real) factors. Now write


x+1 Ax + B C
= 2 + .
(x2 + x + 1)(x + 2) x +x+1 x+2
Then
x + 1 ≡ (Ax + B)(x + 2) + C(x2 + x + 1).
Setting x = −2 gives
−1 = 3C
so C = −1/3.
Equating the coefficients of x2 and x yields
0=A+C
and
1 = 2A + B + C
and so A = 1/3 and B = 2/3. Hence
½ ¾
x+1 1 x+2 1
= − .
(x2 + x + 1)(x + 2) 3 x2 + x + 1 x + 2

Partial fractions are also useful in a number of other contexts. We give one illustration.

Example 9.12

1 1 1
Evaluate + + ··· + .
1.2 2.3 n(n + 1)

Solution

Let
1 A B
≡ + .
k(k + 1) k k+1
Then
1 ≡ A(k + 1) + Bk,
from which it easily follows that A = 1 and B = −1 and so
1 1 1
= − .
k(k + 1) k k+1
Thus
1 1 1 ³ 1´ ³1 1´ ³1 1 ´
+ + ··· + = 1− + − + ··· + − .
1.2 2.3 n(n + 1) 2 2 3 n n+1
All the terms except the first and last cancel out and we have
1 1 1 1 n
+ + ··· + =1− = .
1.2 2.3 n(n + 1) n+1 n+1

It is instructive to prove this also by induction.

49
10 Hyperbolic Functions
We now define two more elementary functions whose inverses, suitably defined, are useful in
integration.

Hyperbolic sine and cosine


Definition 10.1 The hyperbolic sine of x, sinh x, is defined by

ex − e−x
sinh x = ,
2
and the hyperbolic cosine of x, cosh x, by

ex + e−x
cosh x = .
2

These are generally pronounced “sinch” and “cosh”. One of the reasons for the names is their
resemblance to the trigonometric functions sin and cos. We list a few elementary results to
illustrate this point.

1.
cosh2 x − sinh2 x = 1 (43)
2
(This is similar to the trigonometric result cos2 x + sin x = 1.) Equation (43) is easy to
prove, since
h ex + e−x i2 h ex − e−x i2
cosh2 x − sinh2 x = −
2 2
= (e2 x + 2 + e−2x − e2x + 2 − e2x )/4
= 1.

2. sinh 2x = 2 sinh x cosh x. For

2 sinh x cosh x = (ex − e−x )(ex + e−x )/2


= (e2x − e−2x )/2
= sinh 2x.

3. sinh(x + y) = sinh x cosh y + cosh x sinh y.

Indeed all the basic trigonometric identities translate directly with the exception that if there
is a term involving the product of two sines, the sign must be changed in the corresponding
hyperbolic identity. Thus, since

cos(x + y) = cos x cos y − sin x sin y

then
cosh(x + y) = cosh x cosh y + sinh x sinh y.
Also since
cos 2x = 1 − 2 sin2 x,
then
cosh 2x = 1 + 2 sinh2 x.

50
The name “hyperbolic” stems from the fact that if

x = cosh θ and y = sinh θ

then by (43)
x2 − y 2 = 1,

which is the equation of hyperbola.


By analogy with trigonometric functions we also define

sinh x 1 1 cosh x
tanh x = , sech x = , cosech x = , coth x = .
cosh x cosh x sinh x sinh x

The derivatives of hyperbolic functions obey even simpler rules than those of trigonometric
functions. Thus
d d ³ ex + e−x ´ ex − e−x
cosh x = = = sinh x
dx dx 2 2
and
d d ³ ex − e−x ´ ex + e−x
sinh x = = = cosh x.
dx dx 2 2

Derivatives of sinh and cosh


Thus
d d
cosh x = sinh x and sinh x = cosh x (44)
dx dx

The graphs of these functions are important in what follows.


Firstly note that cosh is an even function, while sinh is odd. Also as x → ∞, e−x → 0, so
that for large x
cosh x ≈ ex /2 and sinh x ≈ ex /2,

although cosh x > ex /2 while sinh x < ex /2, for x > 0.


Furthermore,

cosh 0 = (e0 + e0 )/2 = 1, while sinh 0 = (e0 − e0 )/2 = 0.

cosh x

1
ex /2

sinh x

Figure 10.1

51
Now it is clear from the graphs that sinh is one-to-one, but cosh is not. Hence sinh−1 is
defined without any more trouble by

y = sinh x if and only if x = sinh−1 y.

In the case of cosh we must first restrict ourselves to non-negative values of x, so that cosh
becomes one-to-one. Thus

y = cosh x if and only if x = cosh−1 y provided x ≥ 0.

Now let us see how hyperbolic functions are useful in integration. Consider the integral
Z
dx
√ .
x2 − a2
Let
x = a cosh u
−1
(that is u = cosh (x/a)). We have

dx = a sinh u du,

and

x2 − a2 = a2 cosh2 u − a2
= a2 sinh2 u

by (43). The integral becomes


Z
a sinh u
du = u+C
a sinh u
= cosh−1 (x/a) + C.

Similarly if we consider the integral Z


dx

x2+ a2
and set x = a sinh u, then dx = a cosh u du and

x2 + a2 = a2 sinh2 u + a2 = a2 cosh2 u.

The integral reduces to


Z
du = u+C

= sinh−1 (x/a) + C.

Integrals of (x2 ± a2 )−1/2


We have obtained the standard integrals
Z
dx
√ = cosh−1 (x/a) + C for |x| ≥ |a| (45)
x2− a2

and
Z
dx
√ = sinh−1 (x/a) + C (46)
x2 + a2

52
Example 10.1
Z 5
dx
Evaluate √ .
4 x2 − 9

Solution

Using (45) we have


¯5
¯
cosh−1 (x/3)¯ = cosh−1 (5/3) − cosh−1 (4/3).
4

Example 10.2
Z 5
dx
Evaluate √ .
0 x2 − 4

Solution

Beware! The integral does not exist, since the integrand is undefined for |x| ≤ 2.

Example 10.3
Z
dx
Evaluate √ .
4x2 + 25

Solution

We have Z
1 dx 1
p = sinh−1 (2x/5) + C.
2 x2 + 25/4 2

Example 10.4
Z
dx
Evaluate √ .
x2 − 6x + 5

Solution

Completing the square, we obtain


Z
dx x−3
p = cosh−1 + C.
2
(x − 3) − 4 2

11 Numerical Integration
The impression may now have been given that almost any function may be integrated after
sufficient labour. Unfortunately this is not the case. None of the integrals below may be
evaluated in terms of other elementary functions:
Z Z Z
x2 2
e dx, sin x dx, cos(1/x) dx.
Z
2 2
Do not believe that ex dx = ex /2x + C. If you do, try differentiating the right-hand side.
The point is

53
THERE IS NO CHAIN RULE FOR INTEGRATION.

However, in many cases we need only to know the value of a definite integral. In this case we
may evaluate the integral by an approximation to any degree of accuracy we desire. This pro-
cess, known as numerical integration, was difficult to use until comparatively recently, when
the advent of computers made the enormous amount of arithmetic work involved a relatively
simple task.
Suppose then we wish to evaluate
Z b
f (x) dx
a

where f is some given function defined on the interval [a, b]. Divide up [a, b] by the points

a = x0 < x1 < x2 < · · · < xn = b,

where
xi − xi−1 = h, i = 1, . . . , n.
For simplicity let us denote f (xi ) by fi .
...
..
.. ..
.. ..
.. ..
.. ..
..
.. ... .. .. .. ..
.. ..
... .. ... ... .. ...
.. .. .. .. .. ..
.. .. .. .. .. ..
.. .. .. .. .. ..
f0 .... f1 .... f2 .... ... f4 .... f5 .... f6 ....
... ... ... f3 .... ... ... ...
.. .. .. .. .. ..
.. .. . ... .. .. ..
. . . . . .
x0 x1 x2 x3 x4 x5 x6
¾ h -¾ h -

Figure 11.1

Figure 11.1 illustrates the situation when n = 6.


Now connect the points (x0 , f0 ) to (x1 , f1 ), (x1 , f1 ) to (x2 , f2 ), . . . , (xn−1 , fn−1 ) to (xn , fn )
as shown in Figure 11.1, by straight line segments. Then the area under the curve, which is
just the integral, is approximately the sum of the areas of the trapezia so formed.
The area of the first trapezium is

h(f0 + f1 )/2

of the second
h(f1 + f2 )/2
and so on.

Trapezium Rule
We obtain
Z b
f (x) dx ≈ h(f0 + f1 )/2 + h(f1 + f2 )/2 + · · · + h(fn−1 + fn )/2
a

54
or
Z b
f (x) dx ≈ h[(f0 + fn )/2 + f1 + f2 + · · · + fn−1 ]. (47)
a

This is known at the Trapezium Rule, for obvious reasons.

Example 11.1
Z 1
Evaluate x2 dx using the trapezium rule, first with four strips, then with eight strips.
0

Solution

Of course we know the exact value is 1/3, but we wish to start with a simple example. Also
we shall be able to see how the accuracy is affected by the number of strips.
...
...
..
..
...
..
..
.. ...
... ..
..
.. ..
.. ..
... ..
..
.. ... ..
..
..
... .. ..
..
.. .. ..
. .. .. ...
x0 x1 x2 x3 x4 = 1

Figure 11.2

With four strips we have


x0 = 0, x1 = 1/4, x2 = 1/2, x3 = 3/4 and x4 = 1.
Since fi = f (xi ) = xi 2 , this gives
f0 = 0, f1 = 1/16, f2 = 1/4, f3 = 9/16 and f4 = 1.
Hence by (47) with n = 4 and h = 1/4
Z 1
x2 dx ≈ [(0 + 1)/2 + (1/16 + 1/4 + 9/16)] = 11/32 = 0.34375.
0

Since the correct value is 1/3, we have an error of


11/32 − 1/3 ≈ 0.01042.
Now with eight strips we have n = 8, h = 1/8 and

f0 = 0, f1 = 1/64, f2 = 1/16, f3 = 9/64, f4 = 1/4, f5 = 25/64, f6 = 9/16, f7 = 49/64


and f8 = 1.

This gives the approximation


[(0 + 1)/2 + (1/64 + 1/16 + 9/64 + 1/4 + 25/64 + 9/16 + 49/64)] = 43/128 = 0.3359375.
The error is then
43/128 − 1/3 ≈ 0.0026,
which is considerably more accurate than before – it is in fact just four times as accurate.

55
From this we see that to obtain a really good approximation it would be desirable to use a
very large number of strips, say 1000. Of course, the arithmetic involved would then become
prohibitive.
While the trapezium rule is easy to derive and to use, it is not particularly accurate. A
far better method is Simpson’s Rule. In this we approximate the curve by a number of
parabolic arcs. Now any parabola is totally determined by three points. Let us then find the
area under a parabola through three given points (see Figure 11.3). For simplicity let the points
be (−h, f0 ), (0, f1 ) and (h, f2 ) and the parabola be

f (x) = ax2 + bx + c.

..
..
f1 ..
.. .
..
. f2 ....
f0 .... ..
..
.. ..
−h h

Figure 11.3

Then the area under the parabola is


Z h ¯h
¯
(ax2 + bx + c) dx = (ax3 /3 + bx2 /2 + cx)¯
−h −h
h
= (2ah2 + 6c).
3
Now the parabola passes through the points (−h, f0 ), (0, f1 ) and (h, f2 ). So

ah2 − bh + c = f0
c = f1
2
ah + bh + c = f2 .

Multiplying the middle equation by 4 and adding all three, we have

2ah2 + 6c = f0 + 4f1 + f2 .

Hence the area under the parabola is


h
(f0 + 4f1 + f2 ). (48)
3
Now returning to the original problem, we wish to approximate
Z b
f (x) dx.
a

Divide up the interval [a,b] into an even number, 2n, of strips of width h by the points

a = x0 < x1 < x2 < · · · < x2n−2 < x2n−1 < x2n = b

where
xi − xi−1 = h, i = 1, . . . , 2n.
The case where 2n = 4 is illustrated in Figure 11.4.

56
Parabolic arcs
..
..
... ® R ...
.. ..
.. ..
.. ...
.. .. .. ..
.. .. .. ..
.. .. .. ..
.. .. .. .. ...
. .. . . ..
f0 .... f1 .... f2 .... f3 .... f4 ....
.. .. .. .. ..
.. .. .. .. ..
.. .. .. .. ..
x0 x1 x2 x3 x4

Figure 11.4

Now we approximate the area under the curve by the sum of the areas under the parabolic
arcs shown.

Simpson’s Rule
Then using (48)
Z b
h h h
f (x) dx ≈ (f0 + 4f1 + f2 ) + (f2 + 4f3 + f4 ) + · · · + (f2n−2 + 4f2n−1 + f2n )
a 3 3 3
or
Z b
h£ ¤
f (x) dx ≈ (f0 + f2n ) + 2(f2 + f4 + · · · + f2n−2 ) + 4(f1 + f3 + · · · + f2n−1 ) . (49)
a 3

This is known as Simpson’s Rule.


To illustrate how accurate it is, let us try to approximate
Z 1
ex dx
0

using Simpson’s rule with only 4 strips. We know the correct value is

e − 1 ≈ 1.7182818.

Now with 4 strips x0 = 1, x1 = 1/4, x2 = 1/2, x3 = 3/4 and x4 = 1, so that

f 0 = e0 = 1.0000000
f1 = e1/4 = 1.2840245
f2 = e1/2 = 1.6487213
f3 = e3/4 = 2.1170000
f 4 = e1 = 2.7182818,

and clearly h = 0.25. Thus using (49)


Z 1
0.25
ex dx ≈ [(f0 + f4 ) + 2f2 + 4(f1 + f3 )] = 1.7183188,
0 3

with an error of only about 3.7 × 10−5 . By way of contrast, the trapezium rule gives an error
of about 10−2 . It is this high degree of accuracy which makes Simpson’s rule such a favourite
tool in numerical integration.

57

Вам также может понравиться