Calculate the fourier series of
$$ f(t)= \begin{cases} 2t+1, -1 \le t < 1\\ \text{continued periodically}\\ \end{cases} $$
f is neither even nor odd, so we must assume that $a_k$ and $b_k$ are not equal to $0$.
$a_0 = \int_{-1}^{1}(2t+1)dt = 2$
Since $T=2$ we have
$$a_k = \frac{2}{2} \int_{-1}^{1}2t \cos(k \pi t)dt + \int_{-1}^{1}\cos(k \pi t)dt$$
The second integral becomes = $0$ since,
$$\int_{-1}^{1}\cos(k \pi t) = \frac{\sin(\pi k t)}{\pi k} |_{-1}^{1} = 0 $$ because $\sin(\pi k) = 0$ for all k and so is $\sin(-\pi k) = 0$.
The first integral
$$ \int_{-1}^{1}2t \cos(\pi k t)dt = 2t \frac{\sin(\pi k t)}{\pi k}\bigl|_{-1}^{1}-2\int_{-1}^{1}\frac{\sin(\pi k t)}{\pi k}$$
$$2t \frac{\sin(\pi k t)}{\pi k}\bigl|_{-1}^{1} = 0$$ because $\sin(\pi k)$ and $\sin(-\pi k)=0$.
Now
$$-2\int_{-1}^{1}\frac{\sin(\pi k t)}{\pi k} = 2 ( \frac{\cos(\pi k t)}{(\pi k)^2} - \frac{\cos(-\pi k t)}{(\pi k)^2} \bigl)_{-1}^{1}$$
since $\cos(x) = \cos(-x)$ we get
$$2 ( \frac{\cos(\pi k t)}{(\pi k)^2} - \frac{\cos(-\pi k t)}{(\pi k)^2} \bigl)_{-1}^{1}=0$$
regarding $b_n$
$$b_n = \int_{-1}^{1}2t \sin(k \pi t)dt + \int_{-1}^{1}\sin(k \pi t)dt $$
Now the second integral $$\int_{-1}^{1}\sin(k \pi t)dt =0$$ because
$$\int_{-1}^{1}\sin(k \pi t)dt = -\frac{\cos(\pi k t)}{\pi k} \bigl|_{-1}^{1} = \frac{-\cos(\pi k)}{\pi k} + \frac{\cos(-\pi k)}{\pi k} = 0$$
and the last integral
$$\int_{-1}^{1} 2t \sin(k \pi t)dt = -2t\frac{\cos(\pi k t)}{\pi k} \bigl|_{-1}^{1} + \frac{2 \sin(\pi k t)}{(\pi k)^2} \bigl|_{-1}^{1}$$
again we now that $ \sin=0$
so we only have
$$-2t\frac{\cos(\pi k t)}{\pi k} \bigl|_{1}^{1} = -2\frac{\cos(\pi k )}{\pi k}- 2\frac{\cos(-\pi k )}{\pi k} =-4\frac{\cos(\pi k )}{\pi k}$$
and since cos is -1 or 1, we have
$$b_k = \frac{-4(-1)^{n}}{\pi k} = \frac{4(-1)^{n+1}}{\pi k}$$
So to sum it up the fourier coefficients are
$$a_0 =2$$ $$a_k = 0$$ $$b_k = \frac{4(-1)^{n+1}}{\pi k}$$
is everything correct?
Initial remark : if you subtract initially 1 to your function, it becomes odd. This is why, beyond $a_0$, all the other $a_k=0$ ; this can spare a lot of effort.
Here is a way to check that "the rest is okay" by writing a little program with one of the most powerful (public domain) scientific software, SAGE :
which will give you, as expected :
$$0, \frac{4}{\pi}, -\frac{2}{\pi}, \frac{4}{3 \, \pi}, -\frac{1}{\pi}, \frac{4}{5 \, \pi}, -\frac{2}{3 \, \pi}$$
together with the graphical representation :