Uocmath M 01 03 11 17 29 31 37 38 52 59
Uocmath M 01 03 11 17 29 31 37 38 52 59
Uocmath M 01 03 11 17 29 31 37 38 52 59
ASSIGNMENT 01 2023
UNIVERSITY OF CHAKWAL
Department of Mathematics
Task: Assignment 01
Submitted To: Dr. Shahid Hasnain
Email: [email protected]
Introduction
In the realm of numerical analysis, the question to solve non linear equations stands as a pivot
challenge. This report embarks on an exploration of various numerical methods employed
to tackle such complexities, focusing on the Bisection method, Newton Raphson method and
secant method. Each’s method unique approached intricacies in solving non linear equations
will be dissected and evaluated, shedding light on their applications, limitations and compar-
ative efficiency in different scenarios. Through an in depth analysis of these techniques this
report aims to unravel the naunced world of non linear equations solution providing insights
into their computational methodologies and practical implementations.
Root finding in non linear equations constitute a fundamental challenge across, scientific en-
gineering and computational domains. This report delves into fundamental principles of three
prominent numerical methods:
The bisection method known for its simplicity and reliability; the Newton Raphson method
prized for its rapid convergence but sensitive to initial guesses and the secant method: balanc-
ing convergence speed and simplicity. Through this comprehensive investigation, this report
seeks to empower practitioners with a naunced understanding of these techniques, enabling
informed selection and applications in solving non linear equations.
Methodology
The problem one is related to find root of a non linear equation. For this we use Root Brack-
eting Criteria find an interval on which function has alternative signs. Then we use Bisection
Method to find the approximated root. For this we did about 5-7 iterations and find a root.
Then same problem, we solved by using Method Of False Position, and in the same way we
get a root which is also an approximated root. Then we use Newton Raphson Method to find
the approximated root. After this we compare the solution of all three methods and found
Newton Raphson Method better than other two.
In the same way for problem 02 we use Secant method and Newton Raphson Method. Then
by comparasion of these two method we found Newton Raphson Method much better.
In the end we find the melting point of alloy containing 84 percent lead by using the given
data. For this we use Lagrange interpolation method.
Problem 01
Show that
f (x) = x3 + 4x2 -10 = 0
has a root in [xi , xi+1 ] and determine an approximation to the root that is accurate to at least within
10−4 .
Solution:
Here f(x) = x3 + 4x2 -10
Root Bracketing Criteria:
x 0 1 1.3 1.4
f(x) -10 -5 -1.043 0.584
so, we choose
a0 = 1.3 and b0 = 1.4
f (a0 ) = -1.0433 and f (b0 ) = 0.584
Bisection Method:
n an bn xn+1 = an +b
2
n
f (xn )
0 1.3 1.4 1.35 -0.2496
1 1.35 1.4 1.375 0.16211
2 1.35 1.375 1.3625 -0.0450
3 1.3625 1.375 1.36875 0.05823
4 1.3625 1.3656 1.3656 0.0065
5 1.3625 1.3656 1.36405 -0.019475
2
Method Of False Position:
Here f(x) = x3 + 4x2 -10
a0 = 1.3 and b0 = 1.4
f (a0 ) = -1.0433 and f (b0 ) = 0.584
Formula
xn+1 = an ff(b n )−bn f (an )
(bn −f (an )
Therefore 1.3752 is the root of given equation by using regula falsi method and is correct upto 5sf.
x1 x2 x3 x4
1.3733 1.3653 1.36523 1.36520013
3
Figure 3: Graph of given function by using Newton Raphson Method
Comparasion
As the exact root of given Equation is 1.365230013
so we get the following roots by Bisection Method,Regula Falsi Method,Newton Raphson Method.
Problem 02
Use the secant method to find a solution to x=cos(x) and compare the approximation with newton
raphson method.
Solution
given that x= cos(x)
Secant Method:
Here f(x) = x - cos(x)
We have to use root bracketing Criterion to find the approximate root.
For this, we have to choose an interval [xi , xi+1 ] such that
f (xi ) f (xi+1 ) < 0
x 0 1
f (x) −1 0.4597
Let,
x0 = 0.7 and x1 = 0.8
f (x0 ) = -0.0648 and f (x1 ) = 0.01033
By Secant Method:
4
xn−1 f (xn )−xn f (xn−1 ))
xn+1 = f (xn )−f (xn−1 )
xn sin(xn )+cos(xn )
xn+1 = 1+sin(xn )
x1 x2 x3 x4
0.781751 0.7394691 0.7390851 0.7390851
Comparasion:
By using secant Method we get 0.7390 in 3 iterations.
By using Newtons Raphson Method we have an approximated root 0.7390851 , which is much closer and is
correct upto more than 4dp as compared to Secant Method.
so the root obtained by using NRM is more accurate.
5
Figure 5: Graph of given function by using Newton Raphson Method
Problem 03
The following data gives the melting point of alloy of lead and zinc where T is temperature in degrees
c and P is percentage of lead in alloy.
P 40 50 60 70 80 90
T 180 204 226 250 276 304
Solution:
P 40 50 60 70 80 90
T 180 204 226 250 276 304
The value 84 is near the end of data table.So we use Newton’ s Backward interpolation formula.
x y ▽y ▽2 y ▽3 y ▽4 y ▽5 y
40 184
20
50 204 2
22 0
60 226 2 0
24 0 0
70 250 2 0
26 0
80 276 2
28
90 304
xn = 90 , yn = 304 , ▽yn = 28 , ▽2 yn = 2
▽3 yn = 0 , ▽4 yn = 0 , ▽5 yn = 0, h=10
P = x−xh
n
= 84−90
10 = -0.6
P (P +1)▽2 yn P (P +1)(P +2)▽3 yn P (P +1)(P +2)(P +3)▽4 yn P (P +1)(P +2)(P +3)(P +4)▽5 yn
f (x) = yn + P▽yn + 2! + 3! + 4! + 5!
+ ...
6
f (84) = 304 - 16.8 - 0.24
= 286. 96
Reference