Numerical Methods, MAT 350
Autumn 2001


Homework: Legendre Polynomials

Due by class, Wednesday October 31

In class, we discussed the use of orthogonal polynomials in numerical integration. This is a short assignment intended to give you some practice using orthogonal polynomials. Let Pn(x) be the n-th order Legendre polynomial. Here is what you have to do:
  1. By hand, find P5(x) using the recursion formula, starting with P0(x) and P1(x). Check your result by comparing it to a reference book.
  2. By hand, evaluate P5(x) for x = 0, 0.25, 0.5, 0.75, and 1.
  3. By hand, use the inner product formula to verify that P5(x) and P3(x) are orthogonal.
  4. Write a subroutine that calculates Pn(x) using the recursion formula. There are two basic strategies that one can follow: One is that the routine calls itself recursively. The other is to use two variables to store P0(x), P1(x), et cetera and loopsthrough increasing values of n.
  5. Use your subroutine to graph both P9(x) and P10(x) versus x on the interval [-1,1]. Use lots of plot points to get nice smooth graphs.
  6. Does your graph illustrate the interleaving property? Explain.