1^()circ Expand f(x)=x in a Fourier series on (- pi,pi).
$1^\circ$ Expand $f(x)=x$ in a Fourier series on $(-\pi,\pi)$. $2^\circ$ For which $x$ does the series equal $f(x)$? $3^\circ$ Express $\pi/2$ as a convergent numerical series. $4^\circ$ Find $\sum_{n=1}^\infty\frac{(-1)^{n-1}}{2n-1}$.
Explanation of Method
Since $f(x)=x$ is odd, its Fourier series has only sine terms. A single integration-by-parts computes $b_n$. Dirichlet's theorem (applicable here since $x$ is smooth on $(-\pi,\pi)$) then gives pointwise convergence, and evaluating the series at $x=\pi/2$ produces the classical Leibniz series for $\pi$.
- Compute $b_n$ via integration by parts, using oddness to skip $a_n$.
- Apply Dirichlet's theorem to determine where the series converges to $f(x)$.
- Evaluate the series at $x=\pi/2$ to extract the Leibniz series.
Part 1° · Fourier series
$f(x)=x$ is odd, so $a_0=a_n=0$ and $$ b_n = \frac2\pi\int_0^\pi x\sin(nx)\,dx = \frac2\pi\left[-\frac{x\cos(nx)}n\right]_0^\pi = -\frac{2\cos(n\pi)}n = \frac{2(-1)^{n+1}}n. $$ $$ \boxed{x = \sum_{n=1}^\infty \frac{2(-1)^{n+1}}n\sin(nx) = 2\left(\sin x-\frac{\sin2x}2+\frac{\sin3x}3-\cdots\right)} $$
Part 2° · Convergence
$f(x)=x$ is continuous and piecewise smooth on $(-\pi,\pi)$, so by Dirichlet's theorem the series converges to $f(x)=x$ at every $x\in(-\pi,\pi)$. At the endpoints $x=\pm\pi$, it converges to the average of the periodic extension's one-sided limits, $\frac{(-\pi)+\pi}2=0$.
Part 3° · A series for $\pi/2$
At $x=\frac\pi2$: $\sin\frac{n\pi}2$ is $0$ for even $n$ and $(-1)^{k+1}$ for $n=2k-1$, so only odd terms survive: $$ \frac\pi2 = 2\sum_{k=1}^\infty\frac{(-1)^{k+1}}{2k-1} \quad\Longrightarrow\quad \boxed{\frac\pi4 = 1-\frac13+\frac15-\frac17+\cdots} $$ the Leibniz formula for $\pi$.
Part 4° · The sum
$$ \boxed{\sum_{n=1}^\infty\frac{(-1)^{n-1}}{2n-1} = \frac\pi4} $$
Summary Table
| Property | Value |
|---|---|
| Fourier series | $x=\sum\frac{2(-1)^{n+1}}n\sin(nx)$ |
| Converges to $f(x)$ | for all $x\in(-\pi,\pi)$; to $0$ at $x=\pm\pi$ |
| Leibniz series | $\pi/4=1-1/3+1/5-1/7+\cdots$ |
Additional Notes
- This is the same coefficient pattern that appears (integrated once) in Problem 327's expansion of $(\pi-x)/2$, and (integrated twice) in Problem 326's expansion of $x^2$ — differentiating or integrating a Fourier series term by term links these three problems directly.
- The Leibniz series converges extremely slowly (error $\sim1/N$), in sharp contrast to the $\pi^2/8$ and $\pi^2/6$ series from Problems 325–326, which converge like $1/N$ in the tail sum but with much smaller absolute error per term.
- Evaluating the same series at other special points (e.g. $x=\pi/3$) produces further alternating series for $\pi\sqrt3$ and similar constants, by the same substitution technique.