# Projections

• Apr 8th 2010, 12:26 PM
piglet
Projections
I am trying to find the projection of a function onto a space spanned by
{1, sinx, cosx} on the interval $[\pi, -\pi]$ This is equal to the first 3 terms of the fourier expansion of f(x)

The function is $f(x) = x^{2} + x$

I found the first term of the fourier expansion to be:
a0 = $\frac{\pi^{2}}{3}$

Im not to sure on calculating the 2nd term...

can i use a1 =
$\frac{1}{\pi}\int_{-\pi}^{\pi}f(x) cosxdx$?

or should i use
a1 = $\frac{1}{\pi}\int_{-\pi}^{\pi}f(x) sinxdx$? because sinx is the 2nd term of the span..

Im fine with the integration itself, its just the formula...

sorry if question is badly constructed, am still in early days of using laTex

• Apr 9th 2010, 06:51 AM
nimon
Hi,

It really doesn't matter because addition is commutative! You could order the terms however you wanted. Just normalise $1,\sin x, \cos x$ to get an orthonormal basis $\{e_{1},e_{2},e_{3}\}$ for $\text{span}\{1,\sin x, \cos x\}$. Then you can calculate the projection $P:C[-\pi,\pi] \rightarrow \text{span}\{1,\sin x, \cos x\}$ by

$Pf(x) = \sum_{i=1}^{3} \langle f,e_{i} \rangle e_{i}$,

where $\langle f,g \rangle = \int^{\pi}_{-\pi}f(x)g(x)dx$.

The point is, it doesn't matter how you label the $e_{i}$, the sum is still the same.