Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

Integration of single variable functions

MAT9004 - Week 4 - Lecture 7


Topics for today

What are integrals

Antiderivatives

Examples

Properties of integrals

MAT9004 Lecture 7 Slide 2/26


The use of integrals

Integrals give the total change to a function’s value in an


interval for which the rate of change (derivative) is known.
E.g.: We can use integrals to determine the distance travelled
in a time period given the speed at all instants during that
time.
Integrals yield areas enclosed by functions
E.g.: We can use integrals to derive the area or volume of
‘complicated’ objects
Integrals are a basic concept needed for probability theory.
E.g.: A lot of important probability distributions in statistics
are ‘continuous’: Probability, expectation, variance and other
important quantities are defined or derived using integrals.

MAT9004 Lecture 7 Slide 3/26


Integrals
The definite integral of f between a and b is the signed
area bounded by f , the x-axis and the vertical lines x = a
and x = b. ‘Signed area’ means that areas below the x-axis
get a negative value. We write this definite integral as
Z b
f (x)dx.
a

MAT9004 Lecture 7 Slide 4/26


Examples

Z 2 Z 1
x dx = 2 x dx = 0
0 1

MAT9004 Lecture 7 Slide 5/26


Decomposing areas

Problem: Find the area of the region shown,


bounded by the y -axis, the parabola y = x 2 ,
and the line y = 2x 1, in terms of definite
integrals.
Solution: Areas A, B and C satisfy
Z 1
A+B = x 2 dx
0
Z 1
B C = (2x 1) dx.
0

Subtracting the equations gives


Z 1 Z 1
A+C = x 2 dx (2x 1) dx.
0 0
MAT9004 Lecture 7 Slide 6/26
Antiderivatives

A function F is an antiderivative of f if F 0 = f .

Examples.
F (x) = e x is an antiderivative of f (x) = e x
F (x) = 12 x 2 is an antiderivative of f (x) = x
F (x) = 12 x 2 + 2 is also an antiderivative of f (x) = x

The antiderivative of f (if it exists) is unique up to an additive


constant.

Why?

MAT9004 Lecture 7 Slide 7/26


Antiderivatives

A function F is an antiderivative of f if F 0 = f .

Examples.
F (x) = e x is an antiderivative of f (x) = e x
F (x) = 12 x 2 is an antiderivative of f (x) = x
F (x) = 12 x 2 + 2 is also an antiderivative of f (x) = x

The antiderivative of f (if it exists) is unique up to an additive


constant.

Why? If F is an antiderivative of f , then so is F + c for any


constant c. On the other hand, if F and G are antiderivatives of f ,
then
(F G )0 = F 0 G 0 = f f = 0,
so F G is a constant function.
MAT9004 Lecture 7 Slide 7/26
How to find antiderivatives?

Here are some functions f with an antiderivative F .


1
If f (x) = x a with a 6= 1, then F (x) = a+1 x
a+1 .

If f (x) = x 1, then F (x) = ln(x).


If f (x) = e ax with a 6= 0, then F (x) = 1a e ax .
Computer programs can find antiderivatives quite well so you don’t
need to learn more complicated methods.

Side note: Some antiderivatives can’t be written down with


elementary functions, for example, it’s not possible to write down
2
an antiderivative of f (x) = e x using elementary function (we
come to this later today.)

MAT9004 Lecture 7 Slide 8/26


Fundamental Theorem of Calculus

The following result links a definite integral of f (which is the area


under a graph) to its antiderivative F :

If F is any antiderivative of f then


Z b
f (x)dx = F (b) F (a).
a

This amazing fact is the Fundamental Theorem of Calculus!


It shows that Z x
G (x) = f (z)dz
a
is an antiderivative of f (x).

MAT9004 Lecture 7 Slide 9/26


Examples
R2
Example. Let f (x) = x 2. What is 0 f (x)dx?

MAT9004 Lecture 7 Slide 10/26


