how will i integrate this by parts? what is u and dv?
It should be $\displaystyle b_n = 2 \int_{\frac{-1}{2}}^{\frac{1}{2}} (x^3+x)\sin(nx) dx $
Where n = 1, 2, 3, 4, 5, 6, 7...
Do it using parts, yes.
$\displaystyle b_n = 2 \int_{\frac{-1}{2}}^{\frac{1}{2}} (x^3+x)\sin(nx) dx = 2 \int_{\frac{-1}{2}}^{\frac{1}{2}}\bigg(x^3\sin(nx) +x\sin(nx)\bigg) dx $
$\displaystyle = 2 \int_{\frac{-1}{2}}^{\frac{1}{2}} x^3\sin(nx) dx+2 \int_{\frac{-1}{2}}^{\frac{1}{2}}x\sin(nx) dx $
And strictly speaking he was wrong, the trig functions (with appropriate scalling) form a complete orthonormal basis for $\displaystyle L^2(a,b)$ , and Fourier series theory does not refer to anything outside the interval in the definition of the function space.
(other function and generalised function spaces may be used instead, but the principle is the same, we are only discussing the given interval, if you have a periodic function and its Fourier series is also periodic, when treated as a formal series, is also periodic with the same period then fine you can use that but the development of the theory does not require it)
The functions are only defined on the interval $\displaystyle (a,b) $, to consider what they might do outside this interval is irrelevant, they are not defined there.
CB