Professional Documents
Culture Documents
CIE 115 Completed
CIE 115 Completed
CIE 115 Completed
Numerical Solutions to CE
Problems
This document and the information thereon is the property of PHINMA Education
Syllabus
A. Subject Description:
The course provides background on numerical analysis needed to solve civil engineering problems
numerically when their analytical solution is either not available or difficult to obtain.
B. Objectives:
At the end of the course, the students should be able to:
1. Identify appropriate numerical/mathematical tool or concepts suitable for the solution of the CE
problem;
2. Analyze the CE problem to translate it to a numerical solution;
3. Use microsoft excel to develop a solution to the problem.
4. Solve civil engineering problems numerically when their analytical solution is either not available
or difficult to obtain.
D. References:
1.0 Engeln-Mullges G. and Uhlig F. Numerical Algorithms with C, Springer, © 1996
2.0 Carnahan B., et.al., Applied Numerical Methods, John Wiley & Sons, Inc., © 1969
1
E. Course Requirements
Requirements Due Dates
Problem Set
There will be three periodic examinations and a quiz for every periodic and passing score for all
activities/evaluations is 60%.
F. Grading System:
2
CIE 115: Numerical Solutions to CE Problems
Student Activity Sheet #1
https://www.purplemath.com/modul
4. es/mtrxadd.htm
Productivity Tip:
Have a good morning routine!
A. LESSON PREVIEW/REVIEW
1) Introduction
Numerical analysis is the area of mathematics that creates, analyzes, and implements algorithms for
solving numerically the problems of continuous mathematics. Such problems originate generally from
real-world applications of algebra, geometry, and calculus, and they involve variables which vary
continuously. A numerical solution, however, is an approximation to the solution of a mathematical
equation, often used when analytical solutions are hard or impossible to find. All numerical solutions
are approximations, some better than others, depending on the context of the problem and the numerical
method used.
Numerical solution uses direct method and indirect methods (iterative method) to solve mathematical
problems. Direct method provides the exact solution of an equation system in a finite number of steps
while iterative method uses algorithms to approximate the solution of an equation. Very often, direct
method uses the concept of matrices. That’s why today, you will have a review on the mathematical
foundations of Matrix.
B. MAIN LESSON
1) Activity 2: Content Notes
The Main Diagonal starts at the top left and A Transpose is where we swap entries across the
goes down to the right: main diagonal (rows become columns) like this
A. ADDING
To add two matrices, add the numbers in the matching positions:
3+4=7 8+0=8
4+1=5 6−9=−3
Note: The two matrices must be the same size, i.e. the rows must match in size, and the columns must
match in size.
a matrix with 3 rows and 5 columns can be added to another matrix of 3 rows and 5 columns.
But it could not be added to a matrix with 3 rows and 4 columns (the columns don't match in
size)
B. SUBTRACTING
To subtract two matrices, subtract the numbers in the matching positions:
3−4=−1 8−0=8
4−1=3 6−(−9)=15
Note: Same with addition, the two matrices must be the same size.
C. MULTIPLY BY A CONSTANT
2×4=8 2×0=0
2×1=2 2×−9=−18
TYPES OF MATRIX
A. SQUARE
A square matrix has the same number of rows as columns.
B. IDENTITY MATRIX
An Identity Matrix has 1s on the main diagonal and 0s everywhere else:
C. TRIAGULAR MATRIX
All entries above or below the main diagonal are zero:
D. SYMMETRIC
In a Symmetric matrix matching entries either side of the main diagonal are equal, like this:
to multiply a matrix by another matrix we need to do the "dot product" of rows and columns ...
what does that mean? Let us see with an example:
To work out the answer for the 1st row and 1st column:
The "Dot Product" is where we multiply matching members, then sum up:
We match the 1st members (1 and 7), multiply them, likewise for the 2nd members (2 and 9) and the
3rd members (3 and 11), and finally sum them up.
We can do the same thing for the 2nd row and 1st column:
(4, 5, 6) • (7, 9, 11) = 4×7 + 5×9 + 6×11 = 139
And we get:
When we do multiplication:
The number of columns of the 1st matrix must equal the number of rows of the 2nd matrix.
And the result will have the same number of rows as the 1st matrix, and the same number
of columns as the 2nd matrix.
In General:
To multiply an m×n matrix by an n×p matrix, the ns must be the same,
and the result is an m×p matrix.
1. GIVEN
FIND:
a. A+B
b. B–A
c. CxA
d. BT x C (BT means Transpose of Matrix B)
GIVEN:
CALCULATE:
a. V + Q
b. V x Q
c. Q x V
C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning
KEY OF CORRECTION
Activity 3:
3. https://www.mathsisfun.com/algebr
a/matrix-inverse.html
Productivity Tip:
Create flashcards for key terms and concepts you learned every
module. Quiz yourself using these flashcards every few days!
A. LESSON PREVIEW/REVIEW
1) Introduction
Good Day!
B. MAIN LESSON
1) Activity 2: Content Notes
A. DETERMINANT OF A MATRIX
The determinant of a matrix is a special number that can be calculated from a square matrix. It
helps us find the inverse of a matrix, tells us things about the matrix that are useful in systems of
linear equations, calculus and more.
i. 2x2 Matrix
Example:
The determinant is: |A| = a(ei − fh) − b(di − fg) + c(dh − eg)
Multiply a by the determinant of the 2×2 matrix that is not in a's row or column.
Likewise for b, and for c
Sum them up, but remember the minus in front of the b
Example:
plus a times the determinant of the matrix that is not in a's row or column,
minus b times the determinant of the matrix that is not in b's row or column,
plus c times the determinant of the matrix that is not in c's row or column,
minus d times the determinant of the matrix that is not in d's row or column,
As a formula:
Notice the + − + − pattern (+a... −b... +c... −d...). This is important to remember.
Example:
B. INVERSE OF A MATRIX
The Inverse of a Matrix is the same idea as the reciprocal of a number but we write it A-1
Why not 1/A? Because we don't divide by a matrix!
Therefore, The inverse of A is A-1 only when: A × A-1 = A-1 × A = I (identity matrix)
Here are the first two, and last two, calculations of the "Matrix of Minors" (notice how I ignore the values in the
current row and columns, and calculate the determinant using the remaining values):
In practice we can just multiply each of the top row elements by the cofactor for the same location:
3 0 −1
b. What is the determinant of the matrix 𝐵 = [ 2 −5 4 ]? Ans. |B| = -44
−3 1 3
1 7 6 3
c. What is the determinant of the matrix 𝐶 = [−1 −1 −2 1]? Ans. |C| = -88
0 1 3 −1
−2 6 0 2
−3 10 𝟏 −𝟐
d. Determine the inverse of the matrix 𝐷 = [ ] Ans. 𝑫−𝟏 = [ ]
−2 5 𝟎. 𝟒 −𝟎. 𝟔
1 0 −3 −𝟓 𝟑 −𝟔
e. Determine the inverse of the matrix E = [2 −2 1] Ans. 𝑬−𝟏 = [−𝟔 𝟑 −𝟕]
0 −1 3 −𝟐 𝟏 −𝟐
3 1 3 2
Determine the inverse of V=[ 6 −5 2 1 ]
1 1 −2 0
−3 5 5 −1
C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning
Productivity Tip:
One of the keys to effective studying is not simply memorizing
information but gaining understanding of a topic.
A. LESSON PREVIEW/REVIEW
1) Introduction
Good Day!
In the first two modules, you learned how to add, subtract and multiply matrices; find its determinant and
its inverse. From the previous module, your assignment was to find the inverse of a 4x4 matrix. How long
did it take you to solve for the inverse? Well, calculating the inverse of a 4x4 matrix can give you a hard
time. But what if you are required to calculate the inverse of a 10x10 matrix? Or maybe 20x20? Are you
still going to try it?
Scientific calculators today are limited to 3x3 matrix; higher models are also limited to 4x4 matrix. So
what are the alternatives we can use if we’re dealing with larger matrices?
You can use Microsoft Excel! MS Excel has functions for array of numbers or matrix that can easily
calculate the inverse of a 20x20 matrix even a 100x100 matrix. You can also add, subtract, multiply and
find the determinant of matrices using MS Excel.
B. MAIN LESSON
1) Activity 2: Content Notes
Matrix Functions
Multiplying Matrices
The MMULT function returns the product of two matrices.
You must have a common dimension in the matrices that you want to multiple together.
The number of columns for one must equal the number of rows for the other.
This is usually entered as an array function and therefore must be entered with (Ctrl + Shift + Enter).
Matrix A multiplied by Matrix B is not the same as Matrix B multiplied by Matrix A (i.e. matrix multiplication
is not commutative).
Determinant of a Matrix
The MDETERM function returns the matrix determinant as an array formula.
Transpose
The TRANSPOSE function will transpose a matrix and return an array formula.
Transposing an array converts rows into columns and columns into rows.
This is usually entered as an array function and therefore must be entered with (Ctrl + Shift + Enter).
Inverse of a matrix
The MINVERSE function returns the inverse of the matrix as an array formula.
This is usually entered as an array function and therefore must be entered with (Ctrl + Shift + Enter).
Only square matrices "can have" inverses. Not all square matrices have inverses.
To prove that these are infact the correct inverses we need to multiply the two matrices together. This is
shown below. (A matrix multiplied by its inverse will be an Identity matrix as discuss in module #1 and
#2)
A matrix that has no inverse has a determinant of zero and is said to be singular.
Not all square matrices have inverses.
A square matrix with an inverse is called "invertible" or "nonsingular".
A square matrix with no inverse is called "noninvertible" or "singular".
Solve the problems in ‘Activity 3’ from module #1 and module #2 using MS Excel. (Compare
your answers to the given answers in the module#1 and #2)
1. GIVEN:
CALCULATE:
a. V + Q
b. V x Q
c. Q x V
3 1 3 2
2. Determine the determinant and inverse of matrix V=[ 6 −5 2 1 ]
1 1 −2 0
−3 5 5 −1
C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning
https://www.mathsisfun.com/algebr
a/systems-linear-equations.html
Productivity Tip:
Take notes. No seriously, take notes.
A. LESSON PREVIEW/REVIEW
1) Introduction
Together they are a system of linear equations. Can you solve the values of x and y?
The values of x and y are actually the point of intersection of the two linear equations and
we can determine it by graphing the linear equations in a Cartesian plane. From the
graph, it’s clear that the point of intersection is (1, 5) x =1 and y = 5
We can also determine the values of x and y using different methods: One is by Cramer’s
rule.
B. MAIN LESSON
1) Activity 2: Content Notes
CRAMER’S RULE is an explicit formula for the solution of a system of linear equations with as many
equations as unknowns, valid whenever the system has a unique solution. It expresses the solution in
terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by
replacing one column by the column vector of right-hand-sides of the equations.
Example #1
Let's use the system of equations earlier and solve for the value of x and y.
1) x+y=6
2) −3x + y = 2
Evaluating each determinant (using the method explained last module), we get:
1 1 |D| = (1x1 − 1x − 3) = 4
D=[ ]
−3 1
6 1 |Dx | = (6x1 − 1x2) = 4
Dx = [ ]
2 1
1 6
Dy = [ ] |Dy | = (1x2 − 6x − 3) = 20
−3 2
Then,
|Dx | 4 |Dy | 20
𝐱= = =𝟏 𝐲= = = 𝟓
|D| 4 |D| 4
Example #2
If 3p - 2q = 4 and 7p - 3q = 1, then what is 4p - 5q equal to?
Solution:
3p - 2q = 4
7p - 3q = 1
4p - 5q = 4(-2) – 5(-5) = 17
Example #3
How about 3 equations with 3 unknowns? Like this one:
2x + y + z = 3
x– y–z=0
x + 2y + z = 0
Solution:
Matrix Form Determinant of the Matrix
2 1 1
D = [1 −1 −1] |D| = 2 [−1 −1] − 1 [1 −1
] + 1[
1 −1
]
2 1 1 1 1 2
1 2 1
= 2((−1x1) − (−1x2)) − 1(1x1 − (−1x1)) + 1(1x2 − (−1x1))
= 2(1) − 1(2) + 1(3) = 3
3 1 1
Dx = [0 −1 −1] |Dx | = 3 [−1 −1] − 1 [0 −1] + 1 [0 −1
]
2 1 0 1 0 2
0 2 1
= 3(1) − 1(0) + 1(0) = 3
2 3 1
0 −1 1 −1 1 0
Dy = [1 0 −1] |Dy | = 2 [ ] − 3[ ] +1[ ]
0 1 1 1 1 0
1 0 1
= 2(0) − 3(2) + 1(0) = −6
2 1 3
−1 0 1 0 1 −1
Dz = [1 −1 0] |Dy | = 2 [ ]−1[ ] + 3[ ]
2 0 1 0 1 2
1 2 0
= 2(0) − 1(2) + 3(3) = 9
Then,
|Dx | 3 |Dy | −6 |Dz | 9
𝐱= = =𝟏 𝐲= = = −𝟐 𝐳= = = 𝟑
|D| 3 |D| 3 |D| 3
3x + 2y − 4z = 4 (1)
-2x + 3y + z = 12 (2)
x − 2y + 2z = -10 (3)
C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning
A. LESSON PREVIEW/REVIEW
1) Introduction
Good Day!
Aside from Cramer’s Rule, there are another way to solve a system of
linear equation in a matrix form; and that’s what we’re going to discuss
today.
Gaussian Elimination
Gauss-Jordan Elimination
Gaussian elimination, also known as row reduction, is an algorithm in linear algebra for solving
a system of linear equations. It is usually understood as a sequence of operations performed on the
corresponding matrix of coefficients. The method is named after Carl Friedrich Gauss (1777–1855). It was
further popularized by Wilhelm Jordan, who attached his name to the process by which row reduction is used
to compute matrix inverses, Gauss-Jordan elimination.
As mention earlier, Gauss-Jordan elimination can be used to calculate the inverse of a matrix, but we
will discuss that in the next module (module #6). Today let’s focus in solving system of linear equation using
the two elimination method.
B. MAIN LESSON
1) Activity 2: Content Notes
I. GAUSSIAN ELIMINATION
A method of solving a linear system of equations. This is done by transforming the system's augmented
matrix into row-echelon form by means of row operations. Then the system is solved by back-
substitution.
There are three types of row operations which may be performed on the rows of a matrix:
1. Swap the positions of two rows.
2. Multiply a row by a non-zero scalar.
3. Add to one row a scalar multiple of another.
If the matrix is associated to a system of linear equations, then these operations do not change the solution
set. Therefore, if one's goal is to solve a system of linear equations, then using these row operations could
make the problem easier.
3x + 2y − 4z = 4 (1)
-2x + 3y + z = 12 (2)
x − 2y + 2z = -10 (3)
Solution:
[x y z | k ]
3 2 −4 4 x1 y1 z1 k1
Augmented Matrix [−2 3 1 | 12 ] [x 2 y2 z2 |k 2 ]
x3 y3 z3 k 3
1 −2 2 −10
Then, the Augmented Matrix should be reduce into Echelon form by means of row operations.
The Echelon form of Guassian Elimination are like an upper triangle matrix (type of matrix from module
#1)
x2 , x3 , and y3 should be reduced to 0.
Let’s begin:
3 2 −4 4 → row 1
[−2 3 1 | 12 ] → row 2
1 −2 2 −10 → row 3
For x3 be reduce to zero, multiply row 3 by “2” and “add” row 2. 2R3 + R2
2(1) + (−2) = 0
3 2 −4 4
2(−2) + 3 = −1
[−2 3 1 | 12 ]
2(2) + 1 = 5 row 3 becomes → 0 −1 5 −8
2(−10) + 12 = −8
For x2 be reduce to zero, multiply row 2 by “3”, multiply row 1 by “2” then “add” row 2 and row 1. 3R2 + 2R3
3(−2) + 2(3) = 0
3(3) + 2(2) = 13 3 2 −4 4
row 2 becomes → [0 13 −5| 44 ]
3(1) + 2(−4) = −5
0 −1 5 −8
3(12) + 2(4) = 44
Lastly, for y3 be reduce to zero, multiply row 3 by “13” and “add” row 2. 13R3 + R2
13(0) + 0 = 0
13(−1) + 13 = 0 3 2 −4 4
[0 13 −5| 44 ]
13(5) + (−5) = 60 row 3 becomes → 0 0 60 −60
13(−8) + 44 = −60
3 2 −4 4
Echelon form [0 13 −5| 44 ]
0 0 60 −60
3x + 2y − 4z = 4
The system becomes → 13y − 5z = 44
60z = −60
By back-substitution,
60z = −60 𝐳 = −𝟏
3x + 2(3) − 4(−1) = 4 𝐱 = −𝟐
𝐻𝑒𝑛𝑐𝑒, 𝑥 + 𝑦 + 𝑧 = −2 + 3 − 1 = 𝟎 Ans.
Let’s have another example so that you can familiarize the pattern in transforming the augmented matrix into
echelon form.
Sample problem #2
2𝑎 + 3𝑏 − 𝑐 − 𝑑 = 4
𝑎 + 5𝑏 − 𝑐 + 𝑑 = 5
𝑎 − 𝑏 − 3𝑐 + 2𝑑 = −1
5𝑎 − 𝑏 + 𝑐 − 𝑑 = 2
Solution:
2 3 −1 −1 4
𝐴𝑢𝑔𝑚𝑒𝑛𝑡𝑒𝑑 𝑀𝑎𝑡𝑟𝑖𝑥 → [1 5 −1 1|5]
1 −1 −3 2 −1
5 −1 1 −1 2
2 3 −1 −1 4 2 3 −1 −1 4
2𝑅2 − 𝑅1 [ 1 5 −1 1 | 5 ] → [0 7 −1 3 | 6 ]
𝑅3 − 𝑅2 1 −1 −3 2 −1 0 −6 −2 1 −6
𝑅4 − 5𝑅3 5 −1 1 −1 2 0 4 16 −11 7
2 3 −1 −1 4 2 3 −1 −1 4
[0 7 −1 3 | 6 ] → [0 7 −1 3 |6]
7𝑅3 + 6𝑅2 0 −6 −2 1 −6 0 0 −20 25 −6
6𝑅4 + 4𝑅3 0 4 16 −11 7 0 0 88 −62 18
2 3 −1 −1 4 2 3 −1 −1 4
[0 7 −1 3 | 6 ] → [0 7 −1 3 | 6 ]
0 0 −20 25 −6 0 0 −20 25 −6
20𝑅4 + 88𝑅3 0 0 88 −62 18 0 0 0 960 −168
2 3 −1 −1 4
Echelon form [0 7 −1 3 | 6 ]
0 0 −20 25 −6
0 0 0 960 −168
2a + 3b − c − d = 4
The system becomes → 7b − c + 3d = 6
−20c + 25d = −6
960d = −168
By back-substitution,
𝐚 = 𝟎. 𝟓𝟑𝟕𝟓
𝐛 = 𝟎. 𝟗𝟒𝟑𝟕𝟓
𝐜 = 𝟎. 𝟎𝟖𝟏𝟐𝟓
Gauss-Jordan Elimination is like the continuation of Guassian Elimination; the process is the same.
The Echelon form of Gauss-Jordan Elimination is an identity matrix (type of matrix from module #1)
Let’s try to solve the previous sample problem using Gauss-Jordan Elimination.
3x + 2y − 4z = 4 (1)
-2x + 3y + z = 12 (2)
x − 2y + 2z = -10 (3)
Solution:
3 2 −4 4
Augmented Matrix [−2 3 1 | 12 ]
1 −2 2 −10
3 2 −4 4 3 2 −4 4
[
3𝑅2 + 2𝑅1 −2 3 1 | 12 ] → [0 13 −5| 44 ]
2𝑅3 + 𝑅2 1 −2 2 −10 0 −1 5 −8
3 2 −4 4 3 2 −4 4
[0 13 −5| 44 ] → [0 13 −5| 44 ]
13𝑅3 + 𝑅2 0 −1 5 −8 0 0 60 −60
From here the process is the same as gaussian elimination. Now let’s continue the process,
1 0 0 −2
Echelon form [0 1 0| 3 ] as you can see, the matrix at the left is an identity matrix.
0 0 1 −1
Thus,
x = -2, y = 3, z = -1. x + y + z = −2 + 3 − 1 = 𝟎 Ans.
Sample problem #2
Determine the value of a, b, c, and d. Let’s also solve problem #2 using Guass-Jordan Elimination.
2𝑎 + 3𝑏 − 𝑐 − 𝑑 = 4
𝑎 + 5𝑏 − 𝑐 + 𝑑 = 5
𝑎 − 𝑏 − 3𝑐 + 2𝑑 = −1
5𝑎 − 𝑏 + 𝑐 − 𝑑 = 2
Solution:
2 3 −1 −1 4
𝐴𝑢𝑔𝑚𝑒𝑛𝑡𝑒𝑑 𝑀𝑎𝑡𝑟𝑖𝑥 → [1 5 −1 1|5]
1 −1 −3 2 −1
5 −1 1 −1 2
2 3 −1 −1 4 2 3 −1 −1 4
2𝑅2 − 𝑅1 [ 1 5 −1 1 | 5 ] → [0 7 −1 3 | 6 ]
𝑅3 − 𝑅2 1 −1 −3 2 −1 0 −6 −2 1 −6
𝑅4 − 5𝑅3 5 −1 1 −1 2 0 4 16 −11 7
2 3 −1 −1 4 2 3 −1 −1 4
[0 7 −1 3 | 6 ] → [0 7 −1 3 |6]
7𝑅3 + 6𝑅2 0 −6 −2 1 −6 0 0 −20 25 −6
6𝑅4 + 4𝑅3 0 4 16 −11 7 0 0 88 −62 18
2 3 −1 −1 4 2 3 −1 −1 4
[0 7 −1 3 | 6 ] → [0 7 −1 3 | 6 ]
0 0 −20 25 −6 0 0 −20 25 −6
20𝑅4 + 88𝑅3 0 0 88 −62 18 0 0 0 960 −168
From here the process is the same as gaussian elimination. Now let’s continue the process,
3𝑅1 + 𝑅2 2 3 −1 −1 4 6 16 −4 0 18
25𝑅2 − 3𝑅3 [0 7 −1 3 | 6 ] → [0 175 35 0 | 168 ]
960𝑅3 − 25𝑅4 0 0 −20 25 −6 0 0 −19200 0 −1560
0 0 0 960 −168 0 0 0 960 −168
35𝑅1 + 4𝑅2 6 16 −4 0 18 210 1260 0 0 1302
19200𝑅2 + 35𝑅3 [0 175 35 0 | 168 ] → [ 0 3360000 0 0 |3171000]
0 0 −19200 0 −1560 0 0 −19200 0 −1560
0 0 0 960 −168 0 0 0 960 −168
3360000𝑅1 − 1260𝑅2 210 1260 0 0 1302 705600000 0 0 0 379260000
[ 0 3360000 0 0 | 3171000]→[ 0 3360000 0 0 | 3171000 ]
0 0 −19200 0 −1560 0 0 −19200 0 −1560
0 0 0 960 −168 0 0 0 960 −168
1 0 0 0 0.5375
Echelon form [0 1 0 0|0.94375]
0 0 1 0 0.08125
0 0 0 1 −0.175
Therefore,
𝐚 = 𝟎. 𝟓𝟑𝟕𝟓
𝐛 = 𝟎. 𝟗𝟒𝟑𝟕𝟓
𝐜 = 𝟎. 𝟎𝟖𝟏𝟐𝟓
𝐝 = −𝟎. 𝟏𝟕𝟓
Determine the values of the variables to satisfy the equation using a) Gaussian Elimination and b) Gauss-
Jordan Elimination.
𝑥+𝑦−𝑧 =4 𝑨𝒏𝒔. 𝒙 = 𝟏, 𝒚 = 𝟐, 𝒂𝒏𝒅 𝒛 = −𝟏
𝑥 − 2𝑦 + 3𝑧 = −6
2𝑥 + 3𝑦 + 𝑧 = 7
ASSIGNMENT #2: Determine the values of the variables to satisfy the equation using Gaussian Elimination
OR Gauss-Jordan Elimination.
𝑎 + 2𝑏 − 𝑐 − 𝑑 + 3𝑒 = −2
𝑎 − 𝑏 + 3𝑐 − 2𝑑 + 𝑒 = 3
2𝑏 + 𝑐 − 𝑑 + 𝑒 = 5
2𝑎 − 𝑐 + 𝑒 = −1
3𝑎 + 𝑏 − 2𝑐 = 4
C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning
“You do what you can for as long as you can, and when you finally can’t, you do
the next best thing. You back up but you don’t give up.” ―Chuck Yeager
A. LESSON PREVIEW/REVIEW
1) Introduction
In certain cases, these methods are preferred over the direct methods (e.i. Cramer’s Rule, Gauss-
Jordan Elimination) – when the coefficient matrix is sparse (has many zeros) or diagonally dominant.
For example:
a square matrix is said to be diagonally dominant if, for every row of the matrix,
the magnitude of the diagonal entry in a row is larger than or equal to the sum of
the magnitudes of all the other (non-diagonal) entries in that row.
B. MAIN LESSON
1) Activity 2: Content Notes
A. JACOBI ITERATION
An iterative algorithm for determining the solutions of a strictly diagonally dominant system of linear equations.
Each diagonal element is solved for, and an approximate value is plugged in. The process is then iterated until
it converges. This algorithm is a stripped-down version of the Jacobi transformation method of matrix
diagonalization. The method is named after Carl Gustav Jacob Jacobi.
Example #1.
6𝑥 − 2𝑦 + 𝑧 = 11
𝑥 + 2𝑦 − 5𝑧 = −1
−2𝑥 + 7𝑦 + 2𝑧 = 5
Solution:
6x − 2y + z = 11 → eq. 1 6x − 2y + z = 11
x + 2y − 5z = −1 → eq. 2 −2x + 7y + 2z = 5
−2x + 7y + 2z = 5 → eq. 3 x + 2y − 5z = −1
𝑊𝑒 𝑠𝑤𝑎𝑝 𝑡ℎ𝑒 𝑝𝑜𝑠𝑖𝑡𝑖𝑜𝑛 𝑜𝑓 𝑒𝑞. 2 𝑎𝑛𝑑 3 𝑠𝑜 𝑡ℎ𝑎𝑡 𝑡ℎ𝑒 𝑎𝑢𝑔𝑚𝑒𝑛𝑡𝑒𝑑 𝑚𝑎𝑡𝑟𝑖𝑥 𝑤𝑖𝑙𝑙 𝑏𝑒 𝑑𝑖𝑎𝑔𝑜𝑛𝑎𝑙𝑙𝑦 𝑑𝑜𝑚𝑖𝑛𝑎𝑛𝑡 (𝑠𝑒𝑒 𝑖𝑛𝑡𝑟𝑜𝑑𝑢𝑐𝑡𝑖𝑜𝑛)
11 + 2𝑦 − 𝑧
6x − 2y + z = 11 → x=
6
5 + 2𝑥 − 2𝑧
−2x + 7y + 2z = 5 → y=
7
−1 − 𝑥 − 2𝑦 1 + 𝑥 + 2𝑦
x + 2y − 5z = −1 → z= ; 𝑧=
−5 5
In the first iteration, we used the “Initial guess” for the value of x, y, and z. (x = 0, y = 0, z = 0)
For the second iteration, we used the values that we solved from the first iteration. (x = 1.833, y = 0.714, z =
0.2) This iteration will go on until the “two consecutive iterations” have the same value. Like 8 th Iteration and 9th
Iteration.
Note: The closest your Initial Guess to the right value the lesser the number of iteration.
Example #2.
5𝑎 − 𝑏 + 𝑐 = 5
2𝑎 + 7𝑏 − 3𝑐 = 3
𝑎 − 3𝑏 + 4𝑐 = −1
Solution:
Always check if the augmented matrix is diagonally dominant, then proceed to iteration.
5 −1 1
𝐴𝑢𝑔𝑚𝑒𝑛𝑡𝑒𝑑 𝑀𝑎𝑡𝑟𝑖𝑥 → |2 7 −3|
1 −3 4
5+𝑏−𝑐
5𝑎 − 𝑏 + 𝑐 = 5 → a=
5
3 − 2𝑎 + 3𝑐
2𝑎 + 7𝑏 − 3𝑐 = 3 → b=
7
−1 − 𝑎 + 3𝑏
𝑎 − 3𝑏 + 4𝑐 = −1 → 𝑐=
4
Example #3.
2𝑤 + 3𝑥 − 4𝑦 + 𝑧 = 9
𝑤 − 3𝑥 + 𝑦 − 𝑧 = 5
−2𝑤 − 𝑥 − 3𝑦 + 𝑧 = −11
𝑤 + 𝑥 + 𝑦 − 3𝑧 = −4
Solution:
−2𝑤 − 𝑥 − 3𝑦 + 𝑧 = −11
𝑤 − 3𝑥 + 𝑦 − 𝑧 = 5
2𝑤 + 3𝑥 − 4𝑦 + 𝑧 = 9
𝑤 + 𝑥 + 𝑦 − 3𝑧 = −4
Using MS Excel for the Iteration and After 101st Iteration, we get the right values.
The number of iteration will also vary on accuracy that you consider. Like for the examples we are always
doing 3 decimal places. What if we just consider 1 decimal place. Then,
B. GAUSS-SEIDEL ITERATION
Also known as the Liebmann method or the method of successive displacement, is an iterative method used to
solve a linear system of equations. It is named after the German mathematicians Carl Friedrich Gauss and Philipp
Ludwig von Seidel, and is similar to the Jacobi method. Though it can be applied to any matrix with non-zero
elements on the diagonals, convergence is only guaranteed if the matrix is either strictly diagonally dominant.
6𝑥 − 2𝑦 + 𝑧 = 11
𝑥 + 2𝑦 − 5𝑧 = −1
−2𝑥 + 7𝑦 + 2𝑧 = 5
Solution:
6x − 2y + z = 11 → eq. 1 6x − 2y + z = 11
x + 2y − 5z = −1 → eq. 2 −2x + 7y + 2z = 5
−2x + 7y + 2z = 5 → eq. 3 x + 2y − 5z = −1
11 + 2𝑦 − 𝑧
6x − 2y + z = 11 → x=
6
5 + 2𝑥 − 2𝑧
−2x + 7y + 2z = 5 → y=
7
−1 − 𝑥 − 2𝑦 1 + 𝑥 + 2𝑦
x + 2y − 5z = −1 → z= ; 𝑧=
−5 5
The only difference of the Gauss-Seidel from Jacobi is that you immediately plug-in the values the you solved.
After we solved the value of “x” using the initial guess, we used the computed value of x to find the value of “y”.
Same as the we solve for the value of “z”.
In this case, Gauss-Seidel is faster to converge than Jacobi. We get the value of the variables after 4th
iteration.
Example #2.
2𝑤 + 3𝑥 − 4𝑦 + 𝑧 = 9
𝑤 − 3𝑥 + 𝑦 − 𝑧 = 5
−2𝑤 − 𝑥 − 3𝑦 + 𝑧 = −11
𝑤 + 𝑥 + 𝑦 − 3𝑧 = −4
Solution:
1. Determine the values of the variables to satisfy the equation using Jacobi.
5𝑎 − 2𝑏 = 40 𝑨𝒏𝒔. 𝒂 = 𝟏𝟎, 𝒃 = 𝟓
𝑎 + 3𝑏 = 25
2. Determine the values of the variables to satisfy the equation using Gauss-Seidel.
3𝑉 − 𝐶 + 2𝑄 = −13 𝑨𝒏𝒔. 𝑽 = −𝟏, 𝑪 = 𝟒, 𝑸 = −𝟑
2𝑉 + 5𝐶 − 𝑄 = 21
𝑉 − 2𝐶 + 3𝑄 = −18
3. Determine the values of the variables to satisfy the equation using a) Jacobi and b) Gauss-Seidel.
3𝑥 + 2𝑦 − 𝑧 = −2.1 𝑨𝒏𝒔. 𝒙 = 𝟎. 𝟓, 𝒚 = 𝟎. 𝟐, 𝒛 = 𝟒
−4𝑥 + 𝑦 + 7𝑧 = 26.2
2𝑥 − 4𝑦 + 𝑧 = 4.2
C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning
A. LESSON PREVIEW/REVIEW
1) Introduction
The nonlinear equation, f(x) = 0, may be an algebraic equation, a transcendental equation, a solution of a
differential equation or any nonlinear function of x.
B. MAIN LESSON
1) Activity 2: Content Notes
BISECTION METHOD
A root-finding method that applies to any continuous functions for which one knows two values with opposite
signs. The method consists of repeatedly bisecting the interval defined by these values and then selecting the
subinterval in which the function changes sign, and therefore must contain a root.
𝑎+𝑏
1. Calculate c, the midpoint of the interval, 𝑐 =
2
2. Calculate the function value at the midpoint, f(c).
3. If convergence is satisfactory (that is, c - a is sufficiently
small, or |f(c)| is sufficiently small), return c and stop
iterating.
4. Examine the sign of f(c) and replace either (a, f(a)) or
(b, f(b)) with (c, f(c)) so that there is a zero crossing within
the new interval.
𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 2 − 3𝑥 + 1
Solution:
First, we need to approximate our interval [a, b] that contain the roots.
Now, we are ready to start our iteration. Initial Interval: [a, b] [0, 5] a = 0, b = 0.5
𝑎 + 𝑏 0 + 0.5
c= = = 0.25 𝑓(𝑐) = 0.252 − 3(0.25) + 1 = 0.3125 (𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒)
2 2
We change the interval into [0.25, 0.5] and repeat the process.
𝑎 + 𝑏 0.25 + 0.5
c= = = 0.375 𝑓(𝑐) = 0.3752 − 3(0.375) + 1 = 0.015625 (𝑝𝑜𝑠𝑖𝑡𝑖𝑣𝑒)
2 2
𝑎 + 𝑏 0.375 + 0.5
c= = = 0.4375 𝑓(𝑐) = 0.43752 − 3(0.4375) + 1 = −0.121094 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)
2 2
We change the interval into [0.375, 0.4375]. Note the positive and negative sign. We continue this process until
f(c) will be approximately equal to zero. Here is the complete iteration using MS Excel:
When the f(c) is approximately equal to zero, the root be equal to “c”.
Therefore, x = 0.382 Ans.
𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 3 − 4𝑥 − 9
Analytical Solution: x = 2.7065 (one real root)
Solution:
C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning
“Sometimes, things may not go your way, but the effort should be there
every single night.” – Michael Jordan
A. LESSON PREVIEW/REVIEW
1) Introduction
FIXED-POINT ITERATION
NEWTON’S METHOD
𝒇 (𝒙 𝒏 )
𝒙𝒏+𝟏 = 𝒙𝒏 − 𝒇𝒐𝒓 𝒏 = 𝟏, 𝟐, 𝟑, …
𝒇′ (𝒙 𝒏 )
Notes on Convergence:
Poor initial estimate
Termination at a stationary point
Difficulty in calculating the derivative of a function - Use secant method (topic that we will discuss next
module)
B. MAIN LESSON
1) Activity 2: Content Notes
I. FIXED-POINT ITERATION
Example #1.
𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 2 − 3𝑥 + 1
Solution:
b) 𝑥 2 − 3𝑥 + 1 = 0
3𝑥 − 1 𝟏
𝑥 2 = 3𝑥 − 1 → 𝑥= → 𝒈𝟐 (𝒙) = 𝟑 −
𝑥 𝒙
c) 𝑥 2 − 3𝑥 + 1 = 0
𝑥 2 = 3𝑥 − 1 → 𝑥 = √3𝑥 − 1 → 𝒈𝟑 (𝒙) = √𝟑𝒙 − 𝟏
Let’s try…
𝒙𝟐 + 𝟏
𝒈𝟏 (𝒙) =
𝟑
Here is the solution using MS Excel. Using the other equation will lead you to the other root.
Example #2.
Solution:
cos(𝑥) 𝐜𝐨𝐬(𝒙)
cos(𝑥 ) = 𝑥𝑒 𝑥 → 𝑥= → 𝒈𝟏 (𝒙) =
𝑒𝑥 𝒆𝒙
x = 0.518 Ans.
Also known as the Newton–Raphson method, named after Isaac Newton and Joseph Raphson, is a root-finding
algorithm which produces successively better approximations to the roots (or zeroes) of a real-valued function.
If a differentiable function y = f(x) has a simple root s in (a, b) and f’(s) ≠ 0, then the iteration rule is given as
𝒇(𝒙𝒏 )
𝒙𝒏+𝟏 = 𝒙𝒏 − 𝒇𝒐𝒓 𝒏 = 𝟏, 𝟐, 𝟑, …
𝒇′ (𝒙𝒏 )
Example #1.
𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 2 − 3𝑥 + 1
Solution:
𝑥0 2 − 3𝑥0 + 1
x1 = 𝑥0 −
2𝑥0 − 3
02 − 3(0) + 1
x1 = 0 − = 0.333
2(0) − 3
0.3332 − 3(0.333) + 1
x2 = 0.333 − = 0.381
2(0.333) − 3
0.3812 − 3(0.381) + 1
x3 = 0.381 − = 0.382
2(0.381) − 3
0.3822 − 3(0.382) + 1
x4 = 0.382 − = 0.382
2(0.382) − 3
𝑥0 2 − 3𝑥0 + 1
x1 = 𝑥0 −
2𝑥0 − 3
32 − 3(3) + 1
x1 = 3 − = 2.667
2(3) − 3
2.6672 − 3(2.667) + 1
x2 = 2.667 − = 2.619
2(2.667) − 3
2.6192 − 3(2.619) + 1
x3 = 2.619 − = 2.618
2(2.619) − 3
2.6182 − 3(2.618) + 1
x3 = 2.618 − = 2.618
2(2.618) − 3
Example #2.
Solution:
NOTE: ALWAYS SET YOUR CALCULATOR IN RADIAN MODE WHEN DEALING WITH TRIGO FUNCTIONS
cos(0) − 0(𝑒 0 )
x1 = 0 − =1
− sin(0) − 0(𝑒 0 ) − 𝑒 0
cos(0) − 0(𝑒 0 )
x2 = 0 − = 0.653
− sin(0) − 0(𝑒 0 ) − 𝑒 0
PROBLEM SET #2: Find the root/s using 1) Fixed-point Iteration and 2) Newton’s Method
a. 𝑒 −𝑥 − 3𝑙𝑜𝑔𝑥 = 0
b. 𝑓 (𝑥 )= 𝑒 −𝑥 (𝑥 2 − 5𝑥 + 2)
c. 32𝑥+3 = 2187
d. 15𝑥 2 + 2𝑥 − 8 = 0
1
e. arctan(1 − 𝑥 ) + arctan(1 + 𝑥 ) = arctan ( )
8
C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning
A. LESSON PREVIEW/REVIEW
1) Introduction
This two iterative method works well with functions that are not
differentiable or the derivative is difficult to obtain. It requires two
values x0, x1, and iteration rule is as follows:
𝒙𝒊 − 𝒙𝒊−𝟏
𝒙𝒊+𝟏 = 𝒙𝒊 − 𝒇(𝒙𝒊 )
𝒇(𝒙𝒊 ) − 𝒇(𝒙𝒊−𝟏 )
Inclusion Method
Secant and Regula-Falsi Method are also like Bisection Method that uses Interval for iteration; and in
terms on how to approximate this Interval or initial guess, that’s why they are called as inclusion
method.
NOTE: Bolzano’s intermediate value theorem. If f is continuous in I = [a, b] and f(a) ⋅ f(b) < 0, then f has
at least one root in s ∈ I.
B. MAIN LESSON
1) Activity 2: Content Notes
SECANT METHOD
A root-finding algorithm that uses a succession of roots of secant lines to better approximate a root of
a function f. The secant method can be thought of as a finite-difference approximation of Newton's method.
However, the method was developed independently of Newton's method and predates it by over 3000 years.
Example #1:
𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 2 − 3𝑥 + 1
Solution:
NOTE: The method that we used in order to find the Interval [a, b] for bisection method is the method that we
will use to approximate our interval [xi-1, xi] for Secant Method.
The root is between 0 and 1. Initial Interval: [xi-1, xi] [0, 1] xi-1 = 0, xi = 1
f(xi−1 ) = 02 − 3(0) + 1 = 1
f(xi ) = 12 − 3(1) + 1 = −1
xi − xi−1 1−0
xi+1 = xi − f(xi ) = 1 − (−1) ( ) = 𝟎. 𝟓
f(xi ) − f(xi−1 ) −1 − 1
𝑓𝑜𝑟 𝑡ℎ𝑒 𝑛𝑒𝑥𝑡 𝑖𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛, 𝑡ℎ𝑒 𝑛𝑒𝑤 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 xi−1 𝑖𝑠 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 xi 𝑓𝑟𝑜𝑚 𝑡ℎ𝑒 𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝑖𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛
𝑎𝑛𝑑 xi 𝑖𝑠 𝑡ℎ𝑒 𝑣𝑎𝑙𝑢𝑒 𝑜𝑓 xi+1 ∶ → [1, 0.5] 𝑡ℎ𝑒 𝑖𝑛𝑡𝑒𝑟𝑎𝑡𝑖𝑜𝑛 𝑤𝑖𝑙𝑙 𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑒 𝑢𝑛𝑡𝑖𝑙 f(xi+1 ) ≈ 0
REGULA-FALSI METHOD
The process of iteration for regula-falsi is the same as Secant method, the only difference is the
transformation of the interval for the next iteration. Regula-Falsi consider the “sign” of f(xi+1 ) whether it’s a
negative or positive number just like bisection method. For you to understand, here is an example:
Example #1:
𝑆𝑜𝑙𝑣𝑒 𝑓(𝑥) = 𝑥 2 − 3𝑥 + 1
Here are some sample problems for you to understand the iteration for Secant and Regula-falsi Method.
Example #2.
Solution:
Example #3.
Solution:
ASSIGNMENT #4: Find the root/s using 1) Secant Method and 2) Regula-falsi Method
a. 𝑒 −𝑥 − 3𝑙𝑜𝑔𝑥 = 0
b. 𝑓 (𝑥 ) = 𝑒 −𝑥 (𝑥 2 − 5𝑥 + 2)
C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning
A. LESSON PREVIEW/REVIEW
1) Introduction
𝒙𝟐 𝒚 + 𝒚 = 𝟑
𝟑𝒙 − 𝒙𝒚𝟐 = 𝟎
B. MAIN LESSON
1) Activity 2: Content Notes
Newton’s Method
The solution may be obtained by iteration, starting with x(0), such that
Where J(x(n)) is the Jacobian of the system evaluated for the vector x(n). The element of the Jacobian matrix is
EXAMPLE #1:
𝟑𝒙𝟐 − 𝒙𝒚 = 𝟏𝟎
Solution:
Note: Since there are two equations and two unknowns, the Jacobian Matrix will be a two by two
(2x2) matrix.
xy 2 + 4y = −2 → xy 2 + 4y + 2 = 0
3x 2 − xy = 10 → 3x 2 − xy − 10 = 0
∂f1 ∂f1 ∂ ∂
(xy2 + 4y + 2) (xy2 + 4y + 2)
∂x ∂y ∂x ∂y 𝑦2 2𝑥𝑦 + 4
J = ∂f ∂f2
= ∂ ∂
=[ ]
2 6𝑥 − 𝑦 −𝑥
(3x2 − xy − 10) (3x2 − xy − 10)
[ ∂x ∂y ] [∂x ∂y ]
𝑦2 2𝑥𝑦 + 4
Jacobian Matrix → [ ]
6𝑥 − 𝑦 −𝑥
Step 4: Solve for F(x, y). Substitute your initial guess to the given equations.
𝑓(𝑥, 𝑦) = xy 2 + 4y + 2 = (1)(1)2 + 4(1) + 2 = 7
𝑓(𝑥, 𝑦) = 3x 2 − xy − 10 = 3(1)2 − (1)(1) − 10 = −6
Step 5: Calculate the value of d(x, y). First you need to calculate the inverse of the Jacobian matrix, then,
nultiply the inverse to the vector F(x, y).
{d} = [J]−1 {F}
1⁄ 6⁄
1 6 −1 7 31 ] { 7 } = {−0.935}
{d} = [ ] { } = [ 35
5 −1 −6 5⁄ −1⁄ −6 1.3225
31 31
Step 6: Calculate the updated value of (x, y) for the next iteration by simply subtracting d(x, y) from the
previous value of (x, y).
𝑥 = 1 − (−0.935) = 𝟏. 𝟗𝟑𝟓
𝑦 = 1 − 1.323 = −𝟎. 𝟑𝟐𝟑
REPEAT Step 3, 4, 5, and 6 until the value of F(x, y) and d(x, y) are approximately equal to zero!
Iteration (x, y) J(x, y) d(x, y) d(x, y)
1 1.000 6.000 7.000 -0.935
0
1 5.000 -1.000 -6.000 1.323
1.935 0.104 2.751 0.911 0.104
1
-0.323 11.935 -1.935 0.614 0.327
1.831 0.422 1.621 0.174 -0.077
2
-0.650 11.636 -1.831 -1.132 0.127
1.908 0.604 1.034 0.044 -0.036
3
-0.777 12.227 -1.908 -0.559 0.063
1.944 0.707 0.732 0.011 -0.018
4
-0.841 12.505 -1.944 -0.296 0.033
1.963 0.764 0.570 0.003 -0.010
5
-0.874 12.649 -1.963 -0.160 0.019
1.972 0.797 0.479 0.001 -0.005
6
-0.893 12.726 -1.972 -0.090 0.011
1.978 0.817 0.426 0.000 -0.003
7
-0.904 12.770 -1.978 -0.053 0.007
1.981 0.829 0.393 0.000 -0.002
8
-0.910 12.795 -1.981 -0.033 0.004
1.983 0.837 0.373 0.000 -0.001
9
-0.915 12.811 -1.983 -0.020 0.003
1.984 0.842 0.359 0.000 -0.001
10
-0.918 12.821 -1.984 -0.013 0.002
1.985 0.845 0.351 0.000 0.000
11
-0.919 12.827 -1.985 -0.008 0.001
1.985 0.847 0.345 0.000 0.000
12
-0.921 12.831 -1.985 -0.006 0.001
Example #2:
x 2y + y = 3
3x − xy 2 = 0
Solution:
Jacobian Matrix,
2𝑥𝑦 𝑥2 + 1
J=[ ]
3 − 𝑦2 2𝑥𝑦
Initial Guess: x = 2, y = 1.
Therefore, x = 0 and y = 3
Example #3:
YOU CAN ALSO USE THIS METHOD FOR SYSTEM OF LINEAR EQUATION.
Example #4:
6𝑥 − 2𝑦 + 𝑧 = 11
𝑥 + 2𝑦 − 5𝑧 = −1
−2𝑥 + 7𝑦 + 2𝑧 = 5
Solution:
The Jacobian matrix of a linear equation will be equal to its augmented matrix.
6 −2 1
J=[ 1 2 −5]
−2 7 2
Initial Guess: x = 0, y = 0, z = 0.
PROBLEM SET #3
1. Determine the values of the variables to satisfy the equation.
4𝑎 − 𝑏 + 𝑐 + 𝑑 = 14
2𝑎 − 2𝑏 + 3𝑐 − 7𝑑 = −21
𝑎 − 5𝑏 − 𝑐 + 2𝑑 = 24
𝑎 − 2𝑏 + 4𝑐 − 𝑑 = 10
2. Solve the following system of nonlinear equation using Newton’s Method. (you can use MS Excel)
A. LESSON PREVIEW/REVIEW
1) Introduction
The basic problem in numerical integration is to compute an approximate solution to a definite integral
𝑏
∫𝑎 𝑓 (𝑥 )𝑑𝑥 to a given degree of accuracy. If f(x) is a smooth function integrated over a small number of
dimensions, and the domain of integration is bounded, there are many methods for approximating the integral to
the desired precision.
B. MAIN LESSON
1) Activity 2: Content Notes
Quadrature Formulas
1. Trapezoidal Rule
2. Simpson’s Rule
3. Simpson’s 3/8 Rule
4. Boole’s Rule
1. TRAPEZOIDAL RULE
Geometrically, the integral is equivalent to approximating the area of the trapezoid under the straight
line connecting f(a) and f(b).
2. SIMPSON’S RULE
4. BOOLE’S RULE
Where h = (e – a)/4
EXAMPLE #1.
Evaluate the definite integral using the first four Newton-Cotes quadrature formulas.
2
ln(𝑥)
∫ 𝑑𝑥
1 𝑥
Solution:
a. Trapezoidal Rule
h = 2 -1 = 1; h=1
2
ln(𝑥) ℎ
∫ 𝑑𝑥 ⋍ (𝑓𝑎 + 𝑓𝑏 )
1 𝑥 2
ln(1)
𝑓𝑎 = =0
1
ln(2)
𝑓𝑏 = = 0.34657
2
1
= (0 + 0.34657) = 𝟎. 𝟏𝟕𝟑𝟐𝟖𝟓
2
b. Simpson’s Rule
2
ln(𝑥) ℎ
∫ 𝑑𝑥 ⋍ (𝑓𝑎 + 4𝑓𝑏 + 𝑓𝑐 )
1 𝑥 3
ln(1)
𝑓𝑎 = =0
1
ln(1.5)
𝑓𝑏 = = 0.27031
1.5
ln(2)
𝑓𝑐 = = 0.34657
2
0.5
= (0 + 4(0.27031) + 0.34657) = 𝟎. 𝟐𝟑𝟕𝟗𝟕
3
2
ln(𝑥) 3ℎ
∫ 𝑑𝑥 ⋍ (𝑓 + 3𝑓𝑏 + 3𝑓𝑐 + 𝑓𝑑 )
1 𝑥 8 𝑎
ln(1)
𝑓𝑎 = =0
1
ln(4/3)
𝑓𝑏 = = 0.21576
4/3
ln(5/3)
𝑓𝑐 = = 0.3065
5/3
ln(2)
𝑓𝑑 = = 0.34657
2
1/3
= (0 + 3(0.21576) + 3(0.3065) + 0.34657) = 𝟎. 𝟐𝟏𝟐𝟓𝟗
3
d. Boole’s Rule
2
ln(𝑥) 2ℎ
∫ 𝑑𝑥 ⋍ (7𝑓𝑎 + 32𝑓𝑏 + 12𝑓𝑐 + 32𝑓𝑑 + 7𝑓𝑒 )
1 𝑥 45
ln(1)
𝑓𝑎 = =0
1
ln(1.25)
𝑓𝑏 = = 0.17851
1.25
ln(1.5)
𝑓𝑐 = = 0.27031
1.5
ln(1.75)
𝑓𝑑 = = 0.31978
1.75
ln(2)
𝑓𝑒 = = 0.34657
2
2(0.25)
= (7(0) + 32(0.17851) + 12(0.27031) + 32(0.31978) + 7(0.34657)) = 𝟎. 𝟐𝟒𝟎𝟏𝟕
45
2
ln(𝑥) 1 1 1
∫ 𝑑𝑥 = (ln(𝑥))2 = (ln(2))2 − (ln(1))2 = 𝟎. 𝟐𝟒𝟎𝟐𝟑
1 𝑥 2 2 2
Example #2.
Evaluate the definite integral using the first four Newton-Cotes quadrature formulas.
1
∫ [1 + 𝑒 −𝑧 sin(4𝑥)]𝑑𝑥
0
Solution:
Always set your calculator in ‘Radian Mode’ when dealing with a trigonometric function.
Example #3.
Solution:
2
2ℎ
∫ 𝑥𝑠𝑖𝑛 (2𝑥)𝑑𝑥 ⋍ (7𝑓𝑎 + 32𝑓𝑏 + 12𝑓𝑐 + 32𝑓𝑑 + 7𝑓𝑒 )
1 45
2(𝜋⁄8)
= (7(0) + 32(0.27768) + 12(0.78540) + 32(0.83304) + 7(0)) = 𝟎. 𝟕𝟖𝟒𝟖𝟒
45
Evaluate the definite integral using the first four Newton-Cotes quadrature formulas.
𝜋
2
𝑎. ∫ 𝑥 2 cos 𝑥𝑑𝑥
0
3
𝑥+3
𝑏. ∫ 𝑑𝑥
1 𝑥 2 − 3𝑥 − 10
2
𝑐. ∫ 𝑥 3 ln(𝑥 2 )𝑑𝑥
1
ASSIGNMENT #5. Evaluate the definite integral using the first four Newton-Cotes quadrature formulas.
10
√𝑥 2 + 9
𝑎. ∫ 𝑑𝑥
5 𝑥
1
𝑏. ∫ 4 𝑥 (𝑥 3 )𝑑𝑥
−1
C. LESSON WRAP-UP
1) Activity 6: Thinking about Learning