Differential Equations › Section H · Boundary value problems and Fourier series › Topic H.5
Fourier cosine series
When the ends of a rod are insulated instead of held at zero, the natural building blocks are cosines and a constant rather than sines. The cosine series works just like the sine series, with one extra term that carries the average value of the function.
Cosines for insulated ends
In "Eigenvalues and eigenfunctions", the conditions \(y'(0) = 0\) and \(y'(L) = 0\) gave the eigenfunctions \(\cos\frac{n\pi x}{L}\) for \(n = 0, 1, 2, \dots\), including the constant 1 at \(n = 0\). A rod with insulated ends therefore needs its initial temperature written as a sum of these. The Fourier cosine series of \(f\) on \([0, L]\) is
It is the cosine counterpart of the sine series from "Fourier sine series", and the same orthogonality argument produces its coefficients.
The coefficient formulas
Multiply the series by \(\cos\frac{m\pi x}{L}\) and integrate over \([0, L]\). Orthogonality leaves one term. For \(m \ge 1\) its squared norm is \(\frac{L}{2}\), while the constant 1 has squared norm \(L\). Writing the constant term as \(\frac{a_0}{2}\) absorbs that difference, so a single formula covers every coefficient:
The constant term \(\frac{a_0}{2} = \frac{1}{L}\int_0^L f(x)\,dx\) is the average value of \(f\). This matches the \(\frac{a_0}{2}\) convention of "Applications of inner product spaces". Some books write the constant as \(A_0\), defined directly as the average; the series is the same.
Even functions and the even extension
Every cosine is even and has period \(2L\), so a cosine series is an even, \(2L\)-periodic function. If \(f\) is even on \([-L, L]\), its full Fourier series reduces to this cosine series. For \(f\) given on \([0, L]\), the series represents the even extension
repeated every \(2L\). Reflecting a graph in the \(y\)-axis never creates a gap, so if \(f\) is continuous on \([0, L]\), its periodic even extension is continuous everywhere, although it may have corners at the joins. That is a big advantage over the odd extension.
Worked example: a ramp
Find the cosine series of \(f(x) = x\) on \([0, L]\). 1. Constant: \(a_0 = \frac{2}{L}\int_0^L x\,dx = L\), so \(\frac{a_0}{2} = \frac{L}{2}\), the average. 2. By parts,
3. So \(a_n = \frac{2L((-1)^n - 1)}{n^2\pi^2}\): zero for even \(n\), \(-\frac{4L}{n^2\pi^2}\) for odd \(n\). 4. The series is
5. Check at \(x = 0\): the constant and three cosine terms give about \(0.033L\), close to \(f(0) = 0\). The even extension is a triangle wave.
Worked example: a sine as cosines
Find the cosine series of \(f(x) = \sin x\) on \([0, \pi]\). 1. \(a_0 = \frac{2}{\pi}\int_0^\pi \sin x\,dx = \frac{4}{\pi}\), so the average is \(\frac{2}{\pi}\). 2. For \(n = 1\), \(\int_0^\pi \sin x\cos x\,dx = 0\), so \(a_1 = 0\). Treat it separately, because the general formula divides by \(n^2 - 1\). 3. For \(n \ge 2\), product-to-sum gives \(a_n = \frac{2(1 + (-1)^n)}{\pi(1 - n^2)}\): zero for odd \(n\), \(-\frac{4}{\pi(n^2 - 1)}\) for even \(n\). 4. So
5. Check at \(x = \frac{\pi}{2}\): these terms give about 1.013, near \(\sin\frac{\pi}{2} = 1\). The even extension is \(|\sin x|\).
Worked example: a half-hot rod
Let \(f(x) = 1\) for \(0 \le x < \frac{L}{2}\) and \(f(x) = 0\) for \(\frac{L}{2} \le x \le L\). 1. \(a_0 = \frac{2}{L} \cdot \frac{L}{2} = 1\), so the average is \(\frac{1}{2}\). 2. For \(n \ge 1\), integrate only over the hot half:
3. The values of \(\sin\frac{n\pi}{2}\) run \(1, 0, -1, 0, \dots\), so
4. Check at \(x = 0\): the constant and first cosine give \(0.5 + 0.637 \approx 1.14\), the next term brings it to about 0.92, and later terms swing ever closer to \(f(0) = 1\).
Applied example: an insulated rod
Suppose the rod of the last example has insulated ends and sides, no heat source and constant diffusivity \(k\), and starts with one half hot and the other cold. Each cosine mode decays like \(e^{-k(n\pi/L)^2t}\), but the \(n = 0\) mode has eigenvalue 0 and never decays. So
as time passes. The rod settles at the average of its initial temperature, here half the hot value. Physically, no heat escapes through insulated ends, so the total heat stays fixed and simply spreads out evenly.
Sine or cosine?
On \([0, L]\) any reasonable function has both a sine series and a cosine series, and on \((0, L)\) both represent it. Two things decide which to use. The first is the physics: zero values at the ends call for sines, zero slopes for cosines. The second is efficiency. For \(f(x) = x\), the sine coefficients fall like \(\frac{1}{n}\) because the odd extension jumps at \(x = \pm L\), while the cosine coefficients fall like \(\frac{1}{n^2}\) because the even extension is continuous. When nothing else decides, the series whose extension is smoother needs fewer terms.
Common mistakes to avoid
First, using \(a_0\) rather than \(\frac{a_0}{2}\) as the constant term, which doubles the average. Second, using \(\frac{1}{L}\) in front of the integral for \(a_n\) with \(n \ge 1\); on \([0, L]\) it is \(\frac{2}{L}\). Third, applying a general formula at a value of \(n\) where it divides by zero, as with \(n = 1\) for \(\sin x\). Fourth, confusing \(\cos\frac{n\pi}{2}\) with \(\sin\frac{n\pi}{2}\) in step-function problems. Fifth, sketching the odd extension when the cosine series represents the even one.
Key takeaways
The Fourier cosine series of \(f\) on \([0, L]\) is \(\frac{a_0}{2} + \sum a_n\cos\frac{n\pi x}{L}\) with \(a_n = \frac{2}{L}\int_0^L f(x)\cos\frac{n\pi x}{L}\,dx\) for all \(n \ge 0\); the constant term is the average of \(f\). It represents the even \(2L\)-periodic extension, which is continuous whenever \(f\) is. The ramp \(x\) gives \(-\frac{4L}{n^2\pi^2}\) on odd \(n\), so its cosine series converges faster than its sine series. In an insulated rod, every cosine mode decays except the constant, so the temperature tends to the average.
Flashcards
Flashcard
f(x) = a₀/2 + Σ aₙ cos(nπx/L) on [0, L]
Test your understanding
Question 1 of 5
What is the constant term a₀/2 of the cosine series of f(x) = x² on [0, 3]?
Question 2 of 5
What is a₁ in the cosine series of f(x) = x on [0, π]?
Question 3 of 5
The cosine series of f(x) = 2x + 1 on [0, 2] represents which value at x = −1?
Question 4 of 5
A rod on [0, 4] with insulated ends starts at temperature 20 + 10x. What temperature does it approach over time?
Question 5 of 5
Why do the cosine coefficients of f(x) = x on [0, L] shrink like 1/n² while its sine coefficients shrink like 1/n?
