MATH 465: Numerical Analysis
Boise State University, Spring 2005
Homework
Reminder: When emailing your computer code to me, please send it to
stephenbrill@yahoo.com
Chapter 1
1) Due 19 January.
Section 1.1, pp. 14-16, # 2b, 4a, 6, 12, 14, 26
-
Use appropriate technology whenever appropriate. If you do, turn in a hard copy of your computer work.
-
On 12b, it is acceptable to use a Maple picture to justify an important assertion.
-
On 14, compute the error and show it is consistent with the error bound you
computed.
-
On 26, assume x_1 and x_2 are not equal.
2) Due 25 January.
-
Section 1.2, pp. 14-16, # 2ab, 4a, 26.
On 26, assume there exists a positive number M such that
| f '(x) | < M for all x in the interval (a,b).
-
Write a Matlab function to implement the quadratic formula.
Your function should accept the coefficients a, b, and c
(in this order)
as input and output
the real roots x_1 and x_2. Your function should effectively handle
pathological cases (such as when the roots are not real).
-
Write a Matlab function to evaluate polynomials. Your function should
accept as inputs first, the number at which to evaluate; second,
the degree of the
polynomial; and third, the coefficients in order of
descending power of the variable. The output should be the value of
the polynomial at the evaluation number. Again, handle pathological cases.
3) Due 2 February.
-
Section 1.3, pp. 36-37, # 3, 4, 7
-
Hint for #3 and 4: Using the error term in Taylor's Theorem is too difficult.
What other tools are at your disposal?
You may need to review your calculus text.
-
Extra Credit: In exercise #4, the identity pi/4 = arctan(1/2) + arctan(1/3)
is given. Prove it!
Chapter 2
4) Due 8 February.
-
Write a Matlab function to implement the bisection method. The inputs
should be the endpoints a and b of the intital interval, an error tolerance
epsilon, and a maximum number M of iterations. The information for the
function f should be found in a Matlab function file called "f.m".
-
Section 2.1, pp. 51-52, # 14, 15, 19.
-
On # 19, use bisection. A Maple picture might be helpful. Clearly explain
your reasoning.
5) Due 14 February.
-
Write a Matlab function to implement fixed point iteration. The inputs
should be an intial guess p0, an error tolerance
epsilon, and a maximum number M of iterations. The information for the
function g should be found in a Matlab function file called "g.m".
-
Section 2.2, pp. 61-63, # 7, 8, 12c, 16, 20.
-
How to prove # 20 is not obvious at first (at least, it wasn't
obvious to me!).
Do some numerical experiments so you can see how to structure your proof.
6) Due 18 February.
-
Write a Matlab function to implement Newton's method to
solve f(x)=0. The inputs
should be an intial guess p0, an error tolerance
epsilon, and a maximum number M of iterations. The information for the
function f and its derivative f ' should be found in a single
Matlab function file
called "newtfun.m".
-
Section 2.3, pp. 71-75, # 16, 28, 34.
-
Also, determine theoretically how many interations of Newton's method
are required to guarantee that the
computed
solution of x=cos(x) is correct with a
maximum error of 10^(-4). Start with the fact that this solution is between
1/2 and 1. And how do you know that this fact is true?
7) Due 23 February.
-
Section 2.4, p. 82, # 2a, 4a, 6, 8a, 10.
-
Explain why the convergence you observe in Exercise 2a is slower than
that found in Exercise 4a.
-
Explain the significance of Exercise 6 (and
of Exercise 7a, even though you don't
have to prove the result in Exercise 7a).
-
Hint for Exercise 10: Observe that g(p) is indeterminate.
So how should you define g(p)?
-
Explain the significance of Exercise 10.
Chapter 3
8)
Due 2 March.
-
Section 3.1
-
You will probably want to email me your Maple worksheet(s).
9) Due 9 March.
-
Section 3.4, p. 155-157, # 20, 32, 33.
-
On # 32 and 33, you will need to write Matlab programs. In addition to
obtaining the coefficients a_j, b_j, c_j, and d_j, you need to use these
coefficients to draw in Matlab a picture of the back of the dog for both the
natural and clamped cubic splines. We
discussed how to draw Matlab pictures on
the day the class met in the computer lab.
10) Due 15 March.
-
Section 3.5.
-
Write a Matlab program to create a Bezier curve representation of the character
you were given. The file containing your program should be called "bezier.m".
When run, it should produce a
Matlab graphics window in which your curve will appear.
Chapter 4
11) Due 28 March.
-
Section 4.1, p. 176-178, # 2, 4, 22.
12) Due 30 March.
-
Section 4.2, p. 185, # 8.
13) Due 5 April.
-
Section 4.3, p. 195-196, # 16, 20.
14) Due 8 April.
-
Section 4.4, p. 204, # 12.
-
Write Matlab functions implementing the composite trapezoid method and
composite Simpson's method. As we did earlier, the function to be
integrated should be defined in a separate m-file called f.m. The inputs to
the numerical methods should be a, b, and n (in this order). Email your
trapezoid and Simpson functions to me. Now, here's the fun part:
Consider the function f(x) = ln(x). Consider the integral of f(x) on the
interval 1 to 100. Evaluate this integral exactly and for both numerical
methods using n=10, 20, 30, ..., 200. Now, for each numerical method,
construct a plot (using Matlab) of log(h) on the horizontal axis vs.
log(abs(error)) on the vertical axis. (These logarithms should all
be base 10.) Your plots should clearly indicate the data points and should
also connect them. What do you see? Explain why you see what you see.
If we change the base of all the base 10
logarithms to something else, would your
graphs change? If so, how? Explain.
15) Due 12 April.
-
Section 4.7, p. 226, # 6.
-
Derive the formula for P_3(x), the degree 3 Legendre polynomial.
Then show that the roots r_{3,i} and coefficients c_{3,i} are as they appear
in Table 4.11, p. 224. Finally, approximate, using Gaussian quadrature with
n=3, the integral of sin(x) on the interval 0 to Pi.
Chapter 8
16) Due 15 April.
-
Section 8.1, p. 491-494.
-
# 6.
For a, b, and c, write a single Matlab function for which the
inputs are the vector of x's; the vector of y's; and n, the degree of the
least squares polynomial which is to fit the data. Write separate Matlab
functions for d and e. Also, for each of a,b,c,d,e, draw (in Matlab) the
approximating curve and the data.
-
# 14.
17) Due 19 April.
-
Section 8.2, p. 502-503.
-
# 2d, 4d, 14.
-
Consider the set of orthogonal polynomials H_j(x)
with respect to the weighting
function w(x) = exp(-x^2) on the interval (-infinity, infinity).
Derive formulas for H_j(x) for j=0,1,2,3. Then, using these
polynomials and weighting function, find the weighted
least squares polynomial approximation to f(x) = 1/(1+x^2)
for degrees 1, 2, and 3. Plot f(x) and the polynomial approximations
on the same set of axes.
18) Due 26 April.
-
Section 8.3, p. 512.
-
# 2c, 4c, 6, 8.
-
Consider approximating f(x) = cos(2x) using a polynomial so that the
maximum error on the interval [-1,1] is at most
10^(-4). Determine a polynomial
of minimal degree that achieves this goal.
19) Due 3 May.
Reminder: When emailing your computer code to me, please send it to
stephenbrill@yahoo.com
MATH 465 main page
Stephen Brill's home page
This page was most recently updated on 26 April 2005.
http://math.boisestate.edu/~brill/teaching/m465_s05/hw.html