Hw2ans PDF
Hw2ans PDF
Homework 2
Answers
Answer: The first three problems can be answered much more easily if we know that
sin x ≤ x for 0 ≤ x < 1. (Much more than this is true, but this inequality
suffices.)
1 As a
1 1 1 1 1
result, we have | sin n | < n , and so sin n = O( n ). Similarly, | sin n2 | < n2 , and so
1
sin n2 = O( n2 ). We also can take the inequality | sin n | < n1 and square both sides,
1 1
2
giving | sin n1 |2 < n12 , and therefore sin n1 = O( n12 ).
The last one is a bit more interesting. We rewrite log(n+1)−log(n) as log 1 + n1 , and
now use the fact that | log(1 + x)| < |x| for 0 < x < 1. Therefore, | log(n + 1) − log(n)| < n1 ,
and so log(n + 1) − log(n) = O( n1 ).
5. Suppose that 0 < q < p and F (h) = L + O(hp ). Show that F (h) = L + O(hq ).
Answer: The definition says that for sufficiently small positive real numbers h and some
positive constant K, |F (h) − L| < K|hp |. Again, because q < p and |h| < 1, |hp | < |hq |.
This means that |F (h) − L| < K|hq |, which in turn means that F (h) = L + O(hq ).
6. Use the bisection method to find a solution accurate to within 0.01 for the equation
x4 − 2x3 − 4x2 + 4x + 4 = 0 on the interval [−1, 4].
Answer: Here is a chart of the results, with a the left-hand endpoint of the bounding
interval, b the right-hand endpoint of the bounding interval, and m the midpoint of the
bounding interval at each stage:
n a b m f (m)
1 −1 4 1.5000 −0.6875
2 1.5000 4 2.7500 0.3477
3 1.5000 2.7500 2.1250 −4.3630
4 2.1250 2.7500 2.4375 −3.6797
5 2.4375 2.7500 2.5938 −2.1745
6 2.5938 2.7500 2.6719 −1.0526
7 2.6719 2.7500 2.7109 −0.3888
8 2.7109 2.7500 2.7305 −0.0299
9 2.7305 2.7500 2.7402 0.1565
10 2.7305 2.7402 2.7354 0.0627
This tells us that a root is between 2.7305 and 2.7354.
7. Let f (x) = x4 + 2x2 − x − 3. Use algebraic manipulations to show that each of the
following functions has a fixed point at p if and only if f (p) = 0:
1/2
x + 3 − x4
2 1/4
a. g1 (x) = (3 + x − 2x ) b. g2 (x) =
2
1/2
3x + 2x2 + 3
4
x+3
c. g3 (x) = d. g 4 (x) =
x2 + 2 4x3 + 4x − 1
Answer: (a) Start with x4 + 2x2 − x − 3 = 0, and move the last three terms to the right-
hand side of the equation, yielding x4 = −2x2 + x + 3. Take fourth roots, and we have
x = (3 + x − 2x2 )1/4 . So a fixed point of g1 (x) = (3 + x − 2x2 )1/4 will be a root of the
original equation. The algebra here is reversible, yielding the “if and only if” conclusion.
(b) Start with x4 + 2x2 − x − 3 = 0, and now move all but the quadratic term to the
right-hand side of the equation, yielding 2x2 = −x4 + x + 3. Divide by 2 and take square
roots to get x = ((3 + x − x4 )/2)1/2 . Again, we can see that this process is reversible.
(c) Start with x4 + 2x2 − x − 3 = 0, and move the last two terms to the right-hand
side, yielding x4 + 2x2 = x + 3. Factor the left-hand side into x2 (x2 + 2), divide by x2 + 2,
and take square roots, and we get x = ((x + 3)/(x2 + 2))1/2 .
(d ) This is Newton’s method in disguise. Start with x4 + 2x2 − x − 3 = 0, and divide
both sides by −(4x3 + 4x − 1), yielding −(x4 + 2x2 − x − 3)/(4x3 + 4x − 1) = 0. Now add
x to both sides, yielding x − (x4 + 2x2 − x − 3)/(4x3 + 4x − 1) = x. Simplify the left-hand
side, and we get (3x4 + 2x2 + 3)/(4x3 + 4x − 1) = x. Again, the process is reversible.
8. Use the functions gk (x) in the previous problem and perform four iterations (if possible,
without dividing by 0 or taking the square root of a negative number), starting with p0 = 1
and gk (pn ) = pn+1 . Which of the four functions seems to give the best approximation to
a solution of the equation f (x) = 0?
Answer: I computed the following:
Clearly, g4 (x) is converging to the fixed point quicker than any of the other three
functions.