# Half Range Sine Series

Question: It is known that $f(x)=(x−4)^2$ for all $x\in [0,4]$.

Compute the half range sine series expansion for $f(x)$.

Half range series: $p=8$, $l=4$, $a_0=a_n=0$.

$$b_n=\frac{2}{L}\int_{0}^{L}f(x)\sin\left(\frac{n\pi x}L\right)d(x)=\frac{2}{4}\int_{0}^{4}(x-4)^2\sin\left(\frac{n\pi x}4\right)d(x)$$

Partial Differentiation Let $u=(x-4)^2$; $du=2(x-4)dx$; $v=\frac{-4}{n\pi}\cos(\frac{n\pi x}4)$

\begin{align} b_n&=\frac{1}{2}[\frac{-4}{n\pi}cos(\frac{n\pi x}4)(x-4)^2+\frac{8}{n\pi}\int(x-4)\cos(\frac{n\pi x}4)d(x)]|^4_0\\ &=\frac{1}{2}[\frac{-4}{n\pi}\cos(\frac{n\pi x}4)(x-4)^2+\frac{8}{n\pi}[\frac{4}{n\pi}\sin(\frac{n\pi x}4)(x-4)-\frac{4}{n\pi}\int\sin(\frac{n\pi x}4)d(x)]]|^4_0\\ &=\frac{1}{2}[\frac{-4}{n\pi}\cos(\frac{n\pi x}4)(x-4)^2$+$\frac{8}{n\pi}[\frac{4}{n\pi}\sin(\frac{n\pi x}4)(x-4)-\frac{4}{n\pi}(\frac{-4}{n\pi}\cos\frac{n\pi x}4)]|^4_0\\ &=\frac{1}{2}[\frac{-4}{n\pi}\cos(\frac{n\pi x}4)(x-4)^2$+$\frac{8}{n\pi}(\frac{16}{n^2\pi^2}\cos\frac{n\pi x}4)]|^4_0 \end{align}

we know $cosn\pi=(-1)^n$

$\frac{1}{2}[(0+\frac{128(-1)^n}{n^3\pi^3})-(-\frac{64}{n\pi}+\frac{128}{n^3\pi^3})$

$b_n=\frac{64(-1)^n}{n^3\pi^3}-\frac{64}{n^3\pi^3}+\frac{32}{n\pi}$

My teacher told me my $b_n$ is wrong and it seems that my working also looks like wrong. Can someone please help me to recalculate my $b_n$ please. Just help me once only guys.If I get this right I would able to get full marks.I would be very very grateful to you guys if you guys able to help me. If can suggest me any ideas or simpler way to solve it if you can.Thanks

-
Should $b_n$ be the integral from $-L$ to $L$ or the integral from $0$ to $L$ because it switches from the first line to the second line without any multiplicative factor. – Euler....IS_ALIVE Sep 9 '12 at 6:40
O to L. It alwys like that for Half Range Sine Series – David Sep 9 '12 at 6:48
But you wrote it as $-L$ to $L$ in your first definition of $b_n$.... – Euler....IS_ALIVE Sep 9 '12 at 6:49
this is the link for reference intmath.com/fourier-series/4-fourier-half-range-functions.php – David Sep 9 '12 at 6:49
I edited already – David Sep 9 '12 at 6:50

The integral defining your $b_n$ is correct, but the final answer is wrong. It differs from mine by ${64\over n\pi}$.