F(x)=a[0]+(sum of)a[k]cos(kx)+b[k]sin(mx) for 1<=k<=n, where a[i] and b[i] are the i-th terms in the series for coefficients a and b, is the Fourier series in general terms.
The function can be split into the constant 3 and the odd function -2x (oddness is given by the fact that if we put g(x)=-2x, then if g(-x)=-(g(x)) the function is odd and in the Fourier series a[k]=0). So a[0]=3.
b[k]=(1/(pi))(integral wrt x between limits -(pi) to +(pi) of)(-2x)sin(nx)dx. Let u=cos(nx), so du=-n*sin(nx) and v=x, so dv=dx, then (integral)udv+(integral)vdu=u*v. (integral)cos(nx)dx+(integral)x(-n*sin(nx))dx=x*cos(nx), from which (integral)x*sin(nx)=((integral)cos(nx)dx-x*cos(nx))/n. Now we can write: b[k]=(1/(pi))(-2)((integral)cos(nx)dx-x*cos(nx))/n. Integral and expression to be calculated between limits -(pi) and (pi). The result of the integral is sin(nx)/n but when the limits are introduced we have sin(n(pi)) which is zero. So the only contribution is from the other term which evaluates to +(2/n(pi))((pi)2cos(n(pi)). cos(n(pi))=1 when n is even and -1 when n is odd=(-1)^n. So b[k]=(4/n)(-1)^n and F(x)=3-4sin(x)+2sin2x-4/3sin3x+sin4x-5/4sin5x+...