Examples
R2
Example. Let f (x) = x 2. What is 0 f (x)dx?
First step: Find an antiderivative. In this case F (x) = 13 x 3 .
Second step: Use FTC (Fundamental Theorem of Calculus):
Z 2
1 8
f (x)dx = F (2) F (0) = 23 0= .
0 3 3

MAT9004 Lecture 7 Slide 10/26


Examples
R2
Example. Let f (x) = x 2. What is 0 f (x)dx?
First step: Find an antiderivative. In this case F (x) = 13 x 3 .
Second step: Use FTC (Fundamental Theorem of Calculus):
Z 2
1 8
f (x)dx = F (2) F (0) = 23 0= .
0 3 3
R1
Example. Let f (x) = e 2x . What is 1 f (x)dx?

MAT9004 Lecture 7 Slide 10/26


Examples
R2
Example. Let f (x) = x 2. What is 0 f (x)dx?
First step: Find an antiderivative. In this case F (x) = 13 x 3 .
Second step: Use FTC (Fundamental Theorem of Calculus):
Z 2
1 8
f (x)dx = F (2) F (0) = 23 0= .
0 3 3
R1
Example. Let f (x) = e 2x . What is 1 f (x)dx?
First step: An antiderivative is F (x) = 12 e 2x .
Second step:
Z 1
1 2 2
f (x)dx = F (1) F ( 1) = e e .
1 2

MAT9004 Lecture 7 Slide 10/26


Indefinite integral

If F is an antiderivative of f , then so is F + c for any constant c;


the constant c is called constant of integration.

If F is an antiderivative of f , then we also write


Z
f (x)dx = F (x)

and call it the indefinite integral of f

Technically, the indefinite integral of f is a family of functions,


namely {F (x) + c : c 2 R}, where F (x) is some antiderivative of f .

MAT9004 Lecture 7 Slide 11/26


Cartoon time

MAT9004 Lecture 7 Slide 12/26


Cartoon time

MAT9004 Lecture 7 Slide 13/26


Linearity

If f and g are functions and a < b, then


Z b Z b Z b
(f (x) + g (x)) dx = f (x)dx + g (x)dx.
a a a

If f is a function and c a constant then


Z b Z b
cf (x)dx = c f (x)dx.
a a

