- there exists a finite set \( \{ x_1 , x_2 , \ldots , x_n \} \subset (a, b) \)
such that \( x_1 < x_2 < \cdots < x_n \) and f is continuous on each
interval
\[ \left( a , x_1 \right) , \quad \left( x_k , x_{k+1} \right) , \quad k=1,2,\ldots , n-1, \quad \left( x_n , b \right) ; \]
- all the following one-sided limits exist
\[ \lim_{x\downarrow a} f \left( x \right) , \quad \lim_{x\uparrow x_k} f\left( x \right) , \quad \lim_{x\downarrow x_k} f\left( x \right) ,\quad k=1,2,\ldots , n-1, \quad \lim_{x \uparrow b} f\left( x \right) . \]
- there exists a finite set \( \{ x_1 , x_2 , \ldots , x_n \} \subset (a, b) \)
such that \( x_1 < x_2 < \cdots < x_n \) and f is continuous
and it has a continuous derivative
f' on each interval on each interval
\[ \left( a , x_1 \right) , \quad \left( x_k , x_{k+1} \right) , \quad k=1,2,\ldots , n-1, \quad \left( x_n , b \right) ; \]
- all the following one-sided limits exist
\[ \lim_{x\downarrow a} f \left( x \right) , \quad \lim_{x\uparrow x_k} f\left( x \right) , \quad \lim_{x\downarrow x_k} f\left( x \right) ,\quad k=1,2,\ldots , n-1, \quad \lim_{x \uparrow b} f\left( x \right) . \]
- all the following one-sided limits exist
\[ \lim_{x\downarrow a} f' \left( x \right) , \quad \lim_{x\uparrow x_k} f' \left( x \right) , \quad \lim_{x\downarrow x_k} f' \left( x \right) ,\quad k=1,2,\ldots , n-1, \quad \lim_{x \uparrow b} f' \left( x \right) . \]
Let a and b be real numbers such that a < b, and let f be a function \( f\, : \, (a,b] \mapsto \,\mathbb{R} . \) The function \( F\, : \, \mathbb{R} \mapsto \,\mathbb{R} \) defined by
Let a and b be real numbers such that a < b, and let f be a piecewise continuous function \( f\, : \, (a,b] \mapsto \,\mathbb{R} . \) Let the function \( F\, : \, \mathbb{R} \mapsto \,\mathbb{R} \) be the periodic extension of f. The Fourier periodic extension of f is the following function
Here the expression F(a + 0) means the limit value from the right: \( F(a+0) = \lim_{\epsilon \mapsto 0>0} F(a+\epsilon ) . \) Similarly, \( F(a-0) = \lim_{\epsilon \mapsto 0>0} F(a-\epsilon ) . \) The condition at the point of discontinuity follows from the fact that Fourier series, if it converges at this point, is equal to the average values of left and right limits. Therefore, it does not matter what value f(a) is assigned initially at the point of discontinuity x = a, its Fourier series will define it to be \( \frac{1}{2} \left[ f(a+0) + f(a-0) \right] . \)
In each example below we start with a function defined on an interval, plotted in blue; then we present the periodic extension of this function, plotted in other color; then we present the Fourier expansion of this function, which is a Fourier periodic extension of the given function. The last figure in each example shows in one plot the Fourier expansion and the approximation with the partial sum with 20 terms of the corresponding Fourier series.
Example: Consider the following functions:
- \( f_1 (x) = \mbox{sign}(x)\,: \, (-1,1] \mapsto \, \mathbb{R}) \)
- \( f_2 (x) = x^2 \,: \, (1,3] \mapsto \, \mathbb{R}) \)
We plot its periodic extension:
fbas[x_] := x^2 /; 1 <= x < 3
f[x_] := fbas[Mod[x, 2, 1]]
SetOptions[Plot, ImageSize -> 300];
Plot[f[x], {x, -3, 4}, PlotRange -> {-1.2, 9.2}, AxesLabel -> {"x", "f(x)"}, PlotStyle -> Thickness[0.008]]Since on symmetrical interval \( (-1,1) \) the given function can be written as \( f(x) = (x+2)^2 , \) we find Fourier coefficients and build its Fourier approximation (with 20 terms)a0 = Integrate[(x + 2)^2 , {x, -1, 1}]
an = Integrate[Cos[n*Pi*x]*(x + 2)^2 , {x, -1, 1}, Assumptions -> Element[n, Integers]]
bn = Integrate[Sin[n*Pi*x]*(x + 2)^2 , {x, -1, 1}, Assumptions -> Element[n, Integers]]
fourier[m_] = a0/2 + Sum[((4/n^2/Pi^2)*Cos[n*Pi*x] - (8/n/Pi)*Sin[n*Pi*x])*(-1)^ n, {n, 1, m}]
Plot[{fourier[20], f[x]}, {x, -2, 2}, PlotStyle -> {{Thick, Blue}, {Thick, Orange}}]\[ f_2 (x) = \frac{13}{3} + \sum_{n\ge 1} \left[ \frac{4}{n^2 \pi^2} \, \cos \left( n\pi x \right) - \frac{8}{n\pi} \,\sin \left( n\pi x \right) \right] (-1)^n . \] - \( f_3 (x) = x\,: \, (-1,1] \mapsto \, \mathbb{R}) \)
- \( f_4 (x) = H(x)\,: \, (-1,1] \mapsto \, \mathbb{R}) ,\) where H(x) is the Heaviside function restricted on the finite interval.
- \( f_5 (x) = |x|\,: \, (-1,1] \mapsto \, \mathbb{R}) \)
- \( f_6 (x) = 1-|x|\,: \, (-2,2] \mapsto \, \mathbb{R}) \)
- \( f_7 (x) = \lfloor x \rfloor \,: \, (-2,2] \mapsto \, \mathbb{R}) \)
b = Graphics[{Blue, Thick, Circle[{0, 0}, 0.02]}, AspectRatio -> 1]
Show[a, b]
b = Graphics[{Red, Arrowheads[0.05], Arrow[{{1, 1}, {0, 1}}]}]
c = Graphics[{Red, Thick, Circle[{0, 0}, 0.05]}, AspectRatio -> 1/2]
b2 = Graphics[{Red, Arrowheads[0.05], Arrow[{{3, 1}, {2, 1}}]}]
a1 = Graphics[{Red, Arrowheads[0.05], Arrow[{{1, -1}, {2, -1}}]}]
c2 = Graphics[{Red, Thick, Circle[{2, 0}, 0.05]}, AspectRatio -> 1/2]
a3 = Graphics[{Red, Arrowheads[0.05], Arrow[{{3, -1}, {4, -1}}]}]
ac = Graphics[{Red, Thick, Circle[{-1, -1}, 0.05]}, AspectRatio -> 1/2]
ac1 = Graphics[{Red, Thick, Circle[{1, -1}, 0.05]}, AspectRatio -> 1/2]
ac3 = Graphics[{Red, Thick, Circle[{3, -1}, 0.05]}, AspectRatio -> 1/2]
c4 = Graphics[{Red, Thick, Circle[{4, 0}, 0.05]}, AspectRatio -> 1/2]
b4 = Graphics[{Red, Arrowheads[0.05], Arrow[{{5, 1}, {4, 1}}]}]
Show[a, b, c, c2, b2, a1, a3, ac, ac1, ac3, c4, b4]
![]() |
![]() |
fbas[x_] := 1 /; 0 <= x < L
L = 1;
f[x_] := fbas[Mod[x, 2*L, -L]]
SetOptions[Plot, ImageSize -> 300];
Plot[f[x], {x, -3*L, 3*L}, PlotRange -> {-1.2, 1.2}, AxesLabel -> {"x", "f(x)"}, PlotStyle -> Thickness[0.008]]

