fin the cosine series fo r the function defined by
f(x) = 1/4 - x, 0<= x < 1/2
f(x) = x - 3/4, 1/2<=x<=1
for this, I chose L = 1/2, so t = 2pie x
so the integral limits are 0 to pie and pie to 2 pie...
How do I get it to go to -pie to pie? help!
fin the cosine series fo r the function defined by
f(x) = 1/4 - x, 0<= x < 1/2
f(x) = x - 3/4, 1/2<=x<=1
for this, I chose L = 1/2, so t = 2pie x
so the integral limits are 0 to pie and pie to 2 pie...
How do I get it to go to -pie to pie? help!
Extend you function (represented by dotted line) in the way shown below.
Since $\displaystyle f(-1) = f(1)$ we can extend $\displaystyle f$ periodically by $\displaystyle f(x) = f(x+L)$ where $\displaystyle L=1$.
The Fourier series would be given as, $\displaystyle \frac{a_0}{2} + \sum_{n=0}^{\infty} a_n \cos (\pi n x) + b_n \sin (\pi n x)$.
Since $\displaystyle f$ on $\displaystyle [-1,1]$ is an even function it forces $\displaystyle b_n = 0$.
Thus, $\displaystyle a_n = 2\int_0^1 f(x)\cos (\pi n x) dx $ for $\displaystyle n\geq 0$.
$\displaystyle f(-1)=1/4 = f(1)$
It seems you can do your problem two ways. One way is the approach I was trying to do above with $\displaystyle L=1$ but you can also do it with $\displaystyle L=1/2$. Because if you take the function $\displaystyle f$ on $\displaystyle [-1/2,1/2]$ and extend it periodically you would get the same function. Thus, in that case you can pick $\displaystyle L=1/2$ too.i see that f(-1/2) = f (1/2)
so L = 1/2
so f(x) = f(x-1/2)