0% found this document useful (0 votes)
5 views

work hw2 csci3656

The document discusses fixed-point iteration methods for solving equations, providing multiple functions and their iterations. It includes detailed calculations for convergence and approximations for various problems, concluding with the best approximation from the iterations. The document also covers the uniqueness of fixed points and Newton's method for finding solutions to specific equations.

Uploaded by

joni5160
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

work hw2 csci3656

The document discusses fixed-point iteration methods for solving equations, providing multiple functions and their iterations. It includes detailed calculations for convergence and approximations for various problems, concluding with the best approximation from the iterations. The document also covers the uniqueness of fixed points and Newton's method for finding solutions to specific equations.

Uploaded by

joni5160
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Question 2.

2 Fixed-Point Iteration
Problem 1
1: g1 (x) = (3 + x − 2x2 )1/4
Substitute g1 (x) = x:
x = (3 + x − 2x2 )1/4
Raise both sides to the fourth power:
x4 = 3 + x − 2x2
Rearrange:
x4 + 2x2 − x − 3 = 0
Thus, f (x) = 0 is satisfied.

 1/2
x+3−x4
2: g2 (x) = 2

Substitute g2 (x) = x:
1/2
x + 3 − x4

x=
2
Square both sides:
x + 3 − x4
x2 =
2
Multiply through by 2:
2x2 = x + 3 − x4
Rearrange:
x4 + 2x2 − x − 3 = 0
Thus, f (x) = 0 is satisfied.

x+3 1/2

3: g3 (x) = x2 +2
Substitute g3 (x) = x:
 1/2
x+3
x=
x2 + 2
Square both sides:
x+3
x2 =
x2 + 2
Multiply through by x2 + 2:
x4 + 2x2 = x + 3
Rearrange:
x4 + 2x2 − x − 3 = 0
Thus, f (x) = 0 is satisfied.

1
3x4 +2x2 +x−3
4: g4 (x) = 4x3 +4x−1
Substitute g4 (x) = x:
3x4 + 2x2 + x − 3
x=
4x3 + 4x − 1
Multiply through by 4x3 + 4x − 1:

x(4x3 + 4x − 1) = 3x4 + 2x2 + x − 3

Expand and simplify:

4x4 + 4x2 − x = 3x4 + 2x2 + x − 3

Combine like terms:


x4 + 2x2 − x − 3 = 0
Thus, f (x) = 0 is satisfied.

2
Problem 2:
1: Four Iterations
We are given p0 = 1 and pn+1 = g(pn ), for n = 0, 1, 2, 3. Perform four iterations
for each function g:

g1 (x) = (3 + x − 2x2 )1/4


p0 = 1
p1 = g1 (p0 ) = (3 + 1 − 2(1)2 )1/4 = (2)1/4 ≈ 1.1892
p2 = g1 (p1 ) = (3 + 1.1892 − 2(1.1892)2 )1/4 ≈ 1.1469
p3 = g1 (p2 ) ≈ 1.1556
p4 = g1 (p3 ) ≈ 1.1536

 1/2
x+3−x4
g2 (x) = 2

p0 = 1
1/2
1 + 3 − 14

1/2
p1 = g2 (p0 ) = = (1.5) ≈ 1.2247
2
p2 = g2 (p1 ) ≈ 1.1194
p3 = g2 (p2 ) ≈ 1.1610
p4 = g2 (p3 ) ≈ 1.1455

 1/2
x+3
g3 (x) = x2 +2

p0 = 1
 1/2  1/2
1+3 4
p1 = g3 (p0 ) = 2
= ≈ 1.1547
1 +2 3
p2 = g3 (p1 ) ≈ 1.1534
p3 = g3 (p2 ) ≈ 1.1536
p4 = g3 (p3 ) ≈ 1.1536

3x4 +2x2 +x−3


g4 (x) = 4x3 +4x−1

p0 = 1
4 2
3(1) + 2(1) + 1 − 3 3+2+1−3 3
p1 = g4 (p0 ) = = = ≈ 0.4286
4(1)3 + 4(1) − 1 4+4−1 7
p2 = g4 (p1 ) ≈ 1.0897
p3 = g4 (p2 ) ≈ 1.1574
p4 = g4 (p3 ) ≈ 1.1502

3
2: Best Approximation
The function g3 (x) converges most rapidly and provides the best approximation
to the solution, as it stabilizes at approximately 1.1536.

4
Problem 7: Fixed-Point Iteration Method
We are solving x4 − 3x2 − 3 = 0 on the interval [1, 2] using fixed-point iteration,
starting with p0 = 1. The tolerance is 10−2 .

Rearrangement for Fixed-Point Iteration

