Find the Fourier series of the following function:
$f(x) = \left\{\begin{align} 1+x,\quad -1\lt x \lt 0 \\ 1-x,\;\;\;\quad 0\lt x \lt 1\end{align} \right.$
$f(x+2) = f(x),\quad\quad -\infty \lt x \lt \infty$
So we have a periodic function of period, $p=2$
$a_0=\frac1{2L}\int_{-L}^Lf(x)dx=\cfrac12\left[\large\int_{-1}^0 1+x \, dx+\large\int_0^11-x\, dx\right]=\frac12$
$a_n = \large\int_{-1}^0 (1+x)\cos\left(n\pi x\right) \, dx + \large\int_{0}^1 (1-x)\cos\left(n\pi x\right) \, dx$
$$=-\frac{\sin(-n\pi)}{n\pi}+\frac{\sin(-n\pi)}{n\pi}+\frac{1}{n^2\pi^2}-\frac{\cos(-n\pi)}{n^2\pi^2}-\frac{\sin(-n\pi)}{n\pi}-\frac{\sin(n\pi)}{n\pi}-\frac{\cos(n\pi)}{n^2\pi^2}+\frac{1}{n^2\pi^2}$$
Noting that $\sin$ is an odd function, we can eliminate some terms from above.
$$=\frac{2}{n^2\pi^2}-\frac{2\cos(n\pi)}{n^2\pi^2}$$
$$b_n = \large\int_{-1}^0 (1+x)\sin\left(n\pi x\right) dx + \large\int_{0}^1 (1-x)\sin\left(n\pi x\right) dx$$
Is there a way to instantly construct $b_n$ based on my $a_n$ result?
There is no way of determining $b_n$ from $a_n$. For instance, if $a_n=0$ for al $n\ge0$, $\{b_n\}$ can be any sequence such that $\sum|b_n|^2<\infty$. With the same $a_n$ you have an infinitude of possible $b_n$'s.