I have two ask questions, I'll begin with a specific one:
Find the Fourier series of the following function: $f(x)=0$ when $x \in [-\pi,0]$, $f(x)=e^x$ when $x \in (0,\pi]$.
This is a book exercise but there's no answer key so I don't know if my suggestion is correct or what I should try to reach. Let's simply begin with the coefficient $a_0$ of the Fourier series of $f$:
$$a_0 := \frac{1}{\pi} \int_{-\pi}^{\pi} f(x) dx$$
Split integration to $\int_{-\pi}^0$ and $\int_0^{\pi}$, whence
$$\pi a_0 = \int_{-\pi}^0 0 \cdot dx+\int_0^\pi e^x dx$$
Is this a correct way to begin, that will also work for $a_n,b_n$ where $n>0$?
My second question is, of course, if $f=g$ on $[-\pi,a]$ and $f=h$ on $(a,\pi)$, can one split up the calculation of $a_n$ (and analogously $b_n$) by simply calculating
$$\pi a_n = \int_{-\pi}^a f(x) \cos{(nx)}dx+\int_a^\pi f(x) \cos{(nx)}dx?$$
I don't find the answer here satisfying. Thank you.