# Fourier Series of Functions with an Arbitrary Period

## Fourier Series Expansion on the Interval $$\left[ { - L,L} \right]$$

We assume that the function $$f\left( x \right)$$ is piecewise continuous on the interval $$\left[ { - L,L} \right].$$ Using the substitution $$x = \frac{{Ly}}{\pi }$$ $$\left( { - \pi \le x \le \pi } \right)$$, we can convert it into the function

$F\left( y \right) = f\left( {\frac{{Ly}}{\pi }} \right),$

which is defined and integrable on $$\left[ { - \pi ,\pi } \right].$$ Fourier series expansion of this function $$F\left( y \right)$$ can be written as

$F\left( y \right) = f\left( {\frac{{Ly}}{\pi }} \right) = \frac{{{a_0}}}{2} + \sum\limits_{n = 1}^\infty {\left( {{a_n}\cos ny + {b_n}\sin ny} \right)} .$

The Fourier coefficients for the function are given by

${a_0} = \frac{1}{\pi }\int\limits_{ - \pi }^\pi {F\left( y \right)dy} ,$
${a_n} = \frac{1}{\pi }\int\limits_{ - \pi }^\pi {F\left( y \right)\cos nydy} = \frac{1}{\pi }\int\limits_{ - \pi }^\pi {f\left( {\frac{{Ly}}{\pi }} \right)\cos nydy} ,$
${b_n} = \frac{1}{\pi }\int\limits_{ - \pi }^\pi {F\left( y \right)\sin nydy} = \frac{1}{\pi }\int\limits_{ - \pi }^\pi {f\left( {\frac{{Ly}}{\pi }} \right)\sin nydy} ,\;\; n = 1,2,3, \ldots$

Returning to the initial variables, that is setting $$y = {\frac{{\pi x}}{L}},$$ we obtain the following trigonometric series for $$f\left( x \right):$$

$f\left( x \right) = \frac{{{a_0}}}{2} + \sum\limits_{n = 1}^\infty {\left( {{a_n}\cos \frac{{n\pi x}}{L} + {b_n}\sin\frac{{n\pi x}}{L}} \right)},$

where

${a_0} = \frac{1}{L}\int\limits_{ - L}^L {f\left( x \right)dx} ,\;\; {a_n} = \frac{1}{L}\int\limits_{ - L}^L {f\left( x \right)\cos \frac{{n\pi x}}{L}dx} ,\;\; {b_n} = \frac{1}{L}\int\limits_{ - L}^L {f\left( x \right)\sin\frac{{n\pi x}}{L}dx} .$

## Fourier Series Expansion on the Interval $$\left[ { a,b} \right]$$

If the function $$f\left( x \right)$$ is defined on the interval $$\left[ { a,b} \right],$$ then its Fourier series representation is given by the same formula

$f\left( x \right) = \frac{{{a_0}}}{2} + \sum\limits_{n = 1}^\infty {\left( {{a_n}\cos \frac{{n\pi x}}{L} + {b_n}\sin\frac{{n\pi x}}{L}} \right)},$

where $$L = \frac{{b - a}}{2}$$ and Fourier coefficients are calculated as follows:

${a_0} = \frac{1}{L}\int\limits_{ - L}^L {f\left( x \right)dx} ,\;\; {a_n} = \frac{1}{L}\int\limits_{ - L}^L {f\left( x \right)\cos \frac{{n\pi x}}{L}dx} ,\;\; {b_n} = \frac{1}{L}\int\limits_{ - L}^L {f\left( x \right)\sin\frac{{n\pi x}}{L}dx} ,\;\; n = 1,2,3, \ldots$

## Even and Odd Functions

The Fourier series expansion of an even function, defined on the interval $$\left[ { - L,L} \right]$$ has the form:

$f\left( x \right) = \frac{{{a_0}}}{2} + \sum\limits_{n = 1}^\infty {{a_n}\cos \frac{{n\pi x}}{L}} ,$

where

${a_0} = \frac{2}{L}\int\limits_0^L {f\left( x \right)dx} ,\;\; {a_n} = \frac{2}{L}\int\limits_0^L {f\left( x \right)\cos \frac{{n\pi x}}{L}dx}.$

The Fourier series expansion of an odd function defined on the interval $$\left[ { - L,L} \right]$$ is expressed by the formula

$f\left( x \right) = \sum\limits_{n = 1}^\infty {{b_n}\sin\frac{{n\pi x}}{L}} ,$

where the Fourier coefficients are

${b_n} = \frac{2}{L}\int\limits_0^L {f\left( x \right)\sin\frac{{n\pi x}}{L}dx} .$

## Solved Problems

Click or tap a problem to see the solution.

### Example 1

Find the Fourier series of the function

${f\left( x \right) }= {\begin{cases} A, & 0 \le x \le L \\ 0, & L \lt x \le 2L \end{cases}.}$

### Example 2

Find the Fourier series of the function:

${f\left( x \right) }= {\begin{cases} 0, & -1 \le x \le 0 \\ x, & 0 \lt x \le 1 \end{cases}.}$

### Example 1.

Find the Fourier series of the function

${f\left( x \right) }= {\begin{cases} A, & 0 \le x \le L \\ 0, & L \lt x \le 2L \end{cases}.}$

Solution.

Determine the Fourier coefficients:

