0% found this document useful (0 votes)
19 views13 pages

RL20 2022

computational math revision lecture

Uploaded by

Thando Lundwe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views13 pages

RL20 2022

computational math revision lecture

Uploaded by

Thando Lundwe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

APPM1004 — Revision Lectures 1

Revision Lecture # 20
Numerical Integration

Outcomes of this lecture


After studying this lecture and practising examples,you will be able to:

1.) Use both Trapezium Rule and Simpson’s Rule to approximate


Z b
ˆ f (x) dx ,
a
ˆ the area under a curve given the points on the curve at regular intervals and

ˆ the total change in a quantity given a table of rates of change of the same quantity.

2.) Evaluate the above approximations for the definite integral, using the shortcut1 buttons
and the M+ memory of the Casio FC-100V calculator.

Pre-knowledge and Skills


You will need to be completely familiar with

1.) function notation.

2.) using the memory functions of a calculator.

3.) the relationship between the concepts of the area under the graph of a function and the
definite integral of the function.
APPM1004 — Revision Lectures 2

Revision Lecture # 20
Numerical Integration

Introduction
Many integrals can be very difficult, if not impossible, to find. Therefore numerical methods
provide a very useful tool for approximating the values of definite integrals without having
to find algebraic solutions for the integral itself.
Z b
ˆ If f (x) > 0 on [ a , b ], the definite integral, f (x) dx is equal to the area between
a
f (x) and the x−axis over the interval [ a , b ], therefore an approximation of the area
automatically gives an approximation of the definite integral.

ˆ In this lecture two methods are discussed.

◦ The trapezium rule,which approximates an area using trapezia.

The areas of the trapezia covering the area under the graph, are calculated geo-
metrically and added together.

◦ Simpson’s Rule which uses parabolas to approximate the curve.


APPM1004 — Revision Lectures 3

Revision Lecture # 20
Numerical Integration
Z b
ˆ To approximate the value of the definite integral, f (x) dx,
a
apply the following three steps.

Step 1.

◦ Divide the interval [ a , b ], into n sub-intervals as follows.


b−a
* Given n, calculate 4x = .
n
* Use 4x to create a sequence of values for x:

x1 = a ; x2 = a + 4x ; x3 = x2 + 4x ; . . . xn+1 = xn + 4x = b.
NB: There will always be n + 1 values of x when there are n sub-intervals.

Step 2.

◦ Find the corresponding function values.

◦ Substitute the x values from Step 1. into the given function f (x):

f (x1 ) , f (x2 ) , f (x3 ) , . . . , f (xn+1 ) .

NB: Do not attempt to integrate the given function.

Step 3.

◦ Substitute the sequence of function values from Step 2. into the appropriate
formula.

(a) Trapezium rule.


Z b  
1 1
f (x) dx ≈ 4x f (x1 ) + f (x2 ) + · · · + f (xn ) + f (xn+1 )
a 2 2

(b) Simpson’s rule (can only be used when n is even).


 
Z b
4x 
f (x) dx ≈ f (x1 ) + 4f (x2 ) + 2f (x3 ) + · · · + 4f (xn ) + f (xn+1 )

a 3 | {z }
repeats
APPM1004 — Revision Lectures 4

Revision Lecture # 20
Numerical Integration

ˆ Example 1 Z 8
2
Approximate the definite integral e0,1x dx using,
3

1. The trapezium rule and

2. Simpson’s rule

with n = 4.

Step 1.

ˆ Divide the interval [ 3 , 8 ], into 4 sub-intervals as follows.


8−3
◦ n = 4 ⇒ 4x = = 1, 25.
4
◦ Create a sequence of values for x:
x1 = 3 = 3=a
x2 = 3 + 1, 25 = 4, 25
x3 = 4, 25 + 1, 25 = 5, 5
x4 = 5, 5 + 1, 25 = 6, 75
x5 = 6, 75 + 1, 25 = 8 = b.

Step 2.

ˆ Find the corresponding function values.


2
f (3) = e0,1(3) = 2, 459603 . . .
2
f (4, 25) = e0,1(4,25) = 6, 0875761 . . .
2
f (5, 5) = e0,1(5,5) = 20, 5940047 . . .
0,1(6,75)2
f (6, 75) = e = 95, 22571301 . . .
2
f (8) = e0,1(8) = 601, 845037 . . .
APPM1004 — Revision Lectures 5

Revision Lecture # 20
Numerical Integration

Step 3. Substitute the sequence of function values from Step 2. into the appropriate
formula.

(a) Trapezium rule.


Z 8 h i
2 2 2 2 2 2
e0,1x dx ≈ (1, 25) 21 e0,1(3) + e0,1(4,25) + +e0,1(5,5) + e0,1(6,75) + 12 e0,1(8)
3
 
2, 459 . . . 601, 845 . . .
≈ (1, 25) + 6, 087 · · · + 20, 594 . . . + 95, 225 . . . +
2 2

≈ 530, 0745 . . .
−−−−−−−−−→

(b) Simpson’s rule (can only be used when n is even).


