I am trying to write the Fourier series of $(1-x)$ in $[0,1]$ in two different ways:
$$f(x) = \frac{a_0}{2}+\sum_{n=1}^\infty (a_n\cos(\pi nx/L)+b_n\sin(\pi n x/L)),$$
$$f(x)=\frac{a_0}{2}+\sum_{n=1}^\infty (a_n\cos(2\pi nx/L)+b_n\sin(2\pi n x/L)),$$
If I use the first one to write the Fourier series of $(1-x)$ in the interval $[0,1]$, I get $$f(x)=1/2+\sum_{n=0}^\infty \left\{\frac{2(1-(-1)^n)}{n^2\pi^2}\cos(n\pi x)+\frac{2}{n\pi}\sin(n\pi x)\right\}.$$
If I use the second one, however, I get
$$f(x) = 1/2+\sum_{n=0}^\infty \frac{\sin(2\pi nx)}{\pi n}.$$
Shouldn't they result in the same series?
How I calculated the coefficients in the first case:
$$b_n=2\int_0^1(1-x)\sin(n\pi x)dx$$
$$a_n=2\int_0^1(1-x)\cos(n\pi x)dx$$
For the second case:
$$b_n=2\int_0^1(1-x)\sin(2\pi nx)dx$$
$$a_n=2\int_0^1(1-x)\cos(2\pi nx)dx$$
Your second calculation is correct and corresponds to the function $f$ with period $1$ such that $\forall x\in(0,1),f(x)=1-x$.
Your first calculation, where $$g(x)=\frac{a_0}{2}+\sum_{n=1}^\infty \left(a_n\cos(\pi nx)+b_n\sin(\pi n x)\right)$$ and the real coefficients $a_n,b_n$ are given by $$a_n+ib_n=2\int_0^1(1-x)e^{i\pi nx}dx,$$ corresponds to the function $g$ with period $2$ such that $\forall x\in(0,1),g(x)=1-x$ and $\forall x\in(1,2),g(x)=0$.