We plot the periodically extended function over three periods -- that is over [-3L, 3L].
Strictly speaking the vertical lines shown on the graph at the discontinuity are not part of the graph.
In some ways they make it easier to visualize the discontinuous function, but on those days when we are
feeling fussy, so we can exclude
those segments. This is done by an Option for plot called Exclusions. The plot without the vertical
lines is constructed below. The argument of the Option Exclusions is a list of points to be excluded.

A=Plot[f, {x, -5, 5}, PlotStyle -> {Thick, Orange}, AspectRatio -> 2/5]
cm1 = Graphics[{Red, Thick, Disk[{-1, 0}, 0.07]}, AspectRatio -> 1/4]
Show[A, c4, c3, c2, c1, c0, cm1, cm2, cm3, cm4]

We describe periodic extension and its Fourier approximation in the following example.
Example: Consider the piecewise continuous function, defined on the interval \( [-2,2] . \)
Then we calculate its Fourier coefficients:
ak1 = Integrate[1/2*Cos[n*Pi*x/2], {x,-2,0}];
ak2 = Integrate[1/2*x^2 * Cos[n*Pi*x/2], {x,0,2}];
bk1 = Integrate[1/2*Sin[n*Pi*x/2], {x,-2,0}];
bk2 = Integrate[1/2*x^2 * Sin[n*Pi*x/2], {x,0,2}];
ak = FullSimplify[ak1+ak2, Element[n, Integers]]
bk = FullSimplify[bk1+bk2, Element[n, Integers]]
a0 = FullSimplify[1/2* Integrate[1, {x,-2,0}] + 1/2 * Integrate[x^2 , {x,0,2}]]
Out[7]= (8 (-1)^n)/(n^2 \[Pi]^2)
Out[8]= 7/3
Plot[f[x], {x, -5, 5}, PlotStyle -> {Thick, Black}]

Other options to define periodic function:
Out[11]= \[ \left\{ \begin{array}{ll} 1 & \ x<0 \\ x^2 & \ x>0 \\ 0 & \ \mbox{True} \end{array} \right. \]
We define a subroutine that provide periodic extension of a function:

f[x_] = Piecewise[{{1, x < 0}, {x^2, x> 0}}]
f[t_ /; t >= 2] := f[t - 4]; f[t_ /; t < -2] :=f[t + 4]; Plot[f[t], {t, -10, 10}] , PlotStyle -> {Thick}]

g[x_] = f@Mod[x, 4 , -2] (* somehow slow *)
Plot[{f[t], g[t]}, {t, -6, 6}, PlotStyle -> Thick]

g[x_ /;0 <= x <=T] :=x^2 +1;
f[x_] := g[Mod[x, T]]
Plot[f[t], {t, -6, 6}, PlotRange -> {{-5,5}, {-0.1, 8}}, PlotStyle -> Thick]

Example: Consider the following function that we met previously
We can also define the periodic expansion of any function using Mod command. If we need to define a function with period \( 2*\pi , \) we type:
per = periodicExtension[f]
0 True


Complex Form of Fourier Expansion
Examples of Fourier Series
Gibbs Phenomenon
Cesàro Approximation
Even and Odd Functions
Chebyshev expantion
Legendre expansion
Bessel--Fourier Series
Hermite Expansion
Laguerre Expansion
Motivated examples