The definition given on wikipedia for Fourier Coefficients is as follows:
$a_n=\frac{2}{P}\int_{P}^{} s(x)cos(\frac{2\pi xn}{P})dx$
where $P$= Period
Now, then while solving for Fourier series of $|sinx|$ I equated it to:
$\frac {a_o}{2} + \sum cos(\frac{2\pi xn}{P})dx$
Here, I got confused whether to take P as $\pi$ or $2\pi$ even when I know that the period of $|sinx|$ is $\pi$. This is is because most of the solution online equate the function to the series:
$\frac {a_o}{2} + \sum cos(nx)dx$ and then proceed while it should be $cos(2nx)$ according to me since period is $\pi$.
Also, in other places I have found the definiton as:
$a_n=\frac{2}{P}\int_{P}^{} s(x)cos(\frac{\pi xn}{P})dx$ which differs from wikipedia which has a 2 in the argument of $cos$.
What do I don't understand here?