Return to computing page for the first course APMA0330
Return to computing page for the second course APMA0340
Return to computing page for the fourth course APMA0360
Return to Mathematica tutorial for the first course APMA0330
Return to Mathematica tutorial for the second course APMA0340
Return to Mathematica tutorial for the fourth course APMA0360
Return to the main page for the first course APMA0330
Return to the main page for the second course APMA0340
Return to the main page for the fourth course APMA0360
Return to Part V of the course APMA0340
Introduction to Linear Algebra with Mathematica

Preface


Integration of Fourier Series


Theorem 1: If 2π-periodic function f(๐‘ฅ) is an absolutely integrable over (โˆ’ฯ€, π) and specified by the giving Fourier series \[ f(x) \,\sim\, \frac{a_0}{2} + \sum_{n\ge 1} a_n \cos (nx) + b_n \sin (nx) , \] then the integral of ๐‘“(๐‘ฅ) has the Fourier series expansion as \begin{equation} \label{RqInt.1} \int_0^x f(x)\,{\text d}x = \sum_{n\ge 1} \frac{b_n}{n} - \sum_{n\ge 1} \frac{b_n}{n}\,\cos (nx) + \sum_{n\ge 1} \, \frac{a_n - (-1)^{n} a_0 }{n} \, \sin (nx) , \quad -\pi < x < \pi . \end{equation}

Let us define the antiderivative \[ F(x) = \int_0^x \left[ f(x) - \frac{a_0}{2} \right] {\text d}x \] This function is continuous and has an absolutely integrable derivative. In addition, it is 2π-periodic, as evident from \begin{align*} F(x+ 2\pi ) &= \int_0^x \left[ f(x) - \frac{a_0}{2} \right] {\text d}x + \int_x^{x+2\pi} \left[ f(x) - \frac{a_0}{2} \right] {\text d}x \\ &= F(x) + \int_{-\pi}^{\pi} \left[ f(x) - \frac{a_0}{2} \right] {\text d}x \\ &= F(x) + \int_{-\pi}^{\pi} f(x)\,{\text d}x - a_0 \pi = F(x) . \end{align*} It should be mentioned that in the second step of the above expression, the function ๐‘“(๐‘ฅ) is treated as a function of period 2π, which ensured by the assumption of periodicity of ๐‘“(๐‘ฅ). Hence, ๐น(๐‘ฅ) can be expanded into trigonometric series \[ F(x) = \frac{A_0}{2} + \sum_{n\ge 1} A_n \cos (nx) + B_n \sin (nx) , \] where for n ≥ 1, \begin{align*} A_n &= \frac{1}{\pi}\,\int_{-\pi}^{\pi} F(x) \,\cos (nx)\,{\text d} x \\ &= \frac{1}{\pi}\,F(x) \,\frac{\sin (nx)}{n} \,\Big\vert_{x=-\pi}^{x=\pi} - \frac{1}{n\pi}\,\int_{-\pi}^{\pi} \left[ f(x) - \frac{a_0}{2} \right] \sin (nx)\,{\text d}x = - \frac{b_n}{n} , \end{align*} and similarly, \[ B_n = \frac{a_n}{n} . \] Therefore, we have \[ \int_0^x f(x)\,{\text d}x = \frac{a_0}{2}\,x + \frac{A_0}{2} + \sum_{n\ge 1} \frac{-b_n \cos nx + a_n \sin nx}{n} . \] Setting ๐‘ฅ = 0 in this equation, we get \[ \frac{A_0}{2} = \sum_{n\ge 1} \,\frac{b_n}{n} . \]

Corollary 1: If 2π-periodic function f(๐‘ฅ) is an absolutely integrable over (โˆ’ฯ€, π) and its Fourier coefficient 𝑎₀ = 0, then \[ \int_0^x f(x)\,{\text d}x = \sum_{n\ge 1} \,\frac{b_n}{n} + \sum_{n\ge 1}\,\frac{-b_n\,\cos nx + a_n \sin nx}{n} , \] that is, the Fourier coefficients of the integral can be obtained from the term-by-term integration of the series for f(๐‘ฅ).
Note:    If ๐‘“(๐‘ฅ) is absolutely integrable over (−π, π) and
\[ f(x) = \frac{a_0}{2} + \sum_{n\ge 1} a_n \cos (nx) + b_n \sin (nx) , \]
then the integral \( \quad \int_a^b \,f(x)\,{\text d}x \quad \) can be obtained directly from the term-by-term integration of the Fourier series for ๐‘“(๐‘ฅ), that is,
\begin{equation} \label{EqInt.2} \int_a^b \,f(x)\,{\text d}x = \frac{a_0}{2} \left( b-a \right) + \sum_{n=1}^{\infty} \frac{a_n \sin nx - b_n \cos nx}{n}\,\Big\vert_{x=a}^{x=b} , \end{equation}
where 𝑎 and b represent any two points in the interval [−π, π].   ▣

As a matter of fact, even when 𝑎 or b (or both) falls outside of the interval [−π, π], Eq.\eqref{EqInt.2} is still valid because ๐น(๐‘ฅ) is a function of period 2π.

Example 4:    ■

End of Example 4

 