Rearrange the equation to isolate x:


p4
x = 3x2 + 3

This will serve as our iteration function:


p
4
g(x) = 3x2 + 3

Performing Iterations

Starting with p0 = 1, we compute pn+1 = g(pn ) until |pn+1 − pn | < 10−2 .

p0 = 1
p
4

4
p1 = g(p0 ) = 3(1)2 + 3 = 6 ≈ 1.5651
p √
4
p2 = g(p1 ) = 4 3(1.5651)2 + 3 ≈ 10.3466 ≈ 1.8171
p √
4
p3 = g(p2 ) = 4 3(1.8171)2 + 3 ≈ 13.8972 ≈ 1.9188
p √
4
p4 = g(p3 ) = 4 3(1.9188)2 + 3 ≈ 15.0544 ≈ 1.9512
Check Convergence

The difference |p4 −p3 | ≈ |1.9512−1.9188| = 0.0324, which is less than 10−2 .

Solution
The solution is approximately:

x ≈ 1.951

5
Problem 8: Fixed-Point Iteration Method
We are solving x3 − x − 1 = 0 on the interval [1, 2] using fixed-point iteration,
starting with p0 = 1. The tolerance is 10−2 .

Rearrangement for Fixed-Point Iteration

Rearrange the equation to isolate x:



x= 3x+1

This will serve as our iteration function:



g(x) = 3 x + 1

Perform Iterations

Starting with p0 = 1, we compute pn+1 = g(pn ) until |pn+1 − pn | < 10−2 .

p0 = 1
√ √
3
p1 = g(p0 ) = 3 1 + 1 = 2 ≈ 1.2599
√ √
3
p2 = g(p1 ) = 3 1.2599 + 1 = 2.2599 ≈ 1.2970
√ √
3
p3 = g(p2 ) = 3 1.2970 + 1 = 2.2970 ≈ 1.3048
√ √
3
p4 = g(p3 ) = 3 1.3048 + 1 = 2.3048 ≈ 1.3075

Check Convergence

The difference |p4 −p3 | ≈ |1.3075−1.3048| = 0.0027, which is less than 10−2 .

Solution

The solution is approximately:

x ≈ 1.308

6
Problem 10
We are analyzing g(x) = 2−x on [1/3, 1].

UNIQUENESS OF FIXED POINT

Using Theorem 2.3, we confirm g(x) has a unique fixed point:

g ′ (x) = −2−x ln(2)


On [1/3, 1], |g ′ (x)| < 1, since:

g ′ (x) is negative and bounded by − ln(2) ≈ −0.693.


Thus, g(x) satisfies the contraction mapping condition, ensuring a unique
fixed point.

Iterations

Start with p0 = 0.5. Iterate using pn+1 = g(pn ) = 2−pn until |pn+1 − pn | <
10−4 .

p0 = 0.5
p1 = g(p0 ) = 2−0.5 ≈ 0.7071
p2 = g(p1 ) = 2−0.7071 ≈ 0.6152
p3 = g(p2 ) = 2−0.6152 ≈ 0.6518
p4 = g(p3 ) = 2−0.6518 ≈ 0.6374
p5 = g(p4 ) = 2−0.6374 ≈ 0.6434
The difference |p5 − p4 | ≈ 0.006, achieving the desired tolerance.

Estimate of Iterations

Using Corollary 2.5:


log(tolerance)
N≥ .
log(|g ′ (x)|)
Given g ′ (x) ≈ −0.693, theoretical iterations match closely with actual iter-
ations.
Conclusion
The fixed point is approximately:

x ≈ 0.643

7
Solutions to Question 2.3
Problem 5
Use Newton’s method to find solutions accurate to within 10−4 for the following
problems.

1. x3 − 2x2 − 5 = 0, [1, 4]
• Define f (x) = x3 − 2x2 − 5 and f ′ (x) = 3x2 − 4x.
• Initial guess: x0 = 3.
f (xn )
• Iterative formula: xn+1 = xn − f ′ (xn ) .
• Steps:

f (3) = 33 −2(32 )−5 = 27−18−5 = 4, f ′ (3) = 3(32 )−4(3) = 27−12 = 15,


4
x1 = 3 − = 2.7333.
15
Next:

f (2.7333) = (2.7333)3 −2(2.7333)2 −5 = 20.4611−14.9302−5 = 0.5309,

f ′ (2.7333) = 3(2.7333)2 − 4(2.7333) = 22.3969 − 10.9332 = 11.4637,


0.5309
x2 = 2.7333 − = 2.6870.
11.4637
Repeating:

f (2.6870) = (2.6870)3 −2(2.6870)2 −5 = 0.0034, f ′ (2.6870) = 11.0711,


