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


Classical Fourier theory based on Riemann integration allows evaluation of Fourier coefficients for functions that are not absolutely integrable (such as sin(x)/x). Mordern Fourier theory ignores these functions, so it prefers dealing with elemenst from Banach space 𝔏¹ or Hilbert space 𝔏² based on Lebesgue integration.

Fourier Coefficients


Fourier coefficients exist whenever the integrals defining them exist:

\begin{equation} \label{EqEval.1} a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x)\,\cos (nx)\,{\text d}x , \qquad b_n = \frac{1}{\pi} \int_{-\pi}^{\pi} f(x)\,\sin (nx)\,{\text d}x . \end{equation}
Here, for simplicity, we consider periodic functions on interval of length 2π. These formuas, knowd as the Euler--Fourier formulas, are ordinary improper Riemann integrals in the classical theory. Therefore, Fourier coefficients exist if each of these integrals for every integer n converges, possibly conditionally. This is the only requirement in the classical Riemann setting.

A function may fall to be in 𝔏¹([−π, π) and corresponding integrals \eqref{EqEval.1} may still converge. ,

Example 1: Let us consider the function \[ f(x) = \frac{1}{x}\,\sin \left( \frac{1}{x} \right) \quad \mbox{on}\quad (0, \pi ) . \] This function is not absolutely integrable because near the origin f(x) ∼ 1/x. So \[ \int_0^{\pi} \left\vert f(x) \right\vert {\text d} x = \infty . \] Mathematica provides a huge numerical value that indicates its divergence:

NIntegrate[Abs[Sin[1/x]]/x, {x, 0, Pi}]
575.018
Indeed, we need to show that \[ J(\varepsilon ) = \int_0^{\varepsilon} \left\vert \frac{\sin (1/x)}{x} \right\vert = \int_{1/\varepsilon}^{+\infty} \frac{| \sin t |}{t}\,{\text d} t \] diverges. It is well known that \[ \int_1^{\infty} \frac{| \sin t |}{t}\,{\text d} t = \infty , \] because on each interval where |sint| ≥ c > 0 (say around (kπ + π/6, kπ + 5π/6)), you get a contribution ≥ 1/k, and series Σ 1/k diverges. Hence, the absolute value of f is not intewgrable.

But f(x) is integrable, as Mathematica confirms:

NIntegrate[Sin[1/x]/x, {x, 0, Pi}]
1.25427
Now we rigorously show that Fourier coefficients exist for each n. Since the function has one singular point at the origin, we breal the integral into two parts \[ b_n = \frac{1}{\pi} \left( \int_0^{\varepsilon} + \int_{\varepsilon}^{\pi} \right) \frac{\sin (1/x)}{x}\,\sin (nx)\,{\text d}x . \] The only problematic region is x → 0. The second integral is fine. We must analyze \[ I_n (\varepsilon ) = \int_0^{\varepsilon} \frac{\sin (1/x)}{x}\,\sin (nx)\,{\text d}x . \] Let t = 1/x. Then
  • x = 1/t,
  • dt = −dt/t²,
  • as x → 0+0 ⇔ t ↓ 0, t → +∞.
Compute \[ I_n (\varepsilon ) = \int_{1/\varepsilon}^{+\infty} \sin (t)\,\sin \left( \frac{n}{t} \right) \frac{{\text d}t.}{t} . \] This is the key transformation. For large t, \[ \sin \left( \frac{n}{t} \right) \,\sim \,\frac{n}{t} . \] Thus, the integrand behaves like \[ \sin (t) \cdot \frac{n}{t} \cdot \frac{1}{t} = n \,\frac{\sin (t)}{t^2} . \] So near infinity, \[ I_n (\varepsilon ) \,\sim\, n\,\int_{1/\varepsilon}^{+\infty} \frac{\sin (t)}{t^2} \,{\text d}t , \] which converges absolutely because sine function is bounded by 1. We conclude that the Fourier coefficient bₙ exists for every n ≥ 1.

This example shows that the oscillation near the singular point is strong enough to overcome the 1/x blow-up.

This example also show that the given function f(x) = sin(1/x)/x is not in 𝔏¹. Therefore, the classical (based on improper Riemann integration) Fourier theory is wider than modern theory based on Lebesgue integration.

We can expand this function into sine-Fourier series \[ \frac{1}{x}\,\sin \left( \frac{1}{x} \right) = \sum_{n\ge 1} b_n \sin (nx) . \] With Mathematica, we can evaluate several coefficients, numerically. The following figure presents graph of function f(x) in blue, and its 20-term sine0Fourier approximation, in red.

f[x_] = Sin[1/x]/x;
s20 = 2* Sum[ Sin[n*x]*NIntegrate[Sin[1/x]*Sin[n*x]/x, {x, 0, Pi}], {n, 1, 20}]/ Pi;
+ Plot[{f[x], s20}, {x, 0, Pi}, PlotStyle -> {{Thick, Blue}, {Thick, Red}}]
Figure 1.1.

   ■
End of Example 1
A function has Fourier coefficients if: This includes: In Lebesgue theory: So the modern theory is cleaner, but the classical theory is broader.

Example 2: Let us define on (−π, π) the function \[ f(x) = \begin{cases} \frac{\sin (1/x)}{x\,\ln (1/|x|)} , &\quad 0 < |x| < e^{-2} , \\ 0, &\quad e^{-2} \le |x| \le \pi . \end{cases} \] This function is extended in odd way so its Fourier series will contain only sine functions. As usual, f is assumed to be 2π periodic because we extend it into the Fourier series.

The given function is not absolutely integrable because near zero, \[ |f(x)| \,\sim \, \frac{1}{|x|\,\ln (1/|x|)} . \] So \[ \int_0^{1/e^2} |f(x)|\,{\text d}x \ge \int_0^{1/e^2} \frac{{\text d}x}{|x|\,\ln (1/|x|)} . \] Substitude t = ln(1/x), then dx = −e−tdt, and we get \[ \int_0^{1/e^2} |f(x)|\,{\text d}x \ge \int_2^{+\infty} \frac{{\text d}t}{t} = \infty . \] So f ∉ 𝔏¹([−π, π). However, the Fourier sine coefficients exist: \[ b_n = \frac{2}{\pi} \int_0^{\pi} f(x)\,\sin (nx)\,{\text d}x = \frac{2}{\pi} \int_0^{1/e^2} \,\frac{\sin (1/x)}{x\,\ln (1/x)}\,\sin (nx)\,{\text d}x . \] Let t = 1/x, then dx = −dt/t² and ln(1/x) = ln(t). Then \[ b_n = \frac{2}{\pi} \int_{e^2}^{\infty} \frac{\sin t}{\left( 1/t \right) \ln t}\,\sin \left( \frac{n}{t} \right) \frac{{\text d}t}{t^2} = \frac{2}{\pi} \int_{e^2}^{\infty} \frac{\sin t\,\sin (n/t)}{t\,\ln t} \,{\text d}t . \] For large t, \[ \sin \left( \frac{n}{t} \right) \,\sim \,\frac{n}{t} , \] so the integrand behaves like \[ \frac{\sin t}{t\,\ln t} \cdot \frac{n}{t} = n\,\frac{\sin t}{t^2 \ln t} . \] Now \[ \int_{e^2}^{\infty} \left\vert \frac{\sin t}{t^2 \ln t} \right\vert {\text d}t \le \int_{e^2}^{\infty} \frac{{\text d}t}{t^2 \ln t} < \infty . \] Hence, the integral defining bₙ converges absolutely for each n. Thus, all Fourier coefficients exist, even so f ∉ 𝔏¹.

However, the corresponding Fourier series converges very slow because bₙ ∼ 1/lnn (see section).    ■

End of Example 2

Example 3:    ■

End of Example 3

 

 

 

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