Skip to main content
Mathematics LibreTexts

5.3: Fourier Series Over Other Intervals

  • Page ID
    106228
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    In many applications we are interested in determining Fourier series representations of functions defined on intervals other than \([0,2 \pi]\). In this section we will determine the form of the series expansion and the Fourier coefficients in these cases.

    The most general type of interval is given as \([a, b]\). However, this often is too general. More common intervals are of the form \([-\pi, \pi],[0, L]\), or \([-L / 2, L / 2]\). The simplest generalization is to the interval \([0, L]\). Such intervals arise often in applications. For example, one can study vibrations of a one dimensional string of length \(L\) and set up the axes with the left end at \(x=0\) and the right end at \(x=L\). Another problem would be to study the temperature distribution along a one dimensional rod of length \(L\). Such problems lead to the original studies of Fourier series. As we will see later, symmetric intervals, \([-a, a]\), are also useful.

    Given an interval \([0, L]\), we could apply a transformation to an interval of length \(2 \pi\) by simply rescaling our interval. Then we could apply this transformation to our Fourier series representation to obtain an equivalent one useful for functions defined on \([0, L]\).

    We define \(x \in[0,2 \pi]\) and \(t \in[0, L]\). A linear transformation relating these intervals is simply \(x=\dfrac{2 \pi t}{L}\) as shown in Figure 5.5. So, \(t=0\) maps to \(x=0\) and \(t=L\) maps to \(x=2 \pi\). Furthermore, this transformation maps \(f(x)\) to a new function \(g(t)=f(x(t))\), which is defined on \([0, L]\). We will determine the Fourier series representation of this function using the representation for \(f(x)\).

    Screen Shot 2022-07-05 at 11.27.10 AM.png
    Figure 5.5. A sketch of the transformation between intervals \(x \in[0,2 \pi]\) and \(t \in[0, L]\).

    Recall the form of the Fourier representation for \(f(x)\) in Equation (5.1):

    \[f(x) \sim \dfrac{a_{0}}{2}+\sum_{n=1}^{\infty}\left[a_{n} \cos n x+b_{n} \sin n x\right] . \label{5.23} \]

    Inserting the transformation relating \(x\) and \(t\), we have

    \[g(t) \sim \dfrac{a_{0}}{2}+\sum_{n=1}^{\infty}\left[a_{n} \cos \dfrac{2 n \pi t}{L}+b_{n} \sin \dfrac{2 n \pi t}{L}\right] . \label{5.24} \]

    This gives the form of the series expansion for \(g(t)\) with \(t \in[0, L]\). But, we still need to determine the Fourier coefficients.

    Recall, that

    \[a_{n}=\dfrac{1}{\pi} \int_{0}^{2 \pi} f(x) \cos n x d x \nonumber \]

    We need to make a substitution in the integral of \(x=\dfrac{2 \pi t}{L}\). We also will need to transform the differential, \(d x=\dfrac{2 \pi}{L} d t\). Thus, the resulting form for our coefficient is

    \[a_{n}=\dfrac{2}{L} \int_{0}^{L} g(t) \cos \dfrac{2 n \pi t}{L} d t \label{5.25} \]

    Similarly, we find that

    \[b_{n}=\dfrac{2}{L} \int_{0}^{L} g(t) \sin \dfrac{2 n \pi t}{L} d t \label{5.26} \]

    We note first that when \(L=2 \pi\) we get back the series representation that we first studied. Also, the period of \(\cos \dfrac{2 n \pi t}{L}\) is \(L / n\), which means that the representation for \(g(t)\) has a period of \(L\).

    At the end of this section we present the derivation of the Fourier series representation for a general interval for the interested reader. In Table 5.1 we summarize some commonly used Fourier series representations.

    We will end our discussion for now with some special cases and an example for a function defined on \([-\pi, \pi]\).

    Example 5.7. Let \(f(x)=|x|\) on \([-\pi, \pi]\) We compute the coefficients, beginning as usual with \(a_{0}\). We have

    \[\begin{aligned}
    a_{0} &=\dfrac{1}{\pi} \int_{-\pi}^{\pi}|x| d x \\
    &=\dfrac{2}{\pi} \int_{0}^{\pi}|x| d x=\pi
    \end{aligned} \label{5.33} \]

    At this point we need to remind the reader about the integration of even and odd functions.

    1. Even Functions: In this evaluation we made use of the fact that the integrand is an even function. Recall that \(f(x)\) is an even function if \(f(-x)=f(x)\) for all \(x\). One can recognize even functions as they are symmetric with respect to the \(y\)-axis as shown in Figure 5.6(A). If one integrates an even function over a symmetric interval, then one has that

    \[\int_{-a}^{a} f(x) d x=2 \int_{0}^{a} f(x) d x \label{5.34} \]

    One can prove this by splitting off the integration over negative values of \(x\), using the substitution \(x=-y\), and employing the evenness of \(f(x)\). Thus,

    Fourier Series on \([0, L]\)

    \[f(x) \sim \dfrac{a_{0}}{2}+\sum_{n=1}^{\infty}\left[a_{n} \cos \dfrac{2 n \pi x}{L}+b_{n} \sin \dfrac{2 n \pi x}{L}\right] \label{5.27} \]

    \[\begin{aligned}
    a_{n} &=\dfrac{2}{L} \int_{0}^{L} f(x) \cos \dfrac{2 n \pi x}{L} d x . \quad n=0,1,2, \ldots \\
    b_{n} &=\dfrac{2}{L} \int_{0}^{L} f(x) \sin \dfrac{2 n \pi x}{L} d x . \quad n=1,2, \ldots
    \end{aligned} \label{5.28} \]

    Fourier Series on \(\left[-\dfrac{L}{2}, \dfrac{L}{2}\right]\)

    \[f(x) \sim \dfrac{a_{0}}{2}+\sum_{n=1}^{\infty}\left[a_{n} \cos \dfrac{2 n \pi x}{L}+b_{n} \sin \dfrac{2 n \pi x}{L}\right] \label{5.29} \]

    \[\begin{aligned}
    a_{n} &=\dfrac{2}{L} \int_{-\dfrac{L}{2}}^{\dfrac{L}{2}} f(x) \cos \dfrac{2 n \pi x}{L} d x . \quad n=0,1,2, \ldots \\
    b_{n} &=\dfrac{2}{L} \int_{-\dfrac{L}{2}}^{\dfrac{L}{2}} f(x) \sin \dfrac{2 n \pi x}{L} d x . \quad n=1,2, \ldots
    \end{aligned} \label{5.30} \]

    Fourier Series on \([-\pi, \pi]\)

    \[f(x) \sim \dfrac{a_{0}}{2}+\sum_{n=1}^{\infty}\left[a_{n} \cos n x+b_{n} \sin n x\right] \label{5.31} \]

    \[\begin{gathered}
    a_{n}=\dfrac{1}{\pi} \int_{-\pi}^{\pi} f(x) \cos n x d x . \quad n=0,1,2, \ldots, \\
    b_{n}=\dfrac{1}{\pi} \int_{-\pi}^{\pi} f(x) \sin n x d x . \quad n=1,2, \ldots
    \end{gathered} \label{5.32} \]

    Table 5.1. Special Fourier Series Representations on Different Intervals

    \[\begin{aligned}
    \int_{-a}^{a} f(x) d x &=\int_{-a}^{0} f(x) d x+\int_{0}^{a} f(x) d x \\
    &=-\int_{a}^{0} f(-y) d y+\int_{0}^{a} f(x) d x \\
    &=\int_{0}^{a} f(y) d y+\int_{0}^{a} f(x) d x \\
    &=2 \int_{0}^{a} f(x) d x
    \end{aligned} \label{5.35} \]

    This can be visually verified by looking at Figure \(5.6(\mathrm{~A})\).

    2. Odd Functions: A similar computation could be done for odd functions. \(f(x)\) is an odd function if \(f(-x)=-f(x)\) for all \(x\). The graphs of such functions are symmetric with respect to the origin as shown in Figure \(5.6(\mathrm{~B})\). If one integrates an odd function over a symmetric interval, then one has that

    \[\int_{-a}^{a} f(x) d x=0 \label{5.36} \]

    Screen Shot 2022-07-05 at 11.41.44 AM.png
    Figure 5.6. Examples of the areas under (A) even and (B) odd functions on symmetric intervals, \([-a, a]\)

    We now continue with our computation of the Fourier coefficients for \(f(x)=|x|\) on \([-\pi, \pi]\). We have

    \[a_{n}=\dfrac{1}{\pi} \int_{-\pi}^{\pi}|x| \cos n x d x=\dfrac{2}{\pi} \int_{0}^{\pi} x \cos n x d x \label{5.37} \]

    Here we have made use of the fact that \(|x| \cos n x\) is an even function. In order to compute the resulting integral, we need to use integration by parts,

    \[\int_{a}^{b} u d v=\left.u v\right|_{a} ^{b}-\int_{a}^{b} v d u \nonumber \]

    by letting \(u=x\) and \(d v=\cos n x d x\). Thus, \(d u=d x\) and \(v=\int d v=\dfrac{1}{n} \sin n x\).

    Continuing with the computation, we have

    \[\begin{aligned}
    a_{n} &=\dfrac{2}{\pi} \int_{0}^{\pi} x \cos n x d x \\
    &=\dfrac{2}{\pi}\left[\left.\dfrac{1}{n} x \sin n x\right|_{0} ^{\pi}-\dfrac{1}{n} \int_{0}^{\pi} \sin n x d x\right] \\
    &=-\dfrac{2}{n \pi}\left[-\dfrac{1}{n} \cos n x\right]_{0}^{\pi} \\
    &=-\dfrac{2}{\pi n^{2}}\left(1-(-1)^{n}\right)
    \end{aligned} \label{5.38} \]

    Here we have used the fact that \(\cos n \pi=(-1)^{n}\) for any integer \(n\). This lead to a factor \(\left(1-(-1)^{n}\right)\). This factor can be simplified as

    \[1-(-1)^{n}=\left\{\begin{array}{l}
    2, n \text { odd } \\
    0, n \text { even }
    \end{array} .\right. \label{5.39} \]

    So, \(a_{n}=0\) for \(n\) even and \(a_{n}=-\dfrac{4}{\pi n^{2}}\) for \(n\) odd.
    Computing the \(b_{n}\)'s is simpler. We note that we have to integrate \(|x| \sin n x\) from \(x=-\pi\) to \(\pi\). The integrand is an odd function and this is a symmetric interval. So, the result is that \(b_{n}=0\) for all \(n\).

    Putting this all together, the Fourier series representation of \(f(x)=|x|\) on \([-\pi, \pi]\) is given as

    \[f(x) \sim \dfrac{\pi}{2}-\dfrac{4}{\pi} \sum_{n=1, \text { odd }}^{\infty} \dfrac{\cos n x}{n^{2}} \label{5.40} \]

    While this is correct, we can rewrite the sum over only odd \(n\) by reindexing. We let \(n=2 k-1\) for \(k=1,2,3, \ldots\). Then we only get the odd integers. The series can then be written as

    \[f(x) \sim \dfrac{\pi}{2}-\dfrac{4}{\pi} \sum_{k=1}^{\infty} \dfrac{\cos (2 k-1) x}{(2 k-1)^{2}}. \label{5.41} \]

    Throughout our discussion we have referred to such results as Fourier representations. We have not looked at the convergence of these series. Here is an example of an infinite series of functions. What does this series sum to? We show in Figure 5.7 the first few partial sums. They appear to be converging to \(f(x)=|x|\) fairly quickly.

    Screen Shot 2022-07-05 at 11.57.55 AM.png
    Figure 5.7. Plot of the first partial sums of the Fourier series representation for \(f(x) = |x|\).

    Even though \(f(x)\) was defined on \([-\pi, \pi]\) we can still evaluate the Fourier series at values of \(x\) outside this interval. In Figure 5.8, we see that the representation agrees with \(f(x)\) on the interval \([-\pi, \pi]\). Outside this interval we have a periodic extension of \(f(x)\) with period \(2 \pi\).

    Screen Shot 2022-07-05 at 11.58.48 AM.png
    Figure 5.8. Plot of the first 10 terms of the Fourier series representation for \(f(x) = |x|\) on the interval \([−2\pi, 4\pi]\).

    Another example is the Fourier series representation of \(f(x)=x\) on \([-\pi, \pi]\) as left for Problem 5.1. This is determined to be

    \[f(x) \sim 2 \sum_{n=1}^{\infty} \dfrac{(-1)^{n+1}}{n} \sin n x . \label{5.42} \]

    As seen in Figure 5.9 we again obtain the periodic extension of our function. In this case we needed many more terms. Also, the vertical parts of the first plot are nonexistent. In the second plot we only plot the points and not the typical connected points that most software packages plot as the default style.

    Screen Shot 2022-07-05 at 12.01.28 PM.png
    Figure 5.9. Plot of the first 10 terms and 200 terms of the Fourier series representation for \(f(x)=x\) on the interval \([-2 \pi, 4 \pi]\)
    Example \(\PageIndex{1}\)

    Example 5.8. It is interesting to note that one can use Fourier series to obtain sums of some infinite series. For example, in the last example we found that

    \[x \sim 2 \sum_{n=1}^{\infty} \dfrac{(-1)^{n+1}}{n} \sin n x. \nonumber \]

    Now, what if we chose \(x=\dfrac{\pi}{2}\)? Then, we have

    \[\dfrac{\pi}{2}=2 \sum_{n=1}^{\infty} \dfrac{(-1)^{n+1}}{n} \sin \dfrac{n \pi}{2}=2\left[1-\dfrac{1}{3}+\dfrac{1}{5}-\dfrac{1}{7}+\ldots\right] \nonumber \]

    This gives a well known expression for \(\pi\):

    \[\pi=4\left[1-\dfrac{1}{3}+\dfrac{1}{5}-\dfrac{1}{7}+\ldots\right] \nonumber \]

    5.3.1 Fourier Series on \([a, b]\)

    A Fourier series representation is also possible for a general interval, \(t \in[a, b]\). As before, we just need to transform this interval to \([0,2 \pi]\). Let

    \[x=2 \pi \dfrac{t-a}{b-a}. \nonumber \]

    Inserting this into the Fourier series (5.1) representation for \(f(x)\) we obtain

    \[g(t) \sim \dfrac{a_{0}}{2}+\sum_{n=1}^{\infty}\left[a_{n} \cos \dfrac{2 n \pi(t-a)}{b-a}+b_{n} \sin \dfrac{2 n \pi(t-a)}{b-a}\right] \label{5.43} \]

    Well, this expansion is ugly. It is not like the last example, where the transformation was straightforward. If one were to apply the theory to applications, it might seem to make sense to just shift the data so that \(a=0\) and be done with any complicated expressions. However, mathematics students enjoy the challenge of developing such generalized expressions. So, let's see what is involved.

    First, we apply the addition identities for trigonometric functions and rearrange the terms.

    \[\begin{aligned}
    g(t) \sim & \dfrac{a_{0}}{2}+\sum_{n=1}^{\infty}\left[a_{n} \cos \dfrac{2 n \pi(t-a)}{b-a}+b_{n} \sin \dfrac{2 n \pi(t-a)}{b-a}\right] \\
    =& \dfrac{a_{0}}{2}+\sum_{n=1}^{\infty}\left[a_{n}\left(\cos \dfrac{2 n \pi t}{b-a} \cos \dfrac{2 n \pi a}{b-a}+\sin \dfrac{2 n \pi t}{b-a} \sin \dfrac{2 n \pi a}{b-a}\right)\right.\\
    &\left.+b_{n}\left(\sin \dfrac{2 n \pi t}{b-a} \cos \dfrac{2 n \pi a}{b-a}-\cos \dfrac{2 n \pi t}{b-a} \sin \dfrac{2 n \pi a}{b-a}\right)\right] \\
    =& \dfrac{a_{0}}{2}+\sum_{n=1}^{\infty}\left[\cos \dfrac{2 n \pi t}{b-a}\left(a_{n} \cos \dfrac{2 n \pi a}{b-a}-b_{n} \sin \dfrac{2 n \pi a}{b-a}\right)\right.\\
    &\left.+\sin \dfrac{2 n \pi t}{b-a}\left(a_{n} \sin \dfrac{2 n \pi a}{b-a}+b_{n} \cos \dfrac{2 n \pi a}{b-a}\right)\right] .
    \end{aligned} \label{5.44} \]

    Defining \(A_{0}=a_{0}\) and

    \[\begin{array}{r}
    A_{n} \equiv a_{n} \cos \dfrac{2 n \pi a}{b-a}-b_{n} \sin \dfrac{2 n \pi a}{b-a} \\
    B_{n} \equiv a_{n} \sin \dfrac{2 n \pi a}{b-a}+b_{n} \cos \dfrac{2 n \pi a}{b-a}
    \end{array} \label{5.45} \]

    we arrive at the more desirable form for the Fourier series representation of a function defined on the interval \([a, b]\).

    \[g(t) \sim \dfrac{A_{0}}{2}+\sum_{n=1}^{\infty}\left[A_{n} \cos \dfrac{2 n \pi t}{b-a}+B_{n} \sin \dfrac{2 n \pi t}{b-a}\right] . \label{5.46} \]

    We next need to find expressions for the Fourier coefficients. We insert the known expressions for \(a_{n}\) and \(b_{n}\) and rearrange. First, we note that under the transformation \(x=2 \pi \dfrac{t-a}{b-a}\) we have

    \[\begin{aligned}
    a_{n} &=\dfrac{1}{\pi} \int_{0}^{2 \pi} f(x) \cos n x d x \\
    &=\dfrac{2}{b-a} \int_{a}^{b} g(t) \cos \dfrac{2 n \pi(t-a)}{b-a} d t
    \end{aligned} \label{5.47} \]

    and

    \[\begin{aligned}
    b_{n} &=\dfrac{1}{\pi} \int_{0}^{2 \pi} f(x) \cos n x d x \\
    &=\dfrac{2}{b-a} \int_{a}^{b} g(t) \sin \dfrac{2 n \pi(t-a)}{b-a} d t
    \end{aligned} \label{5.48} \]

    Then, inserting these integrals in \(A_{n}\), combining integrals and making use of the addition formula for the cosine of the sum of two angles, we obtain

    \[\begin{aligned}
    A_{n} & \equiv a_{n} \cos \dfrac{2 n \pi a}{b-a}-b_{n} \sin \dfrac{2 n \pi a}{b-a} \\
    &=\dfrac{2}{b-a} \int_{a}^{b} g(t)\left[\cos \dfrac{2 n \pi(t-a)}{b-a} \cos \dfrac{2 n \pi a}{b-a}-\sin \dfrac{2 n \pi(t-a)}{b-a} \sin \dfrac{2 n \pi a}{b-a}\right] d t \\
    &=\dfrac{2}{b-a} \int_{a}^{b} g(t) \cos \dfrac{2 n \pi t}{b-a} d t .
    \end{aligned} \label{5.49} \]

    A similar computation gives

    \[B_{n}=\dfrac{2}{b-a} \int_{a}^{b} g(t) \sin \dfrac{2 n \pi t}{b-a} d t . \label{5.50} \]

    Summarizing, we have shown that:

    Theorem 5.9.

    The Fourier series representation of \(f(x)\) defined on \([a, b]\) when it exists, is given by

    \[f(x) \sim \dfrac{a_{0}}{2}+\sum_{n=1}^{\infty}\left[a_{n} \cos \dfrac{2 n \pi x}{b-a}+b_{n} \sin \dfrac{2 n \pi x}{b-a}\right]. \label{5.51} \]

    with Fourier coefficients

    \[\begin{array}{ll}
    a_{n}=\dfrac{2}{b-a} \int_{a}^{b} f(x) \cos \dfrac{2 n \pi x}{b-a} d x . & n=0,1,2, \ldots, \\
    b_{n}=\dfrac{2}{b-a} \int_{a}^{b} f(x) \sin \dfrac{2 n \pi x}{b-a} d x . & n=1,2, \ldots .
    \end{array} \label{5.52} \]


    This page titled 5.3: Fourier Series Over Other Intervals is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Russell Herman via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.