# Fourier part series, missing one piece

$$F(x)=\left\{ \begin{array}{rl} ax,&0<x<\pi,\\ bx,&-\pi<x<0, \end{array} \right.$$

So, far i've got: $$a_0 = - \frac{b\pi}{2} + \frac{a\pi}{2}$$ $$bn = \frac{1}{\pi} \frac{(-1)^{n+1}}{n}(a+b)$$

Can someone help me get $a_n$? I did try, but I don't really think $0$ is the solution. Thank you.

• $$F(x) = \frac{a-b}{2}\ |x| + \frac{a+b}{2} x$$ for $-\pi<x<\pi$, and probably you can lookup their Fourier series representation somewhere. – peterwhy May 21 '16 at 21:56
• I did try, but nothing helped. – mirai May 21 '16 at 22:02

$$F(x) = \frac{a-b}{2}\ |x| + \frac{a+b}{2} x$$ for $-\pi<x<\pi$. The first part is an even function that corresponds to the $a_n$'s.

Without looking at tables, the formula for $a_n$, $n> 0$ is

\begin{align*} a_n &= \frac2{2\pi}\int_{-\pi}^\pi\frac{a-b}{2}\ |x|\cos nx\ dx\\ &= \frac{a-b}{2\pi}\int_{-\pi}^\pi|x|\cos nx\ dx\\ &= \frac{a-b}{2\pi}\int_{-\pi}^0(-x)\cos nx\ dx + \frac{a-b}{2\pi}\int_{0}^\pi x\cos nx\ dx\\ &= \frac{a-b}{\pi}\int_{0}^\pi x\cos nx\ dx\\ &= \frac{a-b}{n\pi}\int_{0}^\pi x\ d\sin nx\\ &= \frac{a-b}{n\pi}\left\{\left[x\sin nx\right]_0^\pi-\int_{0}^\pi \sin nx\ dx\right\}\\ &= \frac{a-b}{n\pi}\left\{\left[x\sin nx\right]_0^\pi+\left[\frac{\cos nx}n\right]_0^\pi\right\}\\ &= \frac{a-b}{n\pi}\left(0+\frac{\cos n\pi}{n} - \frac 1n\right)\\ &= \frac{(a-b)(\cos n\pi-1)}{n^2\pi}\\ &= \frac{(a-b)((-1)^n-1)}{n^2\pi}\\ &=\begin{cases} -\dfrac{2(a-b)}{n^2\pi}&n\text{ is odd}\\ 0&n\text{ is even, }n\ne 0\end{cases} \end{align*}

Or it is possible to do the following integration directly, and I don't think it is different:

$$a_n = \frac{2}{2\pi}\int_{-\pi}^\pi F(x)\cos nx\ dx$$

• Thank you so much! I guess I was partly right :) – mirai May 21 '16 at 22:34
• @mirai Are you allowed to lookup Fourier series tables? This is much easier to do if you can. The $|x|$ is just a triangular wave, and the $x$ is a sawtooth wave, possibly with scaling and shifting. – peterwhy May 21 '16 at 22:37
• I can look, but i still have to do this. – mirai May 21 '16 at 22:43
• @mirai If you think this is helpful, please mark this as an answer. – peterwhy May 21 '16 at 22:53