W3 Tute3
W3 Tute3
1. Use algebraic manipulation to show that each of the following functions has a fixed point at p precisely when
f ( p)=0 , where f ( x )=x 4 + 2 x 2−x−3 .
1
a. g ( x ) =( 3+ x−2 x 2) 4
1
( )
1
x+ 3−x 4 2
b. g2 ( x ) =
2
Solution:
1
a. If a fixed point for g ( x)=( 3+ x−2 x 2 ) 4 exists then we should have g1 ( x ) =x for some x .
1
So, consider:
1
x=( 3+ x −2 x ) ⇔ x =3+ x−2 x ⇔ ⏟
2 4 4 2 4 2
x +2 x − x−3=0
¿f (x)
∴ g 1 ( p )= p
1
i.e. p is a fixed point of g ( x ) =( 3+ x−2 x 2) 4 .
1
( )
1
x+ 3−x 4 2
b. If a fixed point for g2 ( x ) = . exists then we should have g2 ( x ) =x for some x .
2
So, consider:
( )
4 1 4
x +3−x x +3−x
⇔ 2 x =x +3−x ⇔ ⏟
2 2 2 4 4 2
x= ⇔x = x +2 x −x−3 =0
2 2
¿f (x)
∴ g 2 ( p )= p
( )
4 1
x+ 3−x 2
i.e. p is a fixed point of g2 ( x ) = .
2
2. Perform four iterations, if possible, on each of the functions g1and g2defined in question 1. Let p0=1 and
pn +i=g( p n) for i=0,1,2,3 . Which function do you think gives the best approximation to the solution? Why?
Solution:
Using fixed-point method with p0=1 and pn+ 1=g( pn ) for n=0,1,2,3
n For g1 For g2
pn ¿ pn− p n−1 ∨¿ Pn ¿ pn− p n−1 ∨¿
0 1 1
1 1.18920712 0.18920712 1.22474487 0.22474487
2 1.08005775 0.10914937 0.99366616 0.23107871
3 1.14967143 0.06961368 1.22856865 0.23490249
4 1.10782053 0.0418509 0.98750643 0.24106222
g1 (x) gives the better approximation method – The relative error and the difference between each of the
approximations keeps on steadily decreasing.
As for g2 ( x ), we can see such convergence does not occur. In fact, if you compute more pn values, you will see
that the approximations just oscillate on either sides of 1 and does not converge.
3. Use a fixed-point iteration method to find an approximation to √ 3 that is accurate to within 10−4.
Solution:
We can consstruct the function g( x ) such that g ( x )=x ⟹ x=√ 3 in many different ways:
3 3
x=√ 3 ⟹ x =3 ⟹ x= ⟹ g1 ( x )=
2
x x
3
x x3
x=√ 3 ⟹ x =3 ⟹ x =3 x ⟹ =x ⟹ g2 ( x )=
2 3
3 3
3 3 3 3 1 3
x=√ 3 ⟹ x 2=3 ⟹ x= ⟹ x− =0 ⟹2 x− =x ⟹ 2 x=x + ⟹ x= x+ =g 3 ( x )
x x x x 2 x ( )
If you try fixed point method to find √ 3 using g1and g2, you will find that g1 will not converge and that g2 will
converge to 0.
f (x) 2
x −3 1 3
Note that g3 is the newton’s method for f ( x )=x 2−3=0 g ( x )=x− =x− = (x + ). So we can
'
f (x ) 2x 2 x
reasonably expect this function to give us convergence to the fixed point.
Initial guess: 1
Iteration 1: Root approximation = 2.00000000
Iteration 2: Root approximation = 1.75000000
Iteration 3: Root approximation = 1.73214286
Fixed-point iteration method converged to a root after 3 iterations.
Approximate root: 1.7321
3
What if you consider another newton’s function f ( x )=x− =0 g ( x )=x−
f (x)
=x−
( x− )
3
x
=
9x
x '
f (x ) 6 2
x +6
1+ 2
x
Initial guess: 1
Iteration 1: Root approximation = 1.28571429,
Iteration 2: Root approximation = 1.51200000
Iteration 3: Root approximation = 1.64225966
Iteration 4: Root approximation = 1.69947205,
…
Iteration 13: Root approximation = 1.73204907
Iteration 14: Root approximation = 1.73205023
Fixed-point iteration method converged to a root after 14 iterations.
Approximate root: 1.7321
4. For each of the following equations, use the given interval or determine an interval [a , b] on which fixed-point
iteration will converge. Estimate the number of iterations necessary to obtain approximations accurate to within
10−5 and perform the calculations.
a. 2+sin x — x=0 use [2,3] b
b. 3 x 2−e x =0
Solution:
a. From Fixed-Point Theorem:
g ( x )=2+sin x g' ( x )=cos x
|g' ( x )|=|cos x|≤∨cos 3∨≈ 0.989992497 for all x ∈[2,3]
So our k =0.989992497 .
¿ pn− p∨≤ k max { p 0−a ,b− p0 } <10 From the colrollory and since accuracy is within 10−5 .
n −5
Consider p0=2.5. Then, we have max { p0 −a , b−p 0 }=max {2.5−2 ,3−2.5 } =0.5
k n∗0.5<10−5
n
k < 0.00002
n∗ln 0.989992497< ln 0.00002
ln0.00002
n> since ln 0.989992497 is a negative number
ln 0.989992497
n> 846.815017902
When we run this problem we find that Fixed-point iteration method converged to a root after 51 iterations and
we have the approxiation 2.55420058
| | || ||
x 1
1 x/ 2 1 1
|g ( x )|=
'
e ≤ e2 = e 2 ≈ 0.4759448347 … for all x ∈[0,1]
2 √3 2 √3 2 √3
So our k =0.4759448347 .
¿ pn− p∨≤ k max { p 0−a ,b− p0 } <10 From the colrollory and since accuracy is within 10−5 .
n −5
Consider p0=1 . Then, we have max { p0 −a , b−p 0 }=max {1−0 , 1−1 }=1
n −5
k ∗1<10
n
k < 0.00001
n∗ln 0.4759448347 .<ln 0.00001
ln0.00002
n> since ln 0.4759448347 is a negative number
ln 0.4759448347
n>15.50660
Fixed-point iteration method converged to a root after 11 iterations. Approximate root: 0.9100
5. A loan of A dollars is repaid by making n equal monthly payments of M dollars, starting a month after the loan is
made. It can be shown that if the monthly interest rate is r , then
1
Ar=M 1−
( 1+r )n
.
( )
A car loan of $ 10,000 was repaid in 60monthly payments of $ 250. Use the Newton Method to find the monthly
interest rate correct to 4 significant figures
Solution:
Ar=M 1−
( 1
)
( 1+r ) n
→10000∗r=250 1−
1
( 1+r )60 ( )
1
→ 40 r=1−
( 1+r )60
1
→ f ( r )=40 r−1+
( 1+r )60
60
→ f ' ( r)=40−
( 1+r )61
Newton’s method gives:
Now we need to make a good initial approximation r 0 . Let’s consider r=0.03 montly interest rate. Monthly interest
on $10,000 is $300. So we would never be able to pay off the loan using monthly payments of $250. So our interest
rate needs to be much lower.
Let’s consider r=0.01. Monthly interest on $10,000 will be $100. So it is possible to pay off the loan with this rate.
Let r 0 =0.01.
1
40 r 0 −1+ 60
( 1+r 0 )
r 1=r 0− =0.0167877
60
40− 61
( 1+r 0 )
1
40 r 1−1+ 60
( 1+r 1 )
r 2=r 1− =0.0146094
60
40− 61
( 1+ r 1 )
r 3 =0.014397
r 4=0.0143948
r 5 =0.0143948
1 1
6. a. Use the Fixed-Point Theorem to show that the sequence defined by x n= x n−1+ ;forn ≥ 1, converges to
2 x n−1
√ 2 whenever x 0 > √ 2.
2
b. Use the fact that 0< ( x 0−√ 2 ) whenever x o ≠ √ 2 to show that if 0< x 0 < √ 2 , then x 1> √ 2 .
c. Use the results of parts (a) and (b) to show that the sequence in (a) converges to √ 2 whenever x 0 >0.
Solution: Will provide later
7. a. Use the Newton method to find a root of x 3−2 √ x 3=1 to 4 decimal places starting with x 0=2.
b. Explain why x 0=1 would have been an unsuitable starting value.
Solution:
a. We need to solve for f ( x )=x 3−2 x 3/ 2−1=0
1 1
' 2 2∗3 2 2
f ( x )=3 x − ∗x =3 x −3 x 2
2
f ( xn)
Newton’s method: x n+1=x n − for n ≥ 0
f ' (x n)
x 0=2
x 1=1.82685
x 2=1.80024
x 3=1.7996
…
' '
b. Now consider x 0=1. f ( x 0 )=f (1 )=0
So the tangent line to the curve at x 0=1 will never meet the axis. i.e. we cannot find the next iteration in
Newton method.
So Newton Method will fail.
1 1 2 1 π
8. Use Newton's method to solve the equation 0= + x −x sin x− cos 2 x ,with p0= . Iterate using Newton’s
2 4 2 2
method until an accuracy of 10−5 is obtained. Explain why the results seem unusual for Newton’s method. Also solve
the equation with p0=5 π and p0=10 π using Octave, Matlab or a similar software.
Solution:
1 1 2 1 ' x
f ( x )= + x −x sin x− cos 2 x and f ( x )= −x cos( x)−¿sin(x)+ sin(2 x )
2 4 2 2
π
With p0= → p 15=1.895488
2
With p0=5 π → p19=1.895489
With p0=10 π → Sequence does not converge within 200 iterations.
The sequence does not give the fast convergence we are used to with Newton’s method.
1
9. The function f ( x )=tan πx −6 has a zero at arctan( 6)≈ 0.447431543 . Let p0=0 and P1=0.48 and use 10
π
iterations of each of the following methods to approximate this root. Which method is most successful, and why?
a. Bisection method
b. Newton’s Method
c. Secant Method
d. Method of False Position (You can try this method on your own or do this part next week after we
cover it in class!)
Solution:
a. p10=0.4476563
b. Use f ’ ( x ) =π sec 2 πx and find the Newton’s iterations
c. p10=−195.8959
d. p10=0.442067
10. It costs a firm C (q) dollars to produce q grams per day of a certain chemical, where
2
3
C (q)=1000+2 q +3 q
The firm can sell any amount of the chemical at $ 4 a gram. Find the break-even point of the firm, that is, how much
it should produce per day in order to have neither a profit nor a loss. Use the Newton Method and give the answer
to the nearest gram.
Solution:
Revenue = 4q
2
So breakeven point is when: 4 q=1000+2 q+3 q 3
2
Then, f ( q )=2 q−3 q 3 −1000=0
−1
We have f ' ( q )=2−q 3
N=1: q 1=607.6089386
N=2: q 2=607.6067886
…