Z 8
0,1x2 1, 25 h 0,1(3)2 0,1(4,25)2 0,1(5,5)2 0,1(6,75)2 0,1(8)2
i
e dx ≈ e + 4e + 2e + 4e +e
3 3
1, 25
≈ [2, 459 . . . + 4(6, 087 . . . ) + 2(20, 594 . . .) + 4(95, 225 . . .) + 601, 845 . . .]
3

≈ 437, 810 . . .
−−−−−−−−→

To use the CASIO FC-100v to make these evaluations,

1. Key in the function formula using ‘Ans’ in place of x.

2. Store the formula in a shortcut.

3. Check the formula with a test value.

4. Clear the M+ memory.

5. Enter the x values one at a time, use the shortcut to calculate the function values
and then multiply by the appropriate coefficient as required by the rule used.

6. Add the value to the M+ memory.


∆x
7. Recall the memory and multiply by either ∆x or as required by the rule used.
3
8. See a more detailed explanation for these steps at the end of this lecture.
APPM1004 — Revision Lectures 6

Revision Lecture # 20
Numerical Integration

ˆ When no formula is given

ˆ Approximating the area under a graph over an interval [ a , b ], when no function


formula is given.
b−a
Step1. Calculate ∆x = as before. (n is given)
n

Step2. Identify the sequence of x values.


x1 = a ; x2 = a + 4x ; x3 = x2 + 4x ; . . . xn+1 = xn + 4x = b.

Step3. Read off the function values that correspond to the above x values, from
the graph, and then substitute them into the required formula.

ˆ Approximating the total change in a quantity given a table of marginal values of


the quantity, ranging from x = a to x = b.
b−a
Step1. Calculate ∆x = as before. (n is given)
n

Step2. Identify the sequence of x values.


x1 = a ; x2 = a + 4x ; x3 = x2 + 4x ; . . . xn+1 = xn + 4x = b.

Step3. Read off the marginal values that correspond to the above x values, from
the table, and then substitute them into the required formula.

ˆ In both the above cases take care to enter the function values that correspond to
the x values into the formula and not just the x values. This is a common error.
APPM1004 — Revision Lectures 7

Revision Lecture # 20
Exercises
1 000
1. The marginal revenue when x units are sold is R0 (x) = rands per unit.
x2
Use the trapezium rule with n = 4 to approximate (rounded to the nearest
cent) the change in revenue if the number of units sold increases from five to
eight.

2. In the table below x represents the number of units of a product that are
produced and C 0 (x) is the marginal cost in rands per unit.
x 0 20 40 60 80 100 120
C 0 (x) 230 234 240 250 260 268 275
Use Simpson’s rule with n = 6 to estimate (rounded to the nearest cent) the
total cost of producing the first 120 units.

3. The graph below shows the rate of change of the number of units produced by
dp
a worker per day, , for the first twelve days that the worker was employed.
dt

Use the trapezium rule with n = 4 and Simpson’s rule with n = 6 to approx-
imate the total number of units that the worker produced in the first twelve
days that he was employed.
APPM1004 — Revision Lectures 8

Revision Lecture # 20
Using the Shortcut and M+ functions.

ˆ The explanation that follows gives the calculator steps in detail for the Trapez-
ium rule approximation. These steps can be adapted to the calculation using
Simpson’s rule.

1. Use the shortcut to store the function formula as follows:


◦ Key in the formula using ‘Ans’ to stand for x,

taking care with the brackets.

◦ Press shift, then sto% to bring up the shortcut list

.
◦ With the shortcut1 selected, press exe, twice, and then clear, .
◦ The formula is now stored in the shortcut1.
2. Calculate the function value for a given x value.
◦ Enter the first x value, ‘3’, and make it the ‘Ans’ by pressing ‘exe’.

,
The 3 must be in the bottom right hand corner of the display.
◦ Call up shortcut1 by pressing shortcut1, then the stored foru-

mula will appear in the display , with the 3 below, ready


to be substituted into the formula.

2
◦ Press exe to get the result = e(0,1·3 ) .
◦ Check this result manually to make sure your stored formula is correct.
◦ For the Trapezium Rule, this first result must be divided by 2.

◦ Type ‘÷ 2’ then press:


APPM1004 — Revision Lectures 9

Revision Lecture # 20
Using the Shortcut and M+ functions.

3. Store the result in the M+ memory.

◦ Press shift, then sto% to get the memory list in the display.

◦ Scroll down until M is reached, , press exe, twice,


and then clear .
◦ The first result, divided by 2, is now stored in the M+ memory.
4. Add the other function values into M+.
◦ Enter the next x value, press exe, , press shortcut1, , then
press exe, again, to calculate the function value.

◦ Press M+, and then straightaway press clear .


◦ Be very very careful to press M+ , only once as it will add the
value again if you press it twice.
◦ Repeat the above steps with all the remaining values except the last one
which must be divided by 2 before being added to M+.
5. Recall M+ and calculate the final answer.

◦ Press alpha , then M+ and then exe , to recall the total


from M+

◦ Multiply by the value of ∆x = 1, 25

then press to get the final result. .

You might also like