0

$$f(x) =\sin \left(\frac{x}{2}\right)$$ on interval $0 < x < \pi$

Hello, I'm trying to do the sine series. I understand I have to do $b_n$ but somehow I always get $0$ as result, but it doesn't seem logical to me.

I always end up to the point where I get $\sin$ of something minus that same $\sin$.
This is what I have so far:

\begin{align} b_n &=\frac{2}{\pi} \int_o^\pi \sin\left(\frac{x}{2}\right)\sin nx\,dx\\ &=\frac{2}{\pi} \int_o^\pi \frac{{\cos\left(\frac{x}{2} - x\right)}-{\cos\left(\frac{x}{2} - x\right)}}{2}dx\\ &=\frac{1}{\pi} \int_o^\pi \left({\cos\left(-\frac {x}{2}\right)}-{\cos\left(\frac{x}{2}\right)}\right)dx \end{align}

And its pretty much clear what happens, I end up with $0$ as result. I'm so confused.

I'd like to see how would you do $b_n$ because I think I did something wrong along the line, but I tried so many times I can't see it anymore :)

Much appreciated.

mirai
  • 43

1 Answers1

1

I think you forgot to include $n$ when rewriting the integrand in the first step. It should be $\sin(x/2)\sin(nx)=1/2\bigg(\cos(x/2-nx)-\cos(x/2+nx)\bigg)$

Then the cosine terms no longer cancel and you find something like $b_n=\frac{(-1)^n 2n}{\pi(n^2+1/4)}$

There might be some mistakes in what follows but this is how I got to that result: \begin{align*} b_n&=\frac{2}{\pi}\int_0^{\pi}\sin(\frac{x}{2})\sin(nx)dx\\ &=\frac{1}{\pi}\int_0^{\pi}\cos\big((\frac{1}{2}-n)x\big)-\cos\big((\frac{1}{2}+n)x\big)\\ &=\frac{1}{\pi}\bigg[\frac{\sin\big((\frac{1}{2}-n)x\big)}{\frac{1}{2}-n}-\frac{\sin\big(\frac{1}{2}+n)x\big)}{\frac{1}{2}+n}\bigg]^{\pi}_0\\ &=\frac{1}{\pi}\bigg(\frac{\sin\big(\frac{\pi}{2}-n\pi\big)}{\frac{1}{2}-n}-\frac{\sin\big(\frac{\pi}{2}+n\pi\big)}{\frac{1}{2}+n}\bigg)\\ &=\frac{1}{\pi}\bigg(\frac{\cos\big(n\pi\big)}{\frac{1}{2}-n}-\frac{\cos\big(n\pi\big)}{\frac{1}{2}+n}\bigg)\\ &=\frac{1}{\pi}\bigg(\frac{(-1)^n}{\frac{1}{2}-n}-\frac{(-1)^n}{\frac{1}{2}+n}\bigg)\\ &=\frac{2(-1)^n n}{\pi(\frac{1}{4} -n^2)} \end{align*}

Nikolai
  • 126
  • Are you sure it should be - at one and + at the other one? – mirai May 21 '16 at 17:36
  • 1
    Yes, you can derive it from the formulas for addition of angles $\cos(x \pm y)=\cos x \cos y \mp \sin x \sin y$. Just subtract $\cos(x+y)$ from $\cos(x-y)$ to find $2\sin x \sin y=\cos(x+-y)-\cos(x+y)$ – Nikolai May 21 '16 at 17:45
  • Can you explain it to me how did you get that solution, please? – mirai May 21 '16 at 17:51
  • You have $\cos (x+y)=\cos x\cos y -\sin x\sin y$ and $\cos (x-y)=\cos x\cos y +\sin x\sin y$. When you subtract the former from the latter you get $\cos (x-y)-\cos (x+y)=\cos x\cos y +\sin x\sin y - \big(\cos x\cos y -\sin x\sin y\big)=2\sin x\sin y$. The identity $\cos(x\pm y)=\cos x\cos y \mp \sin x \sin y$ can be derived from $e^{i\theta}=\cos\theta+i\sin\theta$. – Nikolai May 21 '16 at 18:59
  • I understood that, i meant for $b_n=\frac{(-1)^n 2n}{\pi(n^2+1/4)}$ – mirai May 21 '16 at 19:01
  • Yes, i have that too. But i don't really know how to proceed from there :S I divide that in two integrals but i don't get what to do with them, when i have nx and additional x now? – mirai May 21 '16 at 19:17
  • Can i write it like cos(x*x/2)-cos(nx) maybe? – mirai May 21 '16 at 19:22
  • I edited my original answer to include my calculation. Took a while to get it all in tex ;) – Nikolai May 21 '16 at 19:31
  • You are a charm! Thank you <3 – mirai May 21 '16 at 21:20