Examples.
R1 2 R1 2 R1 1
0 (x + 2x)dx = 0 x dx + 2 0 xdx = 3 + 2 ⇥ 12 .
R1 x
R1 x dx 1 ).
1 3e dx = 3 1e = 3(e e

MAT9004 Lecture 7 Slide 14/26


Quick test
Exercise
Compute the following integrals:
R2 3
(a) 2 x dx,
R2
(b) 1 (3x 2 + 1)dx,
R1 x
(c) 1 (e + 1)dx.

MAT9004 Lecture 7 Slide 15/26


Solutions
R 2
(a) 2x
3 dx. An antiderivative of x 3 is F (x) = 14 x 4 , so
Z 2
x 3 dx = F (2) F ( 2) = 0.
2
The ‘positive’ area of f from 0 to 2 cancels with the ‘negative’
area from 2 to 0.

MAT9004 Lecture 7 Slide 16/26


Solutions
R 2
(a) 2x
3 dx. An antiderivative of x 3 is F (x) = 14 x 4 , so
Z 2
x 3 dx = F (2) F ( 2) = 0.
2
The ‘positive’ area of f from 0 to 2 cancels with the ‘negative’
area from 2 to 0.
R2
(b) 1 (3x 2 + 1)dx. Linearity yields
Z 2 Z 2 Z 2
(3x 2 + 1)dx = 3 x 2 dx + 1dx
1 1 1
✓ ◆
1 3 1 3
=3 2 1 + (2 1) = 8.
3 3

MAT9004 Lecture 7 Slide 16/26


Solutions
R 2
(a) 2x
3 dx. An antiderivative of x 3 is F (x) = 14 x 4 , so
Z 2
x 3 dx = F (2) F ( 2) = 0.
2
The ‘positive’ area of f from 0 to 2 cancels with the ‘negative’
area from 2 to 0.
R2
(b) 1 (3x 2 + 1)dx. Linearity yields
Z 2 Z 2 Z 2
(3x 2 + 1)dx = 3 x 2 dx + 1dx
1 1 1
✓ ◆
1 3 1 3
=3 2 1 + (2 1) = 8.
3 3
R1 x + 1)dx.
(c) 1 (e Again using linearity
Z 1 Z 1 Z 1
1
(e x + 1)dx = e x dx + 1dx = (e ) + (1 ( 1)).
1 1 1 e
MAT9004 Lecture 7 Slide 16/26
Revisiting our example

We computed the area of the region bounded


by the y -axis, the parabola y = x 2 , and the
line y = 2x 1 to be
Z 1 Z 1
x 2 dx (2x 1) dx.
0 0

R1
Using linearity, we can write it as 0 (x 2 2x + 1) dx and find an
antiderivative ‘term by term’ to be 13 x 3 x 2 + 1. Then
Z 1
1 1 1 2
(x 2 2x + 1) dx = 13 12 + 1 ( 03 02 + 1) = 1= .
0 3 3 3 3

Negative area? Impossible! Spot the error.

MAT9004 Lecture 7 Slide 17/26


Revisiting our example

We computed the area of the region bounded


by the y -axis, the parabola y = x 2 , and the
line y = 2x 1 to be
Z 1 Z 1
x 2 dx (2x 1) dx.
0 0

R1
Using linearity, we can write it as 0 (x 2 2x + 1) dx and find an
antiderivative ‘term by term’ to be 13 x 3 x 2 + x. Then
Z 1
1 1 1
(x 2 2x + 1) dx = 13 12 + 1 ( 03 02 + 0) = .
0 3 3 3

MAT9004 Lecture 7 Slide 18/26


Quick test
Exercise
Later in the course, we will meet the uniform distribution on
[a, b]. We can think of it as a random real number evenly
spread between a and b. Its expectation is defined as
Z b
x
dx.
a b a

(a) Compute the expectation for a = 0 and b = 1.


(b) Find a general formula for arbitrary a and b.

MAT9004 Lecture 7 Slide 19/26


Rb x
Solution for a b a dx.
Part (a): With a = 0 and b = 1 the integral becomes
Z 1 ✓ ◆
1 2 1 2 1
x dx = 1 0 = .
0 2 2 2

Note that this is the middle of the interval [0, 1].

MAT9004 Lecture 7 Slide 20/26


Rb x
Solution for a b a dx.
Part (a): With a = 0 and b = 1 the integral becomes
Z 1 ✓ ◆
1 2 1 2 1
x dx = 1 0 = .
0 2 2 2

Note that this is the middle of the interval [0, 1].

Part (b): In general the linearity of integrals yields


Z b Z b ✓ ◆
x 1 1 1 2 1 2 1 b2 a2
dx = x dx = b a = .
a b a b a a b a 2 2 2 b a

MAT9004 Lecture 7 Slide 20/26


Rb x
Solution for a b a dx.
Part (a): With a = 0 and b = 1 the integral becomes
Z 1 ✓ ◆
1 2 1 2 1
x dx = 1 0 = .
0 2 2 2

Note that this is the middle of the interval [0, 1].

Part (b): In general the linearity of integrals yields


Z b Z b ✓ ◆
x 1 1 1 2 1 2 1 b2 a2
dx = x dx = b a = .
a b a b a a b a 2 2 2 b a

Note that b 2 a2 = (b + a)(b a). Hence


Z b
x a+b
dx = ,
a b a 2

which again is the middle of the interval [a, b].


MAT9004 Lecture 7 Slide 20/26
Another property of integrals

If a, b, c are real numbers with a < b < c then


Z c Z b Z c
f (x)dx = f (x)dx + f (x)dx.
a a b

This is useful if your function ‘looks di↵erent’ in certain areas.


Example. The following function has di↵erent definitions,
depending on whether x 6 1 or x > 1:
(
x, if x 6 1,
f (x) =
x 2 , if x > 1.

In this case
Z 2 Z 1 Z 2
1 1 2 1 3 1 3
f (x)dx = xdx + x 2 dx = 12 0 + 2 1
0 0 1 2 2 3 3
MAT9004 Lecture 7 Slide 21/26
Harder integrals
There are many sneaky ways to find integrals for functions. Since
they are inbuilt in packages such as Wolfram Alpha, there is no
need to learn them all for practical use. Here are a couple of
commonly occurring integrals.
A probability in the exponential distribution is
Z b
x
xe dx.
a
R x dx.
So we need xe
A probability in the standard normal distribution is
Z b
1 x 2 /2
p e dx.
2⇡ a
R x 2 /2 dx.
So we need e

MAT9004 Lecture 7 Slide 22/26


x x 2 /2
Integrating xe and e

Using Wolfram Alpha ...


R
xe x dx = e x (x + 1) + c.
Note that Wolfram Alpha writes ‘+constant’ instead of ‘+c’
for the arbitrary constant. We conclude
Z b
x a b
xe dx = e (a + 1) e (b + 1).
a
R x 2 /2 dx
p p
e = ⇡/2 erf(x/ 2) + c.
This integral is not representable in a simple way so the
function erf was invented long ago to represent such integrals.
You can compute erf(x) numerically for any x (using Wolfram
Alpha or similar).

MAT9004 Lecture 7 Slide 23/26


Derivative as a rate of change
We may be told the rate of change of a function and need to
compute the function itself. This can be done via integrals.
Example. The sun’s heating a swimming pool such that x hours
after 6am the rate is 10 sin(x⇡/12) Kw. Find the total amount of
heat energy (in KwH) absorbed by the swimming pool by 9am.
(Note: The argument of sin is in radians, and 1 Kw running for 1
hour gives 1 KhW of energy.)
Solution. The power in Kw is the rate of change of energy, and is
hence the slope of the energy function, or its derivative. Thus if
E (x) is the total amount of energy at time x, we have
E 0 (x) = 10 sin(x⇡/12). Then by the Fundamental Theorem of
Calculus,
Z 3 Z 3
E (3) E (0) = E 0 (x) dx = 10 sin(x⇡/12) dx.
0 0

We need to find E (3), which equals E (3) E (0) as E (0) = 0 here.


MAT9004 Lecture 7 Slide 24/26
Derivative as a rate of change

We need to find E (3) E (0) where


Z
E (x) = 10 sin(x⇡/12) dx.

Looking it up, we find


Z
120
10 sin(x⇡/12) dx = cos(x⇡/12) + c.

Choosing c = 0 to get one antiderivative, the Fundamental
Theorem gives the answer as
p
120 120 60(2 2)
cos(3⇡/12) + cos(0) = ⇡ 11.188KwH.
⇡ ⇡ ⇡

MAT9004 Lecture 7 Slide 25/26


Another example

The cost of manufacturing a battery decreases continuously at a


rate of (x + 1) 2 ($/pa) at a time x years after initial production.
If the starting cost is $5, what is the cost after 4 years?

MAT9004 Lecture 7 Slide 26/26


Another example

The cost of manufacturing a battery decreases continuously at a


rate of (x + 1) 2 ($/pa) at a time x years after initial production.
If the starting cost is $5, what is the cost after 4 years?
Solution. This time, the cost D(x) satisfies D 0 (x) = (x + 1) 2.

Hence the Fundamental Theorem gives


Z 4
D(4) D(0) = (x + 1) 2 dx.
0
R
We can find (by looking it up!) (x + 1) 2 dx = (x + 1) 1 +c
and so
4
D(4) D(0) = 5 1 1 1 = .
5
4 21
As D(0) = 5, this gives D(4) = 5 5 = 5 as the cost after 4
years.

MAT9004 Lecture 7 Slide 26/26

You might also like