Fourier series of $f(x)=\int\limits_0^x \ln\sqrt{\frac{1}{2}\left| 1+\sqrt3 \tan\frac{t}{2} \right|} \ \text dt$ 
Find the Fourier series of the function
  $$f(x)=\int\limits_0^x \ln\sqrt{\frac{1}{2}\left| 1+\sqrt3 \tan\frac{t}{2} \right|} \ \text dt$$
  or show that it does not exist.

The first thing I have done is to find the domain of the under-integral function (call it $g$):
$$D_g=\left\{ x \in \mathbb R\ |\ x=(2k+1)\pi \vee x=\left(2k+5/3\right)\pi, k \in \mathbb Z \right\}$$
Then, I established that
$$\lim_{x \to (2k+1)\pi} g(t) = -\infty$$
$$\lim_{x \to (2k+5/3)\pi} g(t) = +\infty$$
and this could cause me trouble evaluating the integral.
An idea that comes to mind is to expand $g$ into a Maclaurin series but I don't know what to do about the $\frac{1}{2}$ factor or the absolute value sign.
Also, I do not know how to test whether the function is periodic or not, but graphing the function shows that it is.
What is a good way to approach this problem?
 A: $g(t)=\ln\sqrt{\frac{1}{2}\left| 1+\sqrt3 \tan\frac{t}{2} \right|} =\frac{1}{2}(\ln|\cos(\frac{t}{2}-\frac{\pi}{3})| - \ln|\cos(\frac{t}{2})|)$
Since $\ln|2\cos(\frac{t}{2})|=\sum_1^{\infty}(-1)^{n+1}\frac{\cos(nt)}{n}, -\pi<t<\pi$ and the function is integrable at $\pi$ (though infinity there), we can integrate term by term and get a result valid on the full interval $[-\pi, \pi]$,
$\int\limits_0^x\ln|2\cos(\frac{t}{2})|dt=\sum_1^{\infty}(-1)^{n+1}\frac{\sin(nx)}{n^2}$, hence $\int\limits_0^x\ln|\cos(\frac{t}{2})|dt=\sum_1^{\infty}(-1)^{n+1}\frac{\sin(nx)}{n^2} -x\ln2$
Similarly $\ln|2\cos(\frac{t}{2}-\frac{\pi}{3})| = \sum_1^{\infty}(-1)^{n+1}\frac{\cos(n(t+2\frac{\pi}{3}))}{n}, -\pi \leq t \leq \pi, t\neq -\frac{\pi}{3}$ but the integral works term by term, so
$\int\limits_0^x\ln|2\cos(\frac{t}{2}-\frac{\pi}{3})|dt=\sum_1^{\infty}(-1)^{n+1}(\frac{\sin(n(x+2\frac{\pi}{3}))}{n^2} -\frac{\sin(2n\frac{\pi}{3})}{n^2})$, hence $\int\limits_0^x\ln|\cos(\frac{t}{2}-\frac{\pi}{3})|dt=\sum_1^{\infty}(-1)^{n+1}(\frac{\sin(n(x+2\frac{\pi}{3}))}{n^2} -\frac{\sin(2n\frac{\pi}{3})}{n^2}) - x\ln2$
You can put things together now and massage them expanding $\sin(n(x+2\frac{\pi}{3})) = \sin(nx)\cos(2n\frac{\pi}{3})+ \cos(nx)\sin(2n\frac{\pi}{3})$ if you want a result in classical Fourier terms as the non-periodic terms cancel out.
