0% found this document useful (0 votes)
12 views3 pages

MTH603 BC190206698 Assignment 1

The document outlines the process of finding the roots of the equation −x e^x + cos x = 0 using three methods: Newton-Raphson, Secant, and Bisection. The Newton-Raphson method yields roots approximately 0.5180 and 0.5178, the Secant method gives approximately 0.3147 and 0.4467, while the Bisection method provides midpoints of 0.75, 0.625, and an approximate root of 0.5625. Each method is executed for two iterations with specified initial values.

Uploaded by

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

MTH603 BC190206698 Assignment 1

The document outlines the process of finding the roots of the equation −x e^x + cos x = 0 using three methods: Newton-Raphson, Secant, and Bisection. The Newton-Raphson method yields roots approximately 0.5180 and 0.5178, the Secant method gives approximately 0.3147 and 0.4467, while the Bisection method provides midpoints of 0.75, 0.625, and an approximate root of 0.5625. Each method is executed for two iterations with specified initial values.

Uploaded by

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

MTH603

Assignment 1
ID: BC190206698

Question:
Find the roots of the equation −x e x + cos x=0 up to two iterations by using

1. Newton Raphson Method (Take x 0=0.5 )


2. Secant Method (Take x 0=0 and x 1=1)
3. Bisection Method (Take [0.5, 1]).

Solution:
f(x)=−xex+cos(x)
1. Newton-Raphson Method
The Newton-Raphson formula for finding the root of f(x)=0 is:
xn+1=xn−f(xn)/f′(xn)x
where f(x)=−xex+cos(x) and we need the derivative f′(x).
Derivative Calculation
f′(x)=−ex−xex−sin(x)
Let’s take,
Starting with x0=0.5, we calculate two iterations.
Iteration Steps
1. First Iteration:
x1= x0−f(x0)/f′(x0)
Substituting x0=0.5:
x1≈0.5180
Second Iteration:
x2=x1−f(x1)f′(x1)
Substituting x1=0.5180:
x2≈0.5178
Results after two iterations:
 x1=0.5180
 x2=0.5178

2. Secant Method
The Secant Method formula for finding the root of f(x)=0f(x) = 0f(x)=0 is:
xn+1=xn−f(xn)*xn−(xn−1)/f(xn)−f(xn−1)
Let’s take:
We start with x0=0 and x1=1, and perform two iterations.
Iteration Steps
1. First Iteration:
x2=x1−f(x1)*(x1−x0)/ f(x1)−f(x0)
Substituting x0=0 and x1=1:
x2≈0.3147

2. Second Iteration:
x3=x2−f(x2) * (x2−x1) /f(x2)−f(x1)
Substituting x1=1 and x2=0.3147:
x3≈0.4467
Results after two iterations:
 x2=0.3147
 x3=0.4467

3. Bisection Method
Initial Interval
Given interval: [0.5,1]
Iteration Steps
1. First Iteration:
o Midpoint:
c1=0.5+1/2=0.75
o Evaluate f(c1)
Since f(0.5)*f(0.75)<0,
Now, we choose the new interval [0.5,0.75],
2. Second Iteration:
o New midpoint:
c2=0.5+0.752=0.625
o Evaluate f(c2):
Since f(0.5)*f(0.625)<0
We choose the new interval [0.5,0.625],
3. Third Iteration (Root Estimate):
o Midpoint: c3=0.5+0.625/2= 0.5625
Results after two iterations:
 Midpoints for root estimation:
c1=0.75
c2=0.625,
and c3=0.5625 (approximate root)

You might also like