Term-by-term integration of infinite series


In general, an antiderivative of a periodic function is not periodic. For example, f(x) = 1 is periodic (of any period) but its antiderivatives F(x) = x+C are not periodic. The following lemma gives a necessary and sufficient condition for an antiderivative to be periodic.
Lemma 3: Let f(x) be a periodic integrable function of a real variable. The antiderivative F of f defined by
\[ F(x) = \int_0^x f(t)\,{\text d} t \]
is T-periodic if and only if
\[ \int_0^T f(x)\,{\text d}x = 0. \]
Suppose that the integral condition is satisfied. We need to show that the antiderivative is periodic,, F(x + T) = F(x). We have
\[ F(x+T) - F(x) = \int_0^{x+T} f(t)\,{\text d}t - \int_0^{x} f(t)\,{\text d}t = \int_x^{x+T} f(t)\,{\text d}t = \int_0^{T} f(t)\,{\text d}t = 0. \]
Conversely, if the antiderivative is T-periodic, then
\[ F(T) - F(0) = \int_0^{T} f(t)\,{\text d}t \]
This yields the main statement about term-by-term integration of Fourier series.
Theorem 15: Let f(x) be a periodic with period 2π integrable function satisfying condition
\[ \int_0^{2\pi} f(x)\,{\text d}x = 0 \qquad \Longrightarrow \qquad a_0 (f) = 0 . \]
Consider the antiderivative of f defined by \( F(x) = \int_0^x f(t)\,{\text d} t . \) Then the Fourierseries of F is obtained from that of f by termwise integration. That is, if
\[ f(x) \sim \sum_{k\ge 1} a_k \cos kx + b_k \sin nx , \]
then
\[ F(x) = \int_0^x f(t)\,{\text d}t \sim A_0 + \sum_{k\ge 1} \frac{-b_k}{k}\, \cos kx + \frac{a_k}{k}\, \sin nx , \]
where \( \displaystyle A_0 = \sum_{k\ge 1} \frac{b_k}{k} . \)
The antiderivative F is continuous and it is also 2ฯ€-periodic function according to the previous lemma. Since Fโ€ฒ = f is piecewise smooth, then we can apply the previous Theorem aboutdifferentiation of Fourier series. Consider the Fourier series of F:
\[ F(x) = A_0 + \sum_{k\ge 1} A_k \cos (kx) + k\,B_k \sin (kx) . \]
Then its derivative becomes
\[ F'(x) = f(x) = \sum_{k\ge 1} k\. B_k \cos (kx) - k\, \frac{a_k}{k}\,\sin (kx) . \]
Hence,
\[ k\, B_k = a_k , \qquad -k\,A_k = b_k , \qquad k=1,2,3,\kdots . \]
The coefficient A0 can be found by using the initial condition F(0) = 0 and equating it to the value of the Fourier series at the origin.
Corollary 2: If function f(x) has a Fourier series \( S[f] = \frac{1}{2}\,a_0 + \sum_{k\ge 1} a_k \cos kx + b_k \sin kx , \) then
\[ \sum_{k\ge 1} \frac{b_k}{k} = \frac{1}{2\pi} \int_0^{2\pi} f(t)\left( \pi - t \right) {\text d}t . \]
The formula follows from the identity
\[ S^{\ast} {f} = \sum_{\k \ge 1} \left( a_k \sin kx - b_k \cos kx \right) = \frac{1}{\pi} \int_0^{2\pi} f(t)\, \sum_{k\ge 1} \frac{\sin k\left( x-t \right)}{k} \, {\text d}t . \]

Example 22: Let us consider the function f(x) = |x| that has Fourier series

\[ |x| = \frac{\pi}{2} - \frac{4}{\pi} \sum_{k\ge 1} \frac{1}{(2k-1)^2}\,\cos (2k-1)x , \qquad |x| < \pi . \]
Integrate[Abs[x], {x, -Pi, Pi}]/Pi
Pi
Integrate[Abs[x]*Cos[(2*k-1)*x], {x, -Pi, Pi}]/Pi
(1/((-1 + 2 k)^2 \[Pi]))(-1 - 2 Cos[k \[Pi]]^2 - Cos[2 k \[Pi]] + 2 \[Pi] Cos[k \[Pi]] Sin[k \[Pi]] - 4 k \[Pi] Cos[k \[Pi]] Sin[k \[Pi]] + \[Pi] Sin[2 k \[Pi]] - 2 k \[Pi] Sin[2 k \[Pi]])
Integrating both sides, we get
\[ \int_0^x |t|\.{\text d}t = \frac{\pi}{2}\,x - \frac{4}{\pi} \sum_{k\ge 1} \frac{1}{(2k-1)^3}\,\sin (2k-1)x , \qquad |x| < \pi . \]

 

 

 

Return to Mathematica page
Return to the main page (APMA0340)
Return to the Part 1 Matrix Algebra
Return to the Part 2 Linear Systems of Ordinary Differential Equations
Return to the Part 3 Non-linear Systems of Ordinary Differential Equations
Return to the Part 4 Numerical Methods
Return to the Part 5 Fourier Series
Return to the Part 6 Partial Differential Equations
Return to the Part 7 Special Functions