0.0034
x3 = 2.6870 − = 2.6867.
11.0711
Solution: x ≈ 2.6867.
2. x3 + 3x2 − 1 = 0, [−3, −2]
• Define f (x) = x3 + 3x2 − 1 and f ′ (x) = 3x2 + 6x.
• Initial guess: x0 = −2.5.
f (xn )
• Iterative formula: xn+1 = xn − f ′ (xn ) .
• Steps:

f (−2.5) = (−2.5)3 + 3(−2.5)2 − 1 = −15.625 + 18.75 − 1 = 2.125,

f ′ (−2.5) = 3(−2.5)2 + 6(−2.5) = 18.75 − 15 = 3.75,


2.125
x1 = −2.5 − = −2.0667.
3.75

8
Next:

f (−2.0667) = (−2.0667)3 +3(−2.0667)2 −1 = −8.7954+12.8098−1 = 0.0144,

f ′ (−2.0667) = 3(−2.0667)2 +6(−2.0667) = 12.8098−12.4002 = 0.4096,


0.0144
x2 = −2.0667 − = −2.0311.
0.4096
Solution: x ≈ −2.0311.
3. x − cos x = 0, [0, π/2]
• Define f (x) = x − cos x and f ′ (x) = 1 + sin x.
• Initial guess: x0 = 0.5.
f (xn )
• Iterative formula: xn+1 = xn − f ′ (xn ) .
• Steps:

f (0.5) = 0.5−cos(0.5) = 0.5−0.8776 = −0.3776, f ′ (0.5) = 1+sin(0.5) = 1+0.4794 = 1.4794,


−0.3776
x1 = 0.5 − = 0.7552.
1.4794
Next:

f (0.7552) = 0.7552−cos(0.7552) = 0.7552−0.7273 = 0.0279, f ′ (0.7552) = 1+sin(0.7552) = 1+0


0.0279
x2 = 0.7552 − = 0.7388.
1.6856
Solution: x ≈ 0.7388.
4. x − 0.8 − 0.2 sin x = 0, [0, π/2]
• Define f (x) = x − 0.8 − 0.2 sin x and f ′ (x) = 1 − 0.2 cos x.
• Initial guess: x0 = 0.8.
f (xn )
• Iterative formula: xn+1 = xn − f ′ (xn ) .
• Steps:

f (0.8) = 0.8−0.8−0.2 sin(0.8) = −0.2·0.7174 = −0.1435, f ′ (0.8) = 1−0.2 cos(0.8) = 1−0.2·0.69


−0.1435
x1 = 0.8 − = 0.9667.
0.8607
Next:

f (0.9667) = 0.9667−0.8−0.2 sin(0.9667) = 0.1667−0.1654 = 0.0013, f ′ (0.9667) = 0.8403,


0.0013
x2 = 0.9667 − = 0.9652.
0.8403
Solution: x ≈ 0.9652.

9
Problem 7
Repeat Exercise 5 using the Secant Method to find solutions accurate to
within 10−4 for the following problems.

(a) x3 − 2x2 − 5 = 0, [1, 4]


• Define f (x) = x3 − 2x2 − 5.
• Initial guesses: x0 = 3, x1 = 3.5.
• Iterative formula:
xn − xn−1
xn+1 = xn − f (xn ) · .
f (xn ) − f (xn−1 )
• Steps:

f (3) = 33 − 2(32 ) − 5 = 4, f (3.5) = 3.53 − 2(3.52 ) − 5 = 10.375,

10.375 · (3.5 − 3)
x2 = 3.5 − = 2.8.
10.375 − 4
Next:

f (2.8) = 2.83 − 2(2.82 ) − 5 = −1.072, f (3.5) = 10.375,

−1.072 · (2.8 − 3.5)


x3 = 2.8 − = 2.893.
−1.072 − 10.375
Continuing:

f (2.893) = −0.098, f (2.8) = −1.072,

−0.098 · (2.893 − 2.8)


x4 = 2.893 − = 2.877.
−0.098 + 1.072
Solution: x ≈ 2.877.
(b) x + 3x2 − 1 = 0, [−3, −2]
3

• Define f (x) = x3 + 3x2 − 1.


• Initial guesses: x0 = −3, x1 = −2.5.
• Steps:

f (−3) = (−3)3 +3(−3)2 −1 = 26, f (−2.5) = (−2.5)3 +3(−2.5)2 −1 = 13.125,

13.125 · (−2.5 − (−3))


x2 = −2.5 − = −2.0833.
13.125 − 26
Next:

f (−2.0833) = (−2.0833)3 +3(−2.0833)2 −1 = 2.507, f (−2.5) = 13.125,

