# Graham-Schmidt Polynomial Projection

1. Feb 2, 2010

### Shackleford

This is from my Vector Analysis course today. We've been doing a bit of abstract stuff since class began, but the professor said we're going to get to concrete stuff pretty quickly.

I think the notation is throwing me off a bit. I'm not sure why the alphas change for each successive polynomial P. The only way it makes sense is for the alpha-m equation to have the Psub-m match the individual alpha, but the x-m exponent match the m-value for the polynomial P you're considering. I hope that makes sense.

Like for P2, for the two alphas 0 and 1, x^2 appears in both equations, but the P-sub value depends on the alpha.

We worked P2 alpha 0 in class. I worked P2 alpha 1 by myself. P3 is for homework. Thanks.

1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

2. Feb 2, 2010

### vela

Staff Emeritus
I think you copied something down wrong. You should have had

$$\alpha_r = \frac{(x^{m+1},P_r(x))}{(P_r(x),P_r(x))}$$

so that

$$P_{m+1}(x) = x^{m+1}-\sum_{r=1}^{m} \alpha_r P_r(x)$$

Because the alphas depend on xm+1, they'll change when m changes.

3. Feb 2, 2010

### Shackleford

It seems I was right. The notation is a bit more clear now. Thank you.

So I did the cumbersome integration of polynomials:

P0 = 1
P1 = x
P2 = x^2 +(3/4)x - (1/3)
P3 = x^3 - (1/4) - (3/5)x - (24/92)[x^2 + (3/4)x - (1/3)]

4. Feb 2, 2010

### vela

Staff Emeritus
Actually, you should have gotten the Legendre polynomials.

5. Feb 2, 2010

### Shackleford

Oh, I made a few arithmetical errors...

Last edited: Feb 2, 2010
6. Feb 3, 2010

### Shackleford

Last edited: Feb 3, 2010
7. Feb 3, 2010

### vela

Staff Emeritus
You've got it. Those are essentially the Legendre polynomials. They're just different by a constant factor, which doesn't affect their orthogonality. If you multiply your P2 by 3/2, for instance, you'd get the P2(x)=(1/2)(3x^2-1) on the MathWorld page.

8. Feb 3, 2010

### Shackleford

Okay. Yeah, I noticed I was getting a multiple of the Legendre polynomials listed. I'm now working on P0, P1, and P2 for the integral from 0 to 1 of p(x)q(x). I'll probably post those later for confirmation. None of our homework is for a grade. However, what's assigned as homework is going to look uncannily like the exam. Heh. So, I just want to make sure I'm understanding the procedure. Actually, I see that the last bit of homework has the polynomials listed on the MathWorld page.

I believe I understand the concept. According to my notes and what I remember in class, we have an orthogonal set of non-zero vectors (R3), and this procedure yields a projection of a vector, say y, (x^(m+1)), onto the span of the orthogonal set of vectors. The vector y - the projection yields a vector orthogonal to the span of the orthogonal set of vectors (plane).

9. Feb 3, 2010

### vela

Staff Emeritus
One way to check your answers is to calculate (Pm,Pn) and verify it comes out to zero whenever m and n are different.

That's right. You're subtracting off the components of y in the direction of the other vectors, so what you're left with is orthogonal to them.

10. Feb 3, 2010

### Shackleford

So, since the projection is onto, or in, the orthogonal set/plane of vectors, it is of course orthogonal to the rest of the vectors in the set since it is a linear combination.

For some reason the second part is a bit fuzzy. How is subtracting the projection subtracting off components of y that are in the direction of the other two orthogonal vectors?

11. Feb 4, 2010

### vela

Staff Emeritus
The Pn(x)'s form a basis, so you can write xm as a linear combination of them:

$$x^m = \sum_{r=0}^m \alpha_r P_r(x)$$

where the $\alpha_r$'s are the same ones you calculated. Because the polynomials form an orthogonal basis, the component of xm in the direction of Pr is just $\alpha_r P_r(x)$. If you subtract $\alpha_r P_r(x)$ from xm, you're removing the piece of xm that points in the direction of Pr. If you subtract everything except the Pm component, you just left with the piece that points in the direction of Pm.

$$\alpha_m P_m(x) = x^m - \sum_{r=0}^{m-1} \alpha_r P_r(x)$$

which is what you have been calculating. It's like having a vector in R3. If you subtract off the x and y components, you're left with just the z component.

12. Feb 5, 2010

### Shackleford

Thanks. It's much easier to understand graphically. However, the professor has been adamant about us NOT thinking about these abstract ideas graphically. He says, "Okay, graph me an inner product in R4 or R5." Or something like that.

I have another question concerning the index of summation. Rather than say R=1 to m, shouldn't it be R=0 to me? Because our first term is P0.

If I remember correctly, we also discovered in class yesterday that the projection gives us the minimum distance from a vector to a point in the plane (subspace). I think I remember this from Cal 3.