## UnkleRhaukus 2 years ago cos(x) as a sine series

1. UnkleRhaukus

$\qquad\text{$$f(x)$$ as a sine series}$ \begin{equation*} f(x)=\cos(x),\qquad0<x<\pi \end{equation*} \begin{equation*} % g(x) g(x)= \begin{cases} \cos(x),&0<x<\pi\\ -\cos(x),&-\pi<x<0 \end{cases}\qquad\text{odd extension} \end{equation*}

2. UnkleRhaukus

\begin{align*} % a_0,n a_0&=a_n=0\qquad\text{(odd function)}\\ \end{align*} \begin{align*} % b_n b_n&=\frac1\pi\int\limits_{-\pi}^\pi g(x)\sin(nx)\,\text dx\\ &=\frac2\pi\int\limits_{0}^\pi \cos(x)\sin(nx)\,\text dx\qquad\text{(even integrand)}\\ &=\frac1\pi\int\limits_{0}^\pi \sin\big((1+n)x\big)-\sin\big((1-n)x\big)\,\text dx\\ &=\frac1\pi\left[\frac{-\cos\big((1+n)x\big)}{1+n}+\frac{\cos\big((1-n)x\big)}{1-n}\Big|_0^\pi\right]\\ &=\frac1\pi\left[\frac{1-\cos\big((1+n)\pi\big)}{1+n}+\frac{\cos\big((1-n)\pi\big)-1}{1-n}\right]\\ &=\frac1\pi\left[\frac{1-(-1)^{n+1}}{1+n}+\frac{(-1)^{n+1}-1}{1-n}\right]\\ &=\frac1\pi\left[\frac{1+(-1)^{n}}{1+n}+\frac{(-1)^{n+1}-1}{1-n}\right]\\ &=\frac1\pi\left[\frac{(1-n)\big(1+(-1)^n\big)-(1+n)\big((-1)^{n}+1\big)}{1-n^2}\right]\\ &=\frac1\pi\left[\frac{-2n\big((-1)^{n}+1\big)}{1-n^2}\right]\\ &=\frac2\pi\left[\frac{n\big((-1)^{n}+1\big)}{n^2-1}\right]\\ \end{align*}

3. UnkleRhaukus

\begin{align*} % S(x) S(x)&=\frac2\pi\sum\limits_{n=1}^\infty\frac{n\big((-1)^{n}+1\big)}{n^2-1}\sin(nx)\\ &=\frac4\pi\sum\limits_{n=2,4,6,\dots}^\infty\frac{n\sin(nx)}{n^2-1}\\ &=\frac8\pi\sum\limits_{r=1}^\infty\frac{r\sin(2rx)}{4r^2-1}\\ \end{align*}

4. UnkleRhaukus

5. UnkleRhaukus

for some reason in the back of my book it has $\frac8\pi\sum\limits_{r=1}^\infty\frac{r\sin(2rx)}{4r^2+1}$ as the answer, which seams like a mistake to me , but maybe i have overlooked something

6. NewOne

The math checks out.

7. NewOne

He used the last trig identity on this page convert it. http://www.sosmath.com/trig/Trig5/trig5/trig5.html

8. NewOne

Were you expecting bn as 0?

9. UnkleRhaukus

the only qualm i have on this question is the plus sign in the denominator of answer in the back of the book, i got a minus sign , which seams to graph the correct thing so im not sure .

10. NewOne

I got minus as well.

11. UnkleRhaukus

i guess the back of my book is wrong then ,

12. hartnn

yeah, even i get minus doing it another way also...

13. UnkleRhaukus

Thanks to both of you