2.507 · (−2.0833 − (−2.5))


x3 = −2.0833 − = −2.0074.
2.507 − 13.125

10
Continuing:

f (−2.0074) = −0.222, f (−2.0833) = 2.507,

−0.222 · (−2.0074 − (−2.0833))


x4 = −2.0074 − = −2.0006.
−0.222 − 2.507
Solution: x ≈ −2.0006.
(c) x − cos x = 0, [0, π/2]
• Define f (x) = x − cos x.
• Initial guesses: x0 = 0, x1 = 0.5.
• Steps:

f (0) = 0 − cos(0) = −1, f (0.5) = 0.5 − cos(0.5) = −0.3776,

−0.3776 · (0.5 − 0)
x2 = 0.5 − = 0.7181.
−0.3776 − (−1)
Next:

f (0.7181) = 0.7181 − cos(0.7181) = 0.0186, f (0.5) = −0.3776,

0.0186 · (0.7181 − 0.5)


x3 = 0.7181 − = 0.7390.
0.0186 − (−0.3776)
Solution: x ≈ 0.7390.
(d) x − 0.8 − 0.2 sin x = 0, [0, π/2]
• Define f (x) = x − 0.8 − 0.2 sin x.
• Initial guesses: x0 = 0.8, x1 = 0.9.
• Steps:

f (0.8) = 0.8−0.8−0.2 sin(0.8) = −0.1435, f (0.9) = 0.9−0.8−0.2 sin(0.9) = −0.0265,

−0.0265 · (0.9 − 0.8)


x2 = 0.9 − = 0.9182.
−0.0265 − (−0.1435)
Next:

f (0.9182) = 0.9182−0.8−0.2 sin(0.9182) = 0.0012, f (0.9) = −0.0265,

0.0012 · (0.9182 − 0.9)


x3 = 0.9182 − = 0.9168.
0.0012 − (−0.0265)
Solution: x ≈ 0.9168.

11
Question 2.4
0.1 Problem 11:
Error Analysis

The length of the interval [an , bn ] at the n-th step is:

|b0 − a0 |
|bn − an | = ,
2n
where [a0 , b0 ] is the initial interval and n is the iteration number.
The midpoint cn satisfies:

|b0 − a0 |
|cn − c| ≤ ,
2n+1
where c is the exact root of the equation f (x) = 0, and the error
bound is halved at each step.
Convergence Analysis

The sequence of errors en = |cn − c| satisfies:

|b0 − a0 |
en ≤ .
2n+1
This implies:
1
en+1 = en .
2
Therefore, the sequence of errors decreases by a fixed factor q = 21 at
each step, where q ∈ (0, 1).
This shows that the Bisection Algorithm converges linearly, with a
rate of convergence q = 12 .
Conclusion

The Bisection Algorithm 2.1 generates a sequence with an error


bound that converges linearly to 0. The rate of linear convergence
is determined by the factor q = 21 , which reflects the halving of the
interval at each iteration.

12
Question 2.5
0.2 Problem 2
Consider the function

f (x) = e6x + 3(ln 2)2 e2x − (ln 8)e4x − (ln 2)3 .

Newton’s method for approximating the root of f (x) is given by:

f (pn )
pn+1 = pn − ,
f ′ (pn )

where f ′ (x) is the derivative of f (x).

Deriving of f (x)

The given function is:

f (x) = e6x + 3(ln 2)2 e2x − (ln 8)e4x − (ln 2)3 .

The derivative f ′ (x) is:

f ′ (x) = 6e6x + 6(ln 2)2 e2x − 4(ln 8)e4x .

Iterative Calculation

i. Start with p0 = 0.
ii. Compute pn+1 using the Newton’s method formula:

f (pn )
pn+1 = pn − .
f ′ (pn )

iii. Stop when |pn+1 − pn | < 0.0002.


The following sequence of approximations is generated:

Iteration (n) pn |pn+1 − pn |


0 0.000000 −
1 0.084399 0.084399
2 0.033115 0.051284
3 0.024987 0.008128
4 0.024720 0.000267

The iteration stops at n = 4 because |pn+1 − pn | < 0.0002.

13
Convergence Improvement

Newton’s method exhibits quadratic convergence when the function


f (x) satisfies certain smoothness conditions near the root. In this
problem, the convergence is significantly faster than linear, as seen
from the rapid reduction in the error.

Conclusion.

The sequence of approximations {pn } converges to the root with the


stopping criterion |pn+1 − pn | < 0.0002. The use of Newton’s method
results in accelerated convergence, as evident from the rapid decrease
in error at each step.

14

You might also like