Problem 345
Easy Remainders and Fourier Series

Expand the periodic function f(x)=ln |tan dfrac x2 |

Expand the periodic function $f(x)=\ln\left|\tan\dfrac x2\right|$ in a Fourier series.

Explanation of Method

Since $\tan\frac x2=\sin\frac x2/\cos\frac x2$, the function splits as a difference of two logarithms, each already expanded: $\ln|\sin\frac x2|$ from Problem 344, and $\ln|\cos\frac x2|=\ln\left|\sin\frac{\pi-x}2\right|$ obtained from the same result via the substitution $x\to\pi-x$. Subtracting, the constant terms cancel and only the odd-harmonic cosine terms survive.

  1. Express $\ln|\cos\frac x2|$ using Problem 344's result with $x\to\pi-x$.
  2. Subtract to get $\ln|\tan\frac x2|=\ln|\sin\frac x2|-\ln|\cos\frac x2|$.
  3. Simplify, noting even-$n$ terms cancel and odd-$n$ terms double.

Step 1 · $\ln|\cos\frac x2|$ from Problem 344

Since $\cos\frac x2=\sin\frac{\pi-x}2$, substituting $x\to\pi-x$ in Problem 344's result ($\cos(n(\pi-x))=\cos(n\pi)\cos(nx)+\sin(n\pi)\sin(nx)=(-1)^n\cos(nx)$): $$ \ln\left|\cos\frac x2\right| = -\ln2-\sum_{n=1}^\infty\frac{(-1)^n\cos(nx)}n. $$

Step 2 · Subtracting

$$ \ln\left|\tan\frac x2\right| = \ln\left|\sin\frac x2\right|-\ln\left|\cos\frac x2\right| = \sum_{n=1}^\infty\frac{(-1)^n-1}n\cos(nx). $$ For even $n$: $(-1)^n-1=0$. For odd $n=2k-1$: $(-1)^n-1=-2$: $$ \ln\left|\tan\frac x2\right| = -2\sum_{k=1}^\infty\frac{\cos((2k-1)x)}{2k-1}. $$

Step 3 · Fourier series and verification

$$ \boxed{\ln\left|\tan\frac x2\right| = -2\sum_{n=1}^\infty\frac{\cos((2n-1)x)}{2n-1} = -2\left(\cos x+\frac{\cos3x}3+\frac{\cos5x}5+\cdots\right)} $$ (Verified numerically at $x=1.0,2.5$: partial sums to $300{,}000$ terms match $\ln|\tan\frac x2|$ to 4+ decimal places. At $x=\pi/2$: LHS $=\ln1=0$; RHS: $\cos\frac{(2k-1)\pi}2=0$ for every $k$, so the series correctly gives $0$.)


Summary Table

PropertyValue
Fourier series$\ln|\tan\frac x2|=-2\sum\frac{\cos((2n-1)x)}{2n-1}$
Constant term$0$ (the $\ln2$'s cancel)

Additional Notes

Result

$$ \ln\left|\tan\frac x2\right| = -2\sum_{n=1}^\infty\frac{\cos((2n-1)x)}{2n-1}. $$