Homework 4.1
Write a function that gives an (approximate) estimate of the absolute value of the n-th derivative of a polynomial function (of degree larger than n) with a given vector of coefficients 'c' and modify the function QNCError to take parameters: (a,b,m,c) instead of (a,b,m,M). Adapt the script ShowQNCError to test your work, i.e. to show that the actual error is indeed smaller than the estimate.
Extra credit: Generalize it to the case for any function (replacing the polynomial). Use parameter 'fname' instead of 'c' in QNCError. Use the Matlab function 'quad' with tolerance 1e-6 (meaning 10^(-6) ) instead of an exact solution in ShowQNCError.

Homework 4.2
Generalize CompQNC function for the specific case of the Simpson rule (m=3) by replacing the loop on p.147 in the textbook by a fully vectorized version as shown in class. Test it on function f(x)=sin(x)sin(10x) for x=[0, 2pi]. Incrase n, the number of panels in which this interval is didided (doubling them each time) until the actual error is less than 1e-6. Plot the error as a function of n.

Homework 4.3
Write a fully vectorized adaptive routine based on the Trapezoidal (m=2) or Simpson rule (m=3) as described in class. Test it on function f(x)=sin(x)sin(10x) for x=[0, 2pi]. Incrase n, the number of panels in which this interval is didided (doubling them each time) until the error estimate is less than 1e-6. Plot the error as a function of n. Compare the cpu time (for example, use tic-toc commands) in the homework 4.3 and 4.2.

Chapter 5: Matrix computations
Section 1, p.175: P5.1.2, P5.1.3.
Section 2, p.186: P5.2.1, P5.2.6.
Section 3, Choose any positive constants a, b, c, d and 3 values of K>0. Then plot the corresponding solution contours f(x,y) = y^{a}x^{c}e^{-(by+dx)} = K of Lotka-Volterra equations in the Predator-Prey model (all in one frame).

Chapter 6: Linear systems
Section 1, p.215: P6.1.7.
Section 3, p.232: P6.3.11.
Section 4

Chapter 7: Least squares
Section 1:
1. From the derivative equations on p.243 (that minimize the residuals) derive the 2 by 2 systems that follow.
2. From the table on p.245 derive the flops dependence (in both full and sparse cases) of the data length m.
Section 2: Repeat computations on p.253.
Section 3, p.267: P7.3.4.

Chapter 8: Nonlinear equations
Section 1, p.290: P8.1.13, P8.1.14.
Section 2, p.305: P8.2.9.
Section 3, p.312: P8.3.3 or P8.3.4.
Section 4: Solve f(z)=z^2+1=0 using real arithmetics. Set z=x+iy and rewrite it as a 2 by 2 system of nonlinear equations in x and y. Apply Newton's method with a starting point (x,y) = (1,1).

Chapter 9: Initial value problems
Section 1, p.338: P8.1.3.
Section 2: Solve the two-body problem described on p.343 using ode45. Write a neat report on the results of numerical experiments.