Use The Bisection Method To Find Solutions Accurate To Within 10 A. (0, 1) B. (1, 3.2) C. (3.2, 4) Solution
Use The Bisection Method To Find Solutions Accurate To Within 10 A. (0, 1) B. (1, 3.2) C. (3.2, 4) Solution
1. Use the Bisection method to find solutions accurate to within 10-2 for x3 – 7x2 + 14x – 6 = 0 on
each interval.
a. [0, 1] b. [1, 3.2] c. [3.2, 4]
Solution
>> bisec
f(x)=x^3-7*x^2+14*x-6
error tolerance =1e-5, new tolerance=1e-2
First guess=0
Second guess=1
number of iterations = 7
root = 0.585938
>> bisec
f(x)=x^3-7*x^2+14*x-6
error tolerance =1e-5, new tolerance=1e-2
First guess=1
Second guess=3.2
number of iterations = 8
root = 3.00234
>> bisec
f(x)=x^3-7*x^2+14*x-6
error tolerance =1e-5, new tolerance=1e-2
First guess=3.2
Second guess=4
number of iterations = 7
root = 3.41875
2. a. Sketch the graphs of y = x and y = 2 sin x.
b. Use the Bisection method to find an approximation accurate to within 10 -2 to the first
positive value of x with x = 2 sin x.
Solution
y=x
3
2
y
y=2sin(x)
0
-1
-2
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
x
>> bisec
f(x)=x-2*sin(x)
error tolerance =1e-5, new tolerance=1e-2
First guess=1.5
Second guess=2.5
number of iterations = 7
root = 1.89844
3. Find a bound for the number of iterations needed to achieve an approximation with accuracy
10-4 to the solution of x3 – x – 1 = 0 lying in the interval [1, 2]. Find an approximation to the
root with this degree of accuracy.
Solution
>> bisec
f(x)=x^3-x-1
error tolerance =1e-5, new tolerance=1e-4
First guess=1
Second guess=2
number of iterations = 14
root = 1.32477
4. Let f(x) = – x3 – cos x. With x0 = – 1 and x1 = 0 find x3.
a. Use the Secant method.
b. Use the method of False Position. Which of (a) or (b) is closer to the root?
Solution
>> secant
f(x)=-x^3-cos(x)
error tolerance =1e-5, new tolerance=
First guess=-1
Second guess=0
Secant method
i = 2, x = -0.685073, fx = -0.45285
i = 3, x = -1.25208, fx = 1.64952
i = 4, x = -0.807206, fx = -0.16556
i = 5, x = -0.847784, fx = -0.0523127
i = 6, x = -0.866528, fx = 0.00317471
i = 7, x = -0.865456, fx = -5.50761e-005
i = 8, x = -0.865474, fx = -5.63228e-008
i = 9, x = -0.865474, fx = 1.00087e-012
>> false
f(x)=-x^3-cos(x)
error tolerance =1e-5, new tolerance=
First guess=-1
Second guess=0
False Position
i = 2, x = -0.685073, fx = -0.45285
i = 3, x = -0.841355, fx = -0.070876
i = 4, x = -0.862547, fx = -0.00877963
i = 5, x = -0.865123, fx = -0.00105437
i = 6, x = -0.865432, fx = -0.000126147
i = 7, x = -0.865469, fx = -1.50857e-005
i = 8, x = -0.865473, fx = -1.80397e-006
has two real zeros, one in [-1, 0] and the other in [0, 1]. Attempt to approximate these zeros to
within 10-6 using method of False Position and Secant method.
Solution
>> false
f(x)=230*x^4+18*x^3+9*x^2-221*x-9
error tolerance =1e-5, new tolerance=1e-6
First guess=-1 Second guess=0
i = 17, x = -0.0406585, fx = -0.000174985
>> false
f(x)=230*x^4+18*x^3+9*x^2-221*x-9
error tolerance =1e-5, new tolerance=1e-6
First guess=0, Second guess=1
i = 9, x = 0.962398, fx = -2.29991e-005
>> secant
f(x)=230*x^4+18*x^3+9*x^2-221*x-9
error tolerance =1e-5, new tolerance=1e-6
First guess=-1, Second guess=0
i = 5, x = -0.0406593, fx = -7.47846e-012
>> secant
f(x)=230*x^4+18*x^3+9*x^2-221*x-9
error tolerance =1e-5, new tolerance=1e-6
First guess=0, Second guess=1
i = 12, x = -0.0406593, fx = -4.15135e-011
Converge to the wrong root
6. Use Newton's method to find solution accurate to within 10-4 for the following problems.
a. x3 – 2x2 – 5 = 0, [1, 4] b. x3 + 3x2 – 1 = 0, [– 3, – 2]
c. x – cos x = 0, [0, /2] d. x – 0.8 – 0.2sin x = 0, [0, /2]
Solution
a.
f(x)=x^3-2*x*x-5
error tolerance =1e-5, new tolerance=1e-4
First guess=2
i = 1, x = 3.25, fx = 8.20313
i = 2, x = 2.81104, fx = 1.40875
i = 3, x = 2.69799, fx = 0.0807684
i = 4, x = 2.69068, fx = 0.000325456
i = 5, x = 2.69065, fx = 5.35762e-009
b.
(x)=x^3+3*x*x-1
error tolerance =1e-5, new tolerance=1e-4
First guess=-3
i = 1, x = -2.88889, fx = -0.0727023
i = 2, x = -2.87945, fx = -0.00050385
i = 3, x = -2.87939, fx = -2.48007e-008
c.
f(x)=x-cos(x)
error tolerance =1e-5, new tolerance=1e-4
First guess=0
i = 1, x = 1, fx = 0.459698
i = 2, x = 0.750364, fx = 0.0189231
i = 3, x = 0.739113, fx = 4.64559e-005
d.
>> anewton
f(x)=x-0.8-0.2*sin(x)
error tolerance =1e-5, new tolerance=1e-4
First guess=0
i = 1, x = 1, fx = 0.0317058
i = 2, x = 0.964453, fx = 0.000105507
i = 3, x = 0.964334, fx = 1.16518e-009
7. Problems involving the amount of money required to pay off a mortgage over a fixed period
of time involve the formula
P
A= [1 – (1 + i)-n],
i
Known as an ordinary annuity equation. In this equation A is the amount of the mortgage, P is
the amount of each payment, and i is the interest rate per period for the n payment periods.
Suppose that a 30-year home mortgage in the amount of $135,000 is needed and that the
borrower can afford house payments of at most $1000 per month. What is the maximal interest
rate the borrower can afford to pay?
Ans: 8.1 %
8. A drug administered to a patient produces a concentration in the blood stream given by c(t) =
Ate-t/3 milligrams per milliliters (mg/ml), t hours after A units have been injected. The maximum
safe concentration is 1 mg/ml.
a. What amount should be injected to reach this maximum safe concentration and when does
this maximum occur?
b. An additional amount of this drug is to be administered to the patient after the
concentration falls to 0.25 mg/ml. Determine, to the nearest minute, when this second injection
should be given.
c. Assuming that the concentration from consecutive injections is additive and that 75% of
the amount originally injected is administered in the second injection, when is it time for the
third injection?
e
Ans: a) 3 hr, A = , b) 11.078 hr, c) 21.23 hr
3