Direct Method 1. by Elimination: Combine 1 and 2 Equations To Eliminate Z

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

1.

x – 3y + 2 z = 11
2. 2x + y – 4z = -9
3. 3x – 2y + z = 11

A. Direct Method
1. By Substitutution and Elimination
2. Cramers Rule
3. Inverse
4. Gaussian Elimination
5. Gauss-Jordan
6. LU Factorization

B. Indirect Method
1. Gauss Seidel
2. Jacobi Method

DIRECT METHOD

1. By Elimination

x – 3y + 2z = 11 1st equation
2x + y – 4z = -9 2nd equation
3x – 2y + z = 11 3rd equation

Combine 1st and 2nd equations to eliminate z


x – 3y + 2 z = 11 1st equation (multiply by 2)
2x + y – 4z = -9 2nd equation
therefore
2x – 6y + 4z = 22
2x + y – 4z = -9
4x – 5y = 13 4th equation

Combine 2nd and 3rd equations to eliminate z


2x + y – 4z = -9 2nd equation
3x – 2y + z = 11 3rd equation (multiply by 4)
therefore
2x + y – 4z = -9
12x – 8y + 4z = 44
14x -7y = 35 5th equation

Combine 4th and 5th equations to eliminate y


4x – 5y = 13 4th equation (multiply by -7)
14x -7y = 35 5th equation (multiply by 5)
therefore
-28x + 35y = -91
70x -35y = 175
42x = 84
x=2 value of x

Substitute the value of x to either 4th or 5th equation


Using 4th equation Using 5th equation
4x – 5y = 13 14x -7y = 35
4(2) – 5y = 13 14(2) -7y = 35
8-13 = 5y 28 – 35 = 7y
y = -1 value of y y = -1 value of y

Substitute the values of x and y to any of the 3 original equation to solve for z.
Using 1st equation Using 2nd equation Using 3rd equation
x – 3y + 2 z = 11 2x + y – 4z = -9 3x – 2y + z = 11
2 – 3(-1) + 2 z = 11 2(2) + (-1) – 4z = -9 3(2) – 2(-1) + z = 11
2z = 11 – 2 - 3 4z = 4 -1 + 9 z = 11 – 6 – 2
z=3 value of z z=3 value of z z=3 value of z

By Substitution

x – 3y + 2z = 11 1st equation
2x + y – 4z = -9 2nd equation
3x – 2y + z = 11 3rd equation

Solve 1st equation to get the value of x in terms of y and z


x – 3y + 2z = 11 1st equation
x = 3y - 2z +11 revised 1st equation

Substitute the revised 1st equation to 2nd equation and solve the value of y in terms of z
2x + y – 4z = -9 2nd equation
2(3y - 2z +11) + y – 4z = -9
6y – 4z + 22 + y – 4z = -9
7y = - 31 + 8z 4th equation

Substitute the revised 1st equation to 3rd equation and solve the value of y in terms of z
3x – 2y + z = 11
3(3y - 2z +11) – 2y + z = 11
9y – 6z + 33 – 2y + z = 11
7y = -22 + 5z 5th equation

Substitute 4th equation to 5th equation or equate the value of 7y


- 31 + 8z = -22 + 5z
3z = 9
z=3 value of z

Substitute the value of z to either 4th or 5th equation to solve for y


Using 4th equation Using 5th equation
7y = - 31 + 8z 7y = -22 + 5z
7y = - 31 + 8(3) 7y = -22 + 5(3)
7y = -7 7y = -7
y = -1 value of y y = -1 value of y

Substitute the values of y and z to any of the 3 original equations to solve for x
Using 1st equation Using 2nd equation Using 3rd equation
x – 3y + 2 z = 11 2x + y – 4z = -9 3x – 2y + z = 11
x – 3(-1) + 2(3) = 11 2x + (-1) – 4(3) = -9 3x – 2(-1) + (3) = 11
x = 11 – 3 - 6 2x = - 9 + 1 + 12 3x = 11 – 2 - 3
x=2 value of x x=2 value of x x=2 value of x

2. Cramer’s Rule

x – 3y + 2z = 11 1st equation
2x + y – 4z = -9 2nd equation
3x – 2y + z = 11 3rd equation

Dx Dy Dz
x y z
D D D

Solve the determinant by getting the coefficients of x, y and z of all equations


1 3 2 1 3
2 1 4 2 1 note: all going down are + and all going up are -
3 2 1 3 2

D = (1*1*1) + (-3*-4*3) + (2*2*-2) – (3*1*2) – (-2*-4*1) – (1*2*-3)


D = (1) + (36) + (-8) – (6) – (8) – (-6)
D = 21

Solve for Dx by substituting the constants to values of x


11 3 2 11 3
9 1 4 9 1
11 2 1 11 2

Dx = (11*1*1) + (-3*-4*11) + (2*-9*-2) – (11*1*2) – (-2*-4*11) – (1*-9*-3)


Dx = (11) + (132) + (36) – (22) – (88) – (27)
Dx = 42

Dx 42
therefore x   2 value of x
D 21
Solve for Dy by substituting the constants to values of y
1 11 2 1 11
2 9 4 2 9 note: all going down are + and all going up are -
3 11 1 3 11

Dy = (1*-9*1) + (11*-4*3) + (2*2*11) – (3*-9*2) – (11*-4*1) – (1*2*11)


Dy = (-9) + (-132) + (44) – (-54) – (-44) – (22)
Dy = -21

Dy 21
Therefore y    1 value of y
D 21

Solve for Dz by substituting the constants to values of z


1 3 11 1 3
2 1 9 2 1 note: all going down are + and all going up are -
3 2 11 3 2

D = (1*1*11) + (-3*-9*3) + (11*2*-2) – (3*1*11) – (-2*-9*1) – (11*2*-3)


D = (11) + (81) + (-44) – (33) – (18) – (-66)
D = 63

Dz 63
therefore z   3 value of z
D 21

INDIRECT METHOD

1. Gauss Seidel

x – 3y + 2z = 11 1st equation
2x + y – 4z = -9 2nd equation
3x – 2y + z = 11 3rd equation

1 3 2
2 1 4
3 2 1

Not possible because the rule is to set the principal diagonal to be dominant. That is to
have a coefficient greater than the sum of the other two coefficients therefore revised the
order of equation if possible or combine any of the two equation to form another
equation that will satisfy the rule.

3x – 2y + z = 11 3rd equation
x – 3y + 2z = 11 1st equation
2x + y – 4z = -9 2nd equation

3 2 1
1 3 2
2 1 4

Set x = 1 , y = 1 and z = 1 ψ = 0.001

Value of x Value of y Value of z Error


1
2
3
4
5
6
7
8
9
10
11

You might also like