Suggestions logoSuggestions

Answers

Reference answers and worked solutions.

1. Graphical Method

Given

f(x)=x32x5f(x)=x^3-2x-5

a) Equation is nonlinear because highest power of xx is 33.

b) Sign-change intervals:

f(2)=845=1f(2) = 8-4-5 = -1 f(3)=2765=16f(3) = 27-6-5 = 16

So root lies in [2,3][2,3].

Again,

f(2.09)=2.0932(2.09)50.050671f(2.09) = 2.09^3-2(2.09)-5 \approx -0.050671 f(2.10)=2.1032(2.10)50.061f(2.10) = 2.10^3-2(2.10)-5 \approx 0.061

So narrower interval is [2.09,2.10][2.09,2.10].

c) Graph of cubic crosses xx-axis near

x2.09x \approx 2.09

2. Bisection Method

Given

f(x)=x37f(x)=x^3-7

a)

f(1)=17=6,f(2)=87=1f(1)=1-7=-6,\qquad f(2)=8-7=1

Since f(1)f(2)<0f(1)f(2)<0, root exists in [1,2][1,2].

b) Interval is suitable because f(x)f(x) is continuous and signs at endpoints are opposite.

c) Bisection table with TOL=0.005\mathrm{TOL}=0.005:

Iterationaabbc=a+b2c=\frac{a+b}{2}f(c)f(c)
01.0000002.0000001.500000-3.625000
11.5000002.0000001.750000-1.640625
21.7500002.0000001.875000-0.408203
31.8750002.0000001.9375000.273193
41.8750001.9375001.906250-0.073090
51.9062501.9375001.9218750.098644
61.9062501.9218751.9140620.012427

Final interval:

[1.90625, 1.9140625][1.90625,\ 1.9140625]

Approximate root:

x1.90625+1.91406252=1.910156251.910x \approx \frac{1.90625+1.9140625}{2}=1.91015625 \approx 1.910

3. Fixed Point Iteration Method

Given

x3+x6=0x^3+x-6=0

a) Two possible fixed-point forms:

x=6x3x=\sqrt[3]{6-x} x=6x3x=6-x^3

Use

xn+1=6xn3x_{n+1}=\sqrt[3]{6-x_n}

because it converges near root.

b) Suitable initial guess:

x0=1.5x_0=1.5

c) Iteration table:

Iterationxnx_nxn+1x_{n+1}Error xn+1xn\lvert x_{n+1}-x_n \rvert
01.5000001.6509640.150964
11.6509641.6322910.018672
21.6322911.6346240.002333

Since error <0.005<0.005, stop.

Approximate root:

x1.6346x \approx 1.6346

4. Secant Method

Given

f(x)=x34x9f(x)=x^3-4x-9

a)

f(2)=889=9f(2)=8-8-9=-9 f(3)=27129=6f(3)=27-12-9=6

So root lies in (2,3)(2,3).

b) Choose

x0=2,x1=3x_0=2,\qquad x_1=3

c) Secant formula:

xn+1=xnf(xn)(xnxn1)f(xn)f(xn1)x_{n+1}=x_n-\frac{f(x_n)(x_n-x_{n-1})}{f(x_n)-f(x_{n-1})}

Five iterations:

Iterationxn1x_{n-1}xnx_nxn+1x_{n+1}f(xn+1)f(x_{n+1})
12.0000003.0000002.600000-1.824000
23.0000002.6000002.693252-0.237227
32.6000002.6932522.7071930.011956
42.6932522.7071932.706524-0.000072
52.7071932.7065242.706528-0.000000

Approximate root:

x2.706528x \approx 2.706528

5. Newton-Raphson Method

Given

f(x)=x32x2+3f(x)=x^3-2x^2+3

a) Stopping criterion:

xn+1xn<εorf(xn+1)<ε|x_{n+1}-x_n|<\varepsilon \quad \text{or} \quad |f(x_{n+1})|<\varepsilon

b)

f(x)=3x24xf'(x)=3x^2-4x

Newton-Raphson formula:

xn+1=xnxn32xn2+33xn24xnx_{n+1}=x_n-\frac{x_n^3-2x_n^2+3}{3x_n^2-4x_n}

c) Take x0=1.5x_0=-1.5.

Iterationxnx_nf(xn)f(x_n)f(xn)f'(x_n)xn+1x_{n+1}
0-1.500000-4.87500012.750000-1.117647
1-1.117647-0.8943628.217993-1.008817
2-1.008817-0.0621117.088407-1.000055
3-1.000055-0.0003857.000550-1.000000
4-1.000000-0.0000007.000000-1.000000
5-1.0000000.0000007.000000-1.000000

Root after six iterations:

x1x \approx -1

6. Gaussian Elimination Method

System:

3x+yz=43x+y-z=4 2x4y+5z=32x-4y+5z=-3 x+2y+3z=10x+2y+3z=10