${a_0} = \frac{1}{L}\int\limits_a^b {f\left( x \right)dx} = \frac{1}{L}\int\limits_0^L {Adx} = A,$
${a_n} = \frac{1}{L}\int\limits_a^b {f\left( x \right)\cos \frac{{n\pi x}}{L}dx} = \frac{1}{L}\int\limits_a^b {A\cos \frac{{n\pi x}}{L}dx} = \frac{A}{L}\left[ {\left. {\left( {\frac{L}{{n\pi }}\sin\frac{{n\pi x}}{L}} \right)} \right|_0^L} \right] = \frac{A}{{n\pi }}\left( {\sin n\pi - \sin 0} \right) = 0,$
${b_n} = \frac{1}{L}\int\limits_a^b {f\left( x \right)\sin\frac{{n\pi x}}{L}dx} = \frac{1}{L}\int\limits_a^b {A\sin \frac{{n\pi x}}{L}dx} = \frac{A}{L}\left[ {\left. {\left( { - \frac{L}{{n\pi }}\cos\frac{{n\pi x}}{L}} \right)} \right|_0^L} \right] = \frac{A}{{n\pi }}\left[ { - \cos n\pi + \cos 0} \right] = \frac{A}{{n\pi }}\left[ {1 - {{\left( { - 1} \right)}^n}} \right] = \frac{A}{{n\pi }}\left[ {1 + {{\left( { - 1} \right)}^{n + 1}}} \right].$

One can notice that for even $$n = 2k,$$ $$k = 1,2,3, \ldots$$

${b_{2k}} = \frac{A}{{2k\pi }}\left[ {1 + {{\left( { - 1} \right)}^{2k + 1}}} \right] = 0.$

For odd $$n = 2k - 1,$$ $$k = 1,2,3, \ldots$$

${b_{2k - 1}} = \frac{A}{{\left( {2k - 1} \right)\pi }}\left[ {1 + {{\left( { - 1} \right)}^{2k}}} \right] = \frac{{2A}}{{\left( {2k - 1} \right)\pi }}.$

Hence, the Fourier series expansion of the given function (Figure $$1$$) is

$f\left( x \right) = \frac{A}{2} + \frac{{2A}}{\pi }\sum\limits_{k = 1}^\infty {\frac{1}{{2k - 1}}\sin \left( {\frac{{2k - 1}}{L}\pi x} \right)}.$

### Example 2.

Find the Fourier series of the function:

${f\left( x \right) }= {\begin{cases} 0, & -1 \le x \le 0 \\ x, & 0 \lt x \le 1 \end{cases}.}$

Solution.

Here $$L = 1.$$ Then we can write:

${a_0} = \frac{1}{L}\int\limits_a^b {f\left( x \right)dx} = \int\limits_{ - 1}^1 {f\left( x \right)dx} = \int\limits_0^1 {xdx} = \left. {\left( {\frac{{{x^2}}}{2}} \right)} \right|_0^1 = \frac{1}{2}.$

Calculate the coefficients $${a_n}:$$

${a_n} = \frac{1}{L}\int\limits_a^b {f\left( x \right)\cos \frac{{n\pi x}}{L}dx} = \int\limits_0^1 {x\cos \left( {n\pi x} \right)dx} = \left. {\left( {\frac{1}{{n\pi }}x\sin \left( {n\pi x} \right)} \right)} \right|_0^1 - \frac{1}{{n\pi }}\int\limits_0^1 {\sin \left( {n\pi x} \right)dx} = \frac{1}{{n\pi }}\left[ {\left. {\left( {x\sin n\pi x} \right)} \right|_0^1 + \left. {\left( {\frac{{\cos n\pi x}}{{n\pi }}} \right)} \right|_0^1} \right] = \frac{1}{{n\pi }}\left[ {\sin n\pi + \frac{{\cos n\pi }}{{n\pi }} - \frac{1}{{n\pi }}} \right] = \frac{1}{{{n^2}{\pi ^2}}}\left[ {\cos n\pi - 1} \right] = \frac{1}{{{n^2}{\pi ^2}}}\left[ {{{\left( { - 1} \right)}^n} - 1} \right].$

Determine now the coefficients $${b_n}:$$

${b_n} = \frac{1}{L}\int\limits_a^b {f\left( x \right)\sin\frac{{n\pi x}}{L}dx} = \int\limits_0^1 {x\sin \left( {n\pi x} \right)dx} = \left. {\left( { - \frac{1}{{n\pi }}x\cos \left( {n\pi x} \right)} \right)} \right|_0^1 + \frac{1}{{n\pi }}\int\limits_0^1 {\cos\left( {n\pi x} \right)dx} = \frac{1}{{n\pi }}\left[ {\left. { - \left( {x\cos n\pi x} \right)} \right|_0^1 + \left. {\left( {\frac{{\sin n\pi x}}{{n\pi }}} \right)} \right|_0^1} \right] = \frac{1}{{n\pi }}\left[ { - \cos n\pi + \frac{{\sin n\pi }}{{n\pi }}} \right] = \frac{{{{\left( { - 1} \right)}^{n + 1}}}}{{n\pi }}.$

As a result, we obtain (Figure $$2$$):

$f\left( x \right) = \frac{1}{4} + \sum\limits_{n = 1}^\infty {\left[ {\frac{{\left( {{{\left( { - 1} \right)}^n} - 1} \right)}}{{{n^2}{\pi ^2}}}\cos n\pi x + \frac{{{{\left( { - 1} \right)}^{n + 1}}}}{{n\pi }}\sin n\pi x} \right]} .$