b
Simpson’s rule is a more accurate way of
To approximate an integral, such as f ( x)dx ,
a
estimating integrals. Suppose the area is split into
n strips (n must be even), then
we can divide the area into n strips. Then b
h
h
ba
is the width of each strip. a f ( x)dx 3 { y0 yn 4( y1 y3 ... yn1 )
n
The formula for the trapezium rule is: 2( y2 y4 ... yn 2 )}
b
h h
a f ( x)dx 2 y0 yn 2( y1 y2 ... yn1 ) . Numerical solution of equations OR IN WORDS {ends + 4×odds + 2×evens} .
3
The equation f(x) = 0 has a solution (or root)
1 1.2
between x = a and x = b if f(x) changes sign in
e sin( x )dx
x2 2
Example: Find an approximation for dx Example: Find an approximation for
this interval. 0
1
using the trapezium rule with 6 ordinates. using Simpson’s rule with 6 strips.
(NB: 6 ordinates means 5 strips). Example: Show that the equation e x 6 2 x
has a root in the interval 1 < x < 2. 1.2 (0)
Solution: h 0.2
1 ( 1) 6
Solution: h 0.4
Solution: Rearrange to the form f(x) = 0:
5 x 0 0.2 0.4 0.6 0.8 1 1.2
x -1 -0.6 -0.2 0.2 0.6 1 ex 6 2 x ex 2 x 6 0 . y 0 0.040 0.159 0.352 0.597 0.841 0.991
y 2.718 1.433 1.041 1.041 1.433 2.718 Substitute in x = 1:
e x 2 x 6 e1 2 6 1.28... So,
So, Substitute in x = 2: b
0.2
b
f ( x )dx
0.4
2
2.718 2.718 2(1.433 1.041 1.041 1.433) e x 2 x 6 e2 4 6 5.39... f ( x)dx
a 3
{0 0.991 4(0.040 0.352 0.841)
a
As there is a change in sign, there is a root in
the interval 1 < x < 2. 2(0.159 0.597)} 0.496
Iterative methods for finding roots Example: The sequence defined by the Sol’ns can be found by programming a calculator:
A root of the equation x = F(x) can sometimes iterative formula 1 = 0 . 5 × ln ( 2 × ANS + 3 ) = = etc
be found using the iterative formula xn 1 0.5ln(2 xn 3), x1 1 The values you get converge to 0.753 (to 3 d.p.) –
xn+1 = F(xn) converges to α. you should show all the values you get in the exam.
starting with some initial value x1. a) Find α correct to 3 d.p.
This method only works if the sequence of b) State an equation of which α is a root. b) To get the equation solved, replace xn and xn 1
values converges. in the iterative formula by x:
Solution: a) x2 0.5ln(2 1 3) 0.8047 x 0.5ln(2 x 3)
x3 0.5ln(2 0.8047 3) 0.7641 This is equivalent to 2 x 3 e 2 x
etc