Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
College of Engineering
DEPARTMENT OF CHEMICAL ENGINEERING
S.Y 2016-2017
Therefore, 0 = 2 +
1 =
2 = 2 + +
Observe that,
0 + 41 + 2 = (2 + ) + 4 + (2 + + ) = 22 + 6.
Therefore, the area under the parabola is = (0 + 41 + 2 ) = (0 + 41 + 2 )
3 3
We assume that f(x) is continuous on [a, b] and we divide [a, b] into an even number n of
subintervals of equal length,
=
using the n + 1 points,
x0 = a, x1 = a + x,
x2 = a + 2x, ..., xn = a + nx = b.
II. Objectives
The main objective of this project is to the devise a software for approximating definite
integrals using Simpsons rule which generally produces more accurate and exact results compared
to other numerical integration methods.
III. Methodology
Procedure:
1. Given a certain function, type the function in the first cell of the f(x) column. In this
case its cell M12 of the program.
Note:
The procedure in typing functions in Microsoft Excel must be strictly followed to
avoid errors in the answer.
The program is limited to Continuous functions only thus any Undefined or
Discontinuous functions will not work on the program.
Example:
5
Given a function 1 ( ) = 4 2 + 2
1.1
Note that the variable x is taken to be cell L12 which is the first cell in the x column
1.2
Check the function in the FORMULA BAR of Microsoft Excel
2. The program will automatically copy the inputted function in the FUNCTION cell.
Since the M12 cell will only show you the evaluated function, you can always check
here if you have the correct function.
3. On the upper right part of the program, you will see table for the limits of the function.
Row a equates the lower limit while row b equates the upper limit. Input the lower
and upper limits in cells N7 and N8 respectively. The table also requires the number
of intervals. Input the preferred intervals in cell N9 which is the row no. of intervals
(n)
3
Note: The number of intervals must be EVEN and LESS THAN 100
4.
4
You can see in the FORMULA BAR of Microsoft Excel that it follows the formula in computing
the interval size.
5. Click the Replicate formula to f(x) cells to automatically iterate the function on the
following cells under row f(x)
5
You can observe that the succeeding cells will follow the function and will
give the values needed.
6. The program will readily give you the solution on the ANS cell.
Note that if the answer is CANT SOLVE. Use other limits to make the function
continuous.
a=0
b=2
n = 10
x f(x)
0 0
0.2 0.008
0.4 0.064
0.6 0.216
0.8 0.512
1 1
1.2 1.728
1.4 2.744
1.6 4.096
1.8 5.831
0.2
3
[(0) + 4(0.008) + 2(0.064) + 4(216) + 2(0.512) + 4(1) + 2(1.728) + 4(2.744) +
2(4.096) + 2(5.831) = 4
44
PERCENT ERROR = 100 = 0%
4
2. . + ACTUAL VALUE = 50.4
a=0
b=2
n = 10
x f(x)
0 0.2
0.2 5.2
0.4 10.2
0.6 15.2
0.8 20.2
1 25.2
1.2 30.2
1.4 35.2
1.6 40.2
1.8 45.2
0.2
[(0.2) + 4(5.2) + 2(10.2) + 4(15.2) + 2(20.2) + 4(205.2) + 2(30.2) + 4(35.2) +
3
2(40.2) + 2(45.2) = 50.4
50.450.4
PERCENT ERROR = 100 = 0%
50.4
3. + ACTUAL VALUE = 28
a=1
b=3
n = 10
x f(x)
1 0
1.2 1.728
1.4 3.744
1.6 6.096
1.8 8.832
2 12
2.2 15.648
2.4 19.824
2.6 24.576
2.8 29.952
0.2
[(0) + 4(1.728) + 2(3.744) + 4(6.096) + 2(8.832) + 4(12) + 2(15.648)4(19.824) +
3
2(24.576) + 2(29.952) = 28
2828
PERCENT ERROR = 100 = 0%
28
The following functions are solved by program will give the following results
1. ACTUAL VALUE = 4
a=0 b=2 n = 10
x f(x)
0 0
0.2 0.00824
0.4 0.06431
0.6 0.21534
0.8 0.51179
1 1
1.2 1.72912
1.4 2.74369
1.6 4.09631
1.8 5.83112
ANSWER: 4
44
PERCENT ERROR = 100 = 0%
4
2. . + ACTUAL VALUE = 50.4
a=0
b=2
n = 10
x f(x)
0 0.2
0.2 5.2
0.4 10.2
0.6 15.2
0.8 20.2
1 25.2
1.2 30.2
1.4 35.2
1.6 40.2
1.8 45.2
ANSWER: 50.4
50.450.4
PERCENT ERROR = 100 = 0%
50.4
3. + ACTUAL VALUE = 28
a=1 b=3 n = 10
x f(x)
1 0.2
1.2 1.72822
1.4 3.74379
1.6 6.09684
1.8 8.8328
2 12
2.2 15.64794
2.4 19.82431
2.6 24.57612
2.8 29.95242
ANSWER: 28
2828
PERCENT ERROR = 100 = 0%
28
V. Conclusion
A software designed, by the members, to approximate definite integrals using Simpsons
Rule is proved to be functional and produces accurate results upon input of the given function.
However, the software is limited to solving continuous functions. It is beyond its capacity to handle
undefined and discontinuous functions.
VI. Recommendation
It is recommended to improve the programs interface and to add more functions such as
automatic graphing and solver for percentage error of values solved by the program compared to
the actual values using the calculator.