Consider the function defined in the interval $(a, b)$ $$ f(x) = \begin{cases} e^x & \text{if $a\leq x< \frac{b}{2} $} \\ -x^4 & \text{if $\frac{b}{2} \leq x < b$} \end{cases} $$ given $a<0<b$ and $a^2>b^2$
I am having trouble writing down the integrals i need to solve since it is not clear to me what are the intervals of integration. I think that $-1< b < 0$ and $a \in (\infty ,-1]$ but i don't know exactly how to get from there. Are the coefficients simply calculated like $$ \frac{2}{a+b} \int_{a}^{\frac{b}{2}} e^x \cos\left(\frac{n\pi x}{a+b}\right) dx $$ or am i missing something? Thanks for the help.
Whenever solving a Fourier Series Problem , Think of it like this:
\begin{equation} f(x) = \frac{A_{0}}{2} + \sum_{n=1}^{\infty} (A_{n}cos(\frac{n\pi x}{L}) + B_{n}sin(\frac{n\pi x}{L}) ) \end{equation}
Now in your case: $$L = \frac{b-a}{2}$$
Hence you get: \begin{equation} {A}_n = \frac{2}{b-a}\int_{a}^{b}f(x)cos(\frac{2n\pi x}{b-a})dx \\ {B}_n = \frac{2}{b-a}\int_{a}^{b}f(x)sin(\frac{2n\pi x}{b-a})dx \end{equation} Just remember your function switches at x > $\frac{b}{2}$,
Thus go $a$ to $\frac{b}{2}$ and then $\frac{b}{2}$ to $b$ in both of your integrals.