$\displaystyle f(x)=\frac{a_{0}}{2}+\sum_{n=1}^\infty a_{n}\cos nx$,
where $a_{n}=\frac{2}{\pi}\int_0^\pi f(t)\cos(nt) \ dt$, if $f$ is even.
But for $f(x)=1$, the left side goes to $0$. How can I get the Fourier series of $1$?
$\displaystyle f(x)=\frac{a_{0}}{2}+\sum_{n=1}^\infty a_{n}\cos nx$,
where $a_{n}=\frac{2}{\pi}\int_0^\pi f(t)\cos(nt) \ dt$, if $f$ is even.
But for $f(x)=1$, the left side goes to $0$. How can I get the Fourier series of $1$?
On
What about this?
$$f(x)= \sum_{n=1}^\infty b_m\sin(mx)$$
as $f(x)=1$ we get $$b_m=\frac{2}{\pi}\int_0^\pi\sin(mx)dx$$ $$=\frac{2}{\pi}[\frac{-\cos(mx)}{m}]_0^\pi=\frac{2}{m\pi}(1-(1)^m)$$
This gives us that $b_m= 0 $ if m is even, or $b_m = \frac{4}{m\pi}$ if m is odd
In this question we want to keep m odd so to unsure that we let $m =2n-1$ so this gives us $$f(x)=\sum_{n=1}^\infty\frac{4}{m\pi}sin(mx)$$ $$f(x)=\frac{4}{\pi}\sum_{n=1}^\infty\frac{\sin((2n-1)x)}{2n-1}$$
Define the function periodically over $\;[-\pi,\pi]\;$ , so being the function even we get:
$$\begin{align*}&a_0=\frac2\pi\int\limits_0^\pi dx=2\\{}\\ &a_n=\frac2\pi\int\limits_0^\pi\cos nx\;dx=\left.\frac2{n\pi}\sin nx\right|_0^\pi=0\end{align*}$$
and the Fourier series we get is pretty boring:
$$f(x)=\frac{a_0}2+\sum_{n=1}^\infty a_n\cos nxdx=1$$