a) Augmented matrix:

[3114245312310]\left[\begin{array}{ccc|c} 3 & 1 & -1 & 4 \\ 2 & -4 & 5 & -3 \\ 1 & 2 & 3 & 10 \end{array}\right]

b) Upper triangular form:

R2R223R1,R3R313R1R_2 \leftarrow R_2-\frac23R_1,\qquad R_3 \leftarrow R_3-\frac13R_1 [31140143173173053103263]\left[\begin{array}{ccc|c} 3 & 1 & -1 & 4 \\ 0 & -\frac{14}{3} & \frac{17}{3} & -\frac{17}{3} \\ 0 & \frac{5}{3} & \frac{10}{3} & \frac{26}{3} \end{array}\right] R3R3+514R2R_3 \leftarrow R_3+\frac{5}{14}R_2 [311401431731730075149314]\left[\begin{array}{ccc|c} 3 & 1 & -1 & 4 \\ 0 & -\frac{14}{3} & \frac{17}{3} & -\frac{17}{3} \\ 0 & 0 & \frac{75}{14} & \frac{93}{14} \end{array}\right]

c) Back substitution:

z=93/1475/14=3125=1.24z=\frac{93/14}{75/14}=\frac{31}{25}=1.24 y=6825=2.72y=\frac{68}{25}=2.72 x=2125=0.84x=\frac{21}{25}=0.84

So

x=0.84,y=2.72,z=1.24x=0.84,\qquad y=2.72,\qquad z=1.24

7. Gaussian Elimination with Partial Pivoting

System:

0.2x+3y+z=80.2x+3y+z=8 4x+yz=74x+y-z=7 2x+5y+2z=102x+5y+2z=10

a) Partial pivoting is required because first pivot 0.20.2 is very small. Dividing by it may cause large round-off error.

b) Row interchange:

R1R2R_1 \leftrightarrow R_2

Largest absolute value in first column becomes pivot.

c) Start:

[0.2318411725210]R1R2[41170.231825210]\left[\begin{array}{ccc|c} 0.2 & 3 & 1 & 8 \\ 4 & 1 & -1 & 7 \\ 2 & 5 & 2 & 10 \end{array}\right] \xrightarrow{R_1 \leftrightarrow R_2} \left[\begin{array}{ccc|c} 4 & 1 & -1 & 7 \\ 0.2 & 3 & 1 & 8 \\ 2 & 5 & 2 & 10 \end{array}\right]

Eliminate first column:

R2R2120R1,R3R312R1R_2 \leftarrow R_2-\frac{1}{20}R_1,\qquad R_3 \leftarrow R_3-\frac12R_1 [41170592021201532009252132]\left[\begin{array}{ccc|c} 4 & 1 & -1 & 7 \\ 0 & \frac{59}{20} & \frac{21}{20} & \frac{153}{20} \\ 0 & \frac{9}{2} & \frac{5}{2} & \frac{13}{2} \end{array}\right]

Second pivot: 92>5920\left|\frac92\right|>\left|\frac{59}{20}\right|, so swap

R2R3R_2 \leftrightarrow R_3

Then

R3R35990R2R_3 \leftarrow R_3-\frac{59}{90}R_2 [4117092521320053906118]\left[\begin{array}{ccc|c} 4 & 1 & -1 & 7 \\ 0 & \frac{9}{2} & \frac{5}{2} & \frac{13}{2} \\ 0 & 0 & -\frac{53}{90} & \frac{61}{18} \end{array}\right]

Back substitution gives

z=305535.7547z=-\frac{305}{53}\approx -5.7547 y=246534.6415y=\frac{246}{53}\approx 4.6415 x=45530.8491x=-\frac{45}{53}\approx -0.8491

8. Gauss-Seidel Method

Given

10x+yz=1110x+y-z=11 2x+10y+z=122x+10y+z=12 2x+3y+10z=14-2x+3y+10z=14

a) Iterative form:

x=11y+z10x=\frac{11-y+z}{10} y=122xz10y=\frac{12-2x-z}{10} z=14+2x3y10z=\frac{14+2x-3y}{10}

b) Diagonal dominance:

10>1+1=2|10|>|1|+|{-1}|=2 10>2+1=3|10|>|2|+|1|=3 10>2+3=5|10|>|{-2}|+|3|=5

So system is diagonally dominant. Gauss-Seidel will converge.

c) With x0=y0=z0=0x_0=y_0=z_0=0:

Iterationxxyyzz
00.0000000.0000000.000000
11.1000000.9800001.326000
21.1346000.8404801.374776
31.1534300.8318361.381135
41.1549300.8309011.381716

After four iterations:

x1.15493,y0.83090,z1.38172x \approx 1.15493,\qquad y \approx 0.83090,\qquad z \approx 1.38172

IUS Preps - Your Academic Success Partner

On this page