CH3 correction tutorials
CH3 correction tutorials
Numerical Analysis
Tutorial 1 : Numerical solutions of linear systems
Solutions
Level : 3A & 3B
Exrecise 1 :
We are given :
f (x) = ex − 2x − 2, on I = [1, 2]
1. Uniqueness of solution
We check that f is continuous on [1, 2] :
So, by the Intermediate Value Theorem, ∃x∗ ∈ (1, 2) such that f (x∗ ) = 0.
Also, since f ′ (x) = ex − 2 > 0 for x ∈ [1, 2], f is strictly increasing → uniqueness of the root.
3. Bisection Iterations
Initial interval : [1, 2].
— c0 = 1+2 2 = 1.5, f (1.5) = e
1.5 − 3 − 2 ≈ 4.48 − 5 = −0.52
1.5+2
— c1 = 2 = 1.75, f (1.75) ≈ 5.75 − 5.5 = 0.25
— c2 = 1.5+1.75
2 = 1.625, f (1.625) ≈ 5.08 − 3.25 − 2 = −0.17
ex − 2
Then : x = g1 (x) = ln(2x + 2) and x = g2 (x) =
2
1
5. Fixed Point Convergence
Check derivative for g1 (x) = ln(2x + 2) :
2 1
g1′ (x) = = , x ∈ [1, 2] ⇒ g1′ (x) ∈ [0.5, 1]
2x + 2 x+1
So |g1′ (x)| ≤ 1, not strictly ¡ 1 → no guaranteed convergence.
x
For g2 (x) = e 2−2 :
ex e
g2′ (x) = , g2′ (1) = ≈ 1.36 > 1
2 2
→ Diverges.
−0.52
f (1.5) = e1.5 −2(1.5)−2 ≈ 4.48−3−2 = −0.52f ′ (1.5) = e1.5 −2 ≈ 4.48−2 = 2.48x1 = 1.5− ≈ 1.7097
2.48
Now for x1 = 1.7097 :
f (1.7097) ≈ e1.7097 − 2(1.7097) − 2 ≈ 5.53 − 3.42 − 2 = 0.11f ′ (1.7097) ≈ e1.7097 − 2 = 5.53 − 2 = 3.53
0.11
x2 = 1.7097 − 3.53 ≈ 1.6785
Exercise 2
Given :
f (x) = x3 + 3x − 3 on I = [0, 1]
2
2. Fixed Point Function
We are given :
3
g(x) = ⇒ f (x) = x3 + 3x − 3 = 0 ⇐⇒ g(x) = x
x2 +3
So |g ′ (x)| ≤ 2
3 holds.
3 3 3 3
x0 = 0.5x1 = g(0.5) = = ≈ 0.9231x2 = g(0.9231) ≈ 2
≈ ≈ 0.7791
0.25 + 3 3.25 (0.9231) + 3 3.8521
3 3
x3 = g(0.7791) ≈ 0.606+3 = 3.606 ≈ 0.832
3
4b. Explanation
Fixed-point method requires 16 iterations ; bisection only needs 10 → Bisection is more efficient
in this case because the contraction constant M0 is close to 1.
6x
|g ′ (x)| = , maximize over x ∈ [0, 1]
(x2 + 3)2
Maximum occurs at x = 1 :
6 6 3
M1 = = =
(12 + 3)2 16 8
Exercise 3
Given : h πi
f (x) = cos(x) − 3x on I = 0,
3
Also : h πi
′
f (x) = − sin(x) − 3 < 0 on 0,
3
→ f (x) is strictly decreasing → the solution is unique.
4
2. Bisection Iteration Estimate
We want :
π π 3.1416
n
< 10−3 ⇒ 2n > −3
≈ ≈ 1047.2 ⇒ n ≥ ⌈log2 1047.2⌉ ≈ 11
3·2 3 · 10 0.003
4. Fixed-Point Iteration
We are given :
cos(xn )
xn+1 = g(xn ) =
3
0.866
⇒ max |g ′ (x)| = ≈ 0.288 < 1
3
So the sequence converges.
5. Newton’s Method
5a. Iterative Scheme
Given :
f (xn ) cos(xn ) − 3xn
f (x) = cos(x) − 3x, f ′ (x) = − sin(x) − 3 ⇒ xn+1 = xn − ′
= xn −
f (xn ) − sin(xn ) − 3
5
5b. Good Initial Value
Choose x0 near the fixed-point result → x0 = 0.3
Exercise 4
We are given the equation :
Since f is continuous on [0, 1], by the Intermediate Value Theorem, there exists x∗ ∈ (0, 1) such
that f (x∗ ) = 0.
Also, the derivative :
6
3. Newton’s Method
a) Iterative Scheme and Initial Guess
We define :
f (x) = x3 − (1 − x) = x3 + x − 1, f ′ (x) = 3x2 + 1
Newton’s iteration :
f (xn ) x3n + xn − 1
xn+1 = xn − = x n −
f ′ (xn ) 3x2n + 1
We choose x0 = 0.5 (in the middle of the interval and likely to converge).
−0.375
x0 = 0.5, f (0.5) = 0.125+0.5−1 = −0.375, f ′ (0.5) = 3(0.25)+1 = 1.75 ⇒ x1 = 0.5− ≈ 0.7143
1.75
Next :
0.0783
f (0.7143) ≈ 0.364+0.7143−1 = 0.0783, f ′ (0.7143) = 3(0.7143)2 +1 ≈ 2.53 ⇒ x2 = 0.7143− ≈ 0.6833
2.53
Next :
0.0023
f (0.6833) ≈ 0.319 + 0.6833 − 1 = 0.0023, f ′ (0.6833) ≈ 2.4 ⇒ x3 = 0.6833 − ≈ 0.6824
2.4
Next :
f (0.6824) ≈ 0.68243 + 0.6824 − 1 ≈ 0.0001 ⇒ accuracy < 10−3
So, solution x∗ ≈ 0.6824 found in 4 iterations.