I am currently doing extra practice problems before my Differential Equations final and found a seemingly straight-forward Fourier Series problem for which I cannot find the n=1 term for. The problem is:
$$f(x) = \begin {cases} 0, -\pi<x<0 \\ sin(x), 0<x<\pi \end{cases}$$
The solution in the back of the book is:
$$ f(x) = \frac{1}\pi + \frac{sin(x)}2 + \frac{1}{\pi}\sum_{n=2}^\infty \frac{(-1)^n +1}{1-n^2}cos(nx)$$
I am having trouble getting the $\frac{sin(x)}2$ term. I am currently attempting to evaluate the summand at n=1 using L'Hopital's rule, however this is failing to yield the correct value. I have attempted to do this using two forms of the summand:
$$\lim_{n\to 1} \frac{cos(n\pi)+1}{1-n^2}cos(nx) = \frac{0}{0}$$ Applying L'Hopital's rule this is equal to: $$\lim_{n\to 1}\frac{(-\pi sin(n\pi)cos(nx)) + (cos(n\pi)+1)(-xsin(nx))}{-2n}=\frac{0}{-2} = 0$$
$$\lim_{n\to 1} \frac{(-1)^n + 1}{1-n^2}cos(nx) = \frac{0}{0}$$ Again applying L'Hopital's rule: $$\lim_{n\to 1} \frac{(n(-1)^{n-1} cos(nx))+((-1)^n + 1)(-xsin(nx))}{-2n}=\frac{cos(x)+0}{-2}=\frac{cos(x)}{-2}$$
I have a feeling L'Hopital's rule is not valid to use here due the summand not being a continuous function in n, but I am unsure what alternative's there are. The only other thing I can think of would be that there is another way to express this but I cannot think of any. Any help would be much appreciated.
The fourier coefficient $a_n $ for $n=1$ is given by the following fomula: $$a_1=\frac {1}{\pi}\int_{-\pi}^{\pi} f (x) \cos x dx$$ $$=\frac {1}{\pi}\int_{0}^{\pi} \sin x \cdot \cos x dx$$ $$= \frac {1}{\pi} \cdot \frac {\cos 2x}{2}|_{0}^{\pi} $$ $$=0$$
And the fourier coefficient $b_n $ for $n=1$ is given by the following fomula: $$b_1=\frac {1}{\pi}\int_{-\pi}^{\pi} f (x) \sin x dx$$ $$=\frac {1}{\pi}\int_{0}^{\pi} \sin x \cdot \sin x dx$$ $$= \frac {1}{\pi} \int_{0}^{\pi} \frac {1-\cos 2x}{2} dx$$ $$=\frac {1}{\pi} \cdot (\frac {\pi}{2}-0)$$ $$=\frac {1}{2}$$
So the term $b_1 \sin x = \frac {\sin x}{2}$
Hope this helps you.