Assignment 3: Numerical Methods — Solutions
1) Solve x^2 + 4x ln(x) = 0 using Newton's method (correct to 4 decimal places)
Function: f(x) = x^2 + 4x ln(x)
Derivative: f'(x) = 2x + 4 ln(x) + 4
Initial guess: x0 = 0.5 (must be > 0 because ln(x) defined)
Applying Newton iterations (x_{n+1} = x_n - f(x_n)/f'(x_n)).
Final approximate root (Newton): 0.8155534188
Rounded to 4 decimal places: 0.8156
2) Find root of f(x) = cos(x) - x in [0,1] by bisection method (4 decimals)
Function: f(x) = cos(x) - x
Interval: [0,1]
Bisection result (high-accuracy): 0.7390851378
Rounded to 4 decimals: 0.7391
3) Solve x^3 - x - 1 = 0 by iteration method (4 decimals)
Function: f(x) = x^3 - x - 1
Real root (reference via Newton): 1.3247179572
Rounded to 4 decimals: 1.3247
Example fixed-point scheme: g(x) = (1 + x)^(1/3)
Starting at x0 = 1.3, fixed-point iteration gives (example iterates):
Iter 1: x_old = 1.3000000000 -> x_new = 1.3200061218
Iter 2: x_old = 1.3200061218 -> x_new = 1.3238223540
Iter 3: x_old = 1.3238223540 -> x_new = 1.3245478185
Iter 4: x_old = 1.3245478185 -> x_new = 1.3246856391
Iter 5: x_old = 1.3246856391 -> x_new = 1.3247118185
Iter 6: x_old = 1.3247118185 -> x_new = 1.3247167912
Iter 7: x_old = 1.3247167912 -> x_new = 1.3247177358
Iter 8: x_old = 1.3247177358 -> x_new = 1.3247179152
Iter 9: x_old = 1.3247179152 -> x_new = 1.3247179493
Iter 10: x_old = 1.3247179493 -> x_new = 1.3247179557
4) Newton forward interpolation (or polynomial through data) — find y when x = 5
Given table:
x: 0, 1, 2, 3, 4
y: 1, 14, 51, 124, 257
Fit a degree-4 polynomial through these points (unique) and evaluate at x = 5.
Polynomial coefficients (highest degree first): 0.5, -1, 11.5, 2, 1
Value at x = 5: 486.0000000000
Rounded to 4 decimals: 486.0000
5) Solve f(x) = cos(x) - x = 0 in [0,1] using Newton-Raphson (4 decimals)
Using Newton's method with initial guess x0 = 0.5:
Final approximate root: 0.7390851332
Rounded to 4 decimals: 0.7391
6) Solve f(x) = e^x - 3x = 0 in [0,1] using bisection (4 decimals)
f(0) = 1, f(1) = e - 3 ≈ -0.281718 (opposite signs ⇒ root in [0,1])
Bisection result: 0.6190612912
Rounded to 4 decimals: 0.6191
Summary of final answers (rounded to 4 decimal places):
1) 0.8156
2) 0.7391
3) 1.3247
4) y(5) = 486.0000
5) 0.7391
6) 0.6191