# MTH603 Assignment 1 Solution and Discussion

• Question #1: Find the root of the equation x^3+x^2+x-1 =0 correct to two decimal places by using bisection method.
Question #2: Solve the system of linear equations with the help of Gaussian elimination method.
2x + y + z = 9;3x −2y + 4z = 9;x +y-2z = 3

Solution File

• Question #2: Solve the system of linear equations with the help of Gaussian elimination method.
2x + y + z = 9;3x −2y + 4z = 9;x +y-2z = 3

System of Linear Equations entered :

 2x + y + z = 9
 3x - 2y + 4z = 9
 x + y - 2z = 3

Solve by Substitution :

// Solve equation  for the variable y

 y = -x + 2z + 3

// Plug this in for variable y in equation 

 2x + (-x +2z+3) + z = 9
 x + 3z = 6
// Plug this in for variable y in equation 

 3x - 2•(-x +2z+3) + 4z = 9
 5x = 15
// Solve equation  for the variable x

 5x = 15

 x = 3
// Plug this in for variable x in equation 

 (3) + 3z = 6
 3z = 3
// Solve equation  for the variable z

 3z = 3

 z = 1
// By now we know this much :

x = 3
y = -x+2z+3
z = 1
// Use the x and z values to solve for y
y = -(3)+2(1)+3 = 2

Solution :
{x,y,z} = {3,2,1}

• Question #1: Find the root of the equation x^3+x^2+x-1 =0 correct to two decimal places by using bisection method.

We now use the Bisection Method to approximate one of the solutions. The Bisection Method is an iterative procedure to approximate a root (Root is another name for a solution of an equation).

The function is F(x) = x3 + x2 + x - 1

At x= 0.00 F(x) is equal to -1.00
At x= 1.00 F(x) is equal to 2.00

Intuitively we feel, and justly so, that since F(x) is negative on one side of the interval, and positive on the other side then, somewhere inside this interval, F(x) is zero

Procedure :
(1) Find a point “Left” where F(Left) < 0

(2) Find a point ‘Right’ where F(Right) > 0

(3) Compute ‘Middle’ the middle point of the interval [Left,Right]

(4) Calculate Value = F(Middle)

(5) If Value is close enough to zero goto Step (7)

Else :
If Value < 0 then : Left <- Middle
If Value > 0 then : Right <- Middle

(6) Loop back to Step (3)

(7) Done!! The approximation found is Middle

Follow Middle movements to understand how it works :

 Left Value(Left) Right Value(Right) 0.000000000 -1.000000000 1.000000000 2.000000000 0.000000000 -1.000000000 1.000000000 2.000000000 0.500000000 -0.125000000 1.000000000 2.000000000 0.500000000 -0.125000000 0.750000000 0.734375000 0.500000000 -0.125000000 0.625000000 0.259765625 0.500000000 -0.125000000 0.562500000 0.056884766 0.531250000 -0.036590576 0.562500000 0.056884766 0.531250000 -0.036590576 0.546875000 0.009502411 0.539062500 -0.013703823 0.546875000 0.009502411 0.542968750 -0.002140820 0.546875000 0.009502411 0.542968750 -0.002140820 0.544921875 0.003670745 0.542968750 -0.002140820 0.543945312 0.000762452 0.543457031 -0.000689811 0.543945312 0.000762452 0.543457031 -0.000689811 0.543701172 0.000036164 0.543579102 -0.000326863 0.543701172 0.000036164 0.543640137 -0.000145359 0.543701172 0.000036164 0.543670654 -0.000054600 0.543701172 0.000036164 0.543685913 -0.000009219 0.543701172 0.000036164 0.543685913 -0.000009219 0.543693542 0.000013472 0.543685913 -0.000009219 0.543689728 0.000002127

Next Middle will get us close enough to zero:

F( 0.543688774 ) is -0.000000710

The desired approximation of the solution is:

x ≓ 0.543688774

Note, ≓ is the approximation symbol

One solution was found :
x ≓ 0.543688774  2

2

7

1

1

2

43
• ## MTH603 Assignment 1 Solution and Discussion MTH603 - Numerical Analysis • assignment 1 discussion mth603 solution spring 2021 • • Ozair

3  | |