2.1 HW 1

  2.1.1 Section 5, Problem 3
  2.1.2 Section 5, Problem 5
  2.1.3 Section 7, Problem 1
  2.1.4 Chapter 1, Section 7, Problem 3
  2.1.5 Section 7, Problem 4
  2.1.6 Chapter 1, Section 8, Problem 1
  2.1.7 Chapter 1, Section 8, Problem 6
PDF (letter size)
PDF (legal size)

2.1.1 Section 5, Problem 3

   Part a
   Part b

Problem Find (a) the Fourier cosine series and (b) the Fourier sine series on the interval \(0<x<\pi \) for \(f\left ( x\right ) =x^{2}\)

Solution

Part a

The function \(x^{2}\) over \(0<x<\pi \) is

pict
Figure 2.1:Original function

The first step is to do an even extension of \(x^{2}\) from \(0<x<\pi \) to \(-\pi <x<\pi \,\) which means its period becomes \(T=2\pi \). The even extension of \(f\left ( x\right ) \) is given by

\[ f_{e}\left ( x\right ) =\left \{ \begin{array} [c]{ccc}f\left ( x\right ) & & x>0\\ f\left ( -x\right ) & & x<0 \end{array} \right . \]

pict
Figure 2.2:Even extension of original function

The next step is to make the above function periodic with period \(T=2\pi \,\) by repeating it each \(2\pi \) as shown below

pict
Figure 2.3:Even extension of original function

Now that we have a periodic function above with period \(T=2\pi \) then we can find its Fourier cosine series. Which is just the cosine series part of its Fourier series given by\[ f\left ( x\right ) \sim \frac{a_{0}}{2}+\sum _{n=1}^{\infty }a_{n}\cos \left ( \frac{2\pi }{T}nx\right ) \] Since \(T=2\pi \), the above becomes\begin{equation} f\left ( x\right ) \sim \frac{a_{0}}{2}+\sum _{n=1}^{\infty }a_{n}\cos \left ( nx\right ) \tag{1} \end{equation} Where \begin{align*} a_{0} & =\frac{1}{\left ( \frac{T}{2}\right ) }\int _{-\frac{T}{2}}^{\frac{T}{2}}f\left ( x\right ) dx\\ & =\frac{2}{2\pi }\int _{-\frac{2\pi }{2}}^{\frac{2\pi }{2}}f\left ( x\right ) dx\\ & =\frac{1}{\pi }\int _{-\pi }^{\pi }f\left ( x\right ) dx \end{align*}

Because \(f\left ( x\right ) \) is an even function (we did an even extension to force this), then the above can be written as\begin{equation} a_{0}=\frac{2}{\pi }\int _{0}^{\pi }f\left ( x\right ) dx=\frac{2}{\pi }\int _{0}^{\pi }x^{2}dx=\frac{2}{\pi }\left ( \frac{x^{3}}{3}\right ) _{0}^{\pi }=\frac{2}{\pi }\left ( \frac{\pi ^{3}}{3}\right ) =\frac{2}{3}\pi ^{2} \tag{2} \end{equation} And for \(n>0\) then

\[ a_{n}=\frac{1}{\left ( \frac{T}{2}\right ) }\int _{-\frac{T}{2}}^{\frac{T}{2}}f\left ( x\right ) \cos \left ( \frac{2\pi }{T}nx\right ) dx \] But \(T=2\pi \) and the above becomes\[ a_{n}=\frac{1}{\pi }\int _{-\pi }^{\pi }f\left ( x\right ) \cos \left ( nx\right ) dx \] But \(f\left ( x\right ) \) is even functiuon and \(\cos \) is even, hence the product is even and the above simplifies to\[ a_{n}=\frac{2}{\pi }\int _{0}^{\pi }x^{2}\cos \left ( nx\right ) dx \] Integration by parts. \(udv=uv-\int vdu\). Let \(u=x^{2},dv=\cos nx\), therefore \(du=2x,v=\frac{\sin nx}{n}\). The above becomes\begin{align*} a_{n} & =\frac{2}{\pi }\left ( \left [ uv\right ] -\int vdu\right ) \\ & =\frac{2}{\pi }\left ( \left [ x^{2}\frac{\sin nx}{n}\right ] _{0}^{\pi }-\int _{0}^{\pi }2x\frac{\sin nx}{n}dx\right ) \end{align*}

Since \(n\) is integer, the term \(\left [ x^{2}\frac{\sin nx}{n}\right ] _{0}^{\pi }\) \(\rightarrow 0\) and the above simplifies to\begin{align*} a_{n} & =\frac{2}{\pi }\left ( -\frac{2}{n}\int _{0}^{\pi }x\sin nxdx\right ) \\ & =\frac{-4}{n\pi }\int _{0}^{\pi }x\sin nxdx \end{align*}

The integral \(\int _{0}^{\pi }x\sin nxdx\) is evaluated by parts again. Let \(u=x,dv=\sin nx\rightarrow du=1,v=-\frac{\cos nx}{n}\) and the above becomes\begin{align} a_{n} & =\frac{-4}{n\pi }\left ( \left [ uv\right ] -\int vdu\right ) \nonumber \\ & =\frac{-4}{n\pi }\left ( -\left [ x\frac{\cos nx}{n}\right ] _{0}^{\pi }+\frac{1}{n}\int _{0}^{\pi }\cos nxdx\right ) \nonumber \\ & =\frac{-4}{n\pi }\left ( -\frac{1}{n}\pi \cos \left ( n\pi \right ) +\frac{1}{n^{2}}\overset{0}{\overbrace{\left [ \sin nx\right ] _{0}^{\pi }}}\right ) \nonumber \\ & =\frac{4}{n^{2}}\cos \left ( n\pi \right ) \nonumber \\ & =\frac{4}{n^{2}}\left ( -1\right ) ^{n} \tag{3} \end{align}

Substituting (2,3) into (1) gives\begin{align*} f\left ( x\right ) & \sim \frac{\frac{2}{3}\pi ^{2}}{2}+\sum _{n=1}^{\infty }\frac{4}{n^{2}}\left ( -1\right ) ^{n}\cos \left ( nx\right ) \\ & =\frac{\pi ^{2}}{3}+4\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{n^{2}}\cos \left ( nx\right ) \end{align*}

The convergence is fast due to the term \(\frac{1}{n^{2}}\). This plot show the approximation as the number of terms increases. After only \(4\) terms we see the approximation is very close to original function \(x^{2}\) shown in dashed lines in the plot below.

pict
Figure 2.4:Fourier approximation as more terms are added
Part b

Because we want to find the Fourier sine series now, then the first step is to do an odd extension of \(x^{2}\) from \(0<x<\pi \) to \(-\pi <x<\pi \,\) which means its period is \(T=2\pi \). Odd extension of \(f\left ( x\right ) \) is given by\[ f_{o}\left ( x\right ) =\left \{ \begin{array} [c]{ccc}f\left ( x\right ) & & x>0\\ -f\left ( -x\right ) & & x<0 \end{array} \right . \]

pict
Figure 2.5:Odd extension of \(x^2\)

The next step is to make the function function periodic with period \(T=2\pi \) by repeating it each \(2\pi \) as follows

pict
Figure 2.6:Making the odd extension periodic

Now that we have a periodic function with period \(T=2\pi \) we can find its Fourier sine series, which is just the sin part of its Fourier series, given by\[ f\left ( x\right ) \sim \sum _{n=1}^{\infty }b_{n}\sin \left ( \frac{2\pi }{T}nx\right ) \] But \(T=2\pi \), and the above becomes\begin{equation} f\left ( x\right ) \sim \sum _{n=1}^{\infty }b_{n}\sin \left ( nx\right ) \tag{1} \end{equation} Where \[ b_{n}=\frac{1}{\left ( \frac{T}{2}\right ) }\int _{-\frac{T}{2}}^{\frac{T}{2}}f\left ( x\right ) \sin \left ( \frac{2\pi }{T}nx\right ) dx \] But \(T=2\pi \), and the above becomes\[ b_{n}=\frac{1}{\pi }\int _{-\pi }^{\pi }f\left ( x\right ) \sin \left ( nx\right ) dx \] But now \(f\left ( x\right ) \) is odd function (we did an odd extension) and \(\sin \) is odd. Hence product is even. Therefore the above simplifies to\begin{align*} b_{n} & =\frac{2}{\pi }\int _{0}^{\pi }f\left ( x\right ) \sin \left ( nx\right ) dx\\ & =\frac{2}{\pi }\int _{0}^{\pi }x^{2}\sin \left ( nx\right ) dx \end{align*}

Integration by parts. \(udv=uv-\int vdu\). Let \(u=x^{2},dv=\sin nx\), therefore \(du=2x,v=\frac{-\cos nx}{n}\). The above becomes\begin{align*} b_{n} & =\frac{2}{\pi }\left ( \left [ uv\right ] -\int vdu\right ) \\ & =\frac{2}{\pi }\left ( -\left [ x^{2}\frac{\cos nx}{n}\right ] _{0}^{\pi }+\int _{0}^{\pi }2x\frac{\cos nx}{n}dx\right ) \\ & =\frac{2}{\pi }\left ( -\frac{1}{n}\left [ \pi ^{2}\cos n\pi \right ] +\frac{2}{n}\int _{0}^{\pi }x\cos nxdx\right ) \\ & =-\frac{2\pi }{n}\cos n\pi +\frac{4}{n\pi }\int _{0}^{\pi }x\cos nxdx \end{align*}

The integral \(\int _{0}^{\pi }x\cos nxdx\) is evaluated by parts again. Let \(u=x,dv=\cos nx\rightarrow du=1,v=\frac{\sin nx}{n}\) and the above becomes\begin{align} b_{n} & =-\frac{2\pi }{n}\cos n\pi +\frac{4}{n\pi }\left ( \left [ uv\right ] -\int vdu\right ) \nonumber \\ & =-\frac{2\pi }{n}\cos n\pi +\frac{4}{n\pi }\left ( \overset{0}{\overbrace{\left [ x\frac{\sin nx}{n}\right ] _{0}^{\pi }}}-\int \frac{\sin nx}{n}dx\right ) \nonumber \\ & =-\frac{2\pi }{n}\cos n\pi -\frac{4}{n^{2}\pi }\int \sin nxdx\nonumber \\ & =-\frac{2\pi }{n}\cos n\pi -\frac{4}{n^{2}\pi }\left [ \frac{-\cos nx}{n}\right ] _{0}^{\pi }\nonumber \\ & =-\frac{2\pi }{n}\cos n\pi +\frac{4}{n^{3}\pi }\left [ \cos nx\right ] _{0}^{\pi }\nonumber \\ & =-\frac{2\pi }{n}\cos n\pi +\frac{4}{n^{3}\pi }\left [ \cos n\pi -1\right ] \nonumber \\ & =-\frac{2\pi }{n}\left ( -1\right ) ^{n}+\frac{4}{n^{3}\pi }\left ( \left ( -1\right ) ^{n}-1\right ) \nonumber \\ & =-\frac{2\pi }{n}\left ( -1\right ) ^{n}-\frac{4}{n^{3}\pi }\left ( 1-\left ( -1\right ) ^{n}\right ) \nonumber \\ & =\frac{2\pi }{n}\left ( -1\right ) ^{n+1}-\frac{4}{n^{3}\pi }\left ( 1-\left ( -1\right ) ^{n}\right ) \tag{2} \end{align}

Substituting (2) into (1) gives\begin{align*} f\left ( x\right ) & \sim \sum _{n=1}^{\infty }\left ( \frac{2\pi }{n}\left ( -1\right ) ^{n+1}-\frac{4}{n^{3}\pi }\left ( 1-\left ( -1\right ) ^{n}\right ) \right ) \sin \left ( nx\right ) \\ & =2\pi ^{2}\sum _{n=1}^{\infty }\left ( \frac{1}{n\pi }\left ( -1\right ) ^{n+1}-\frac{2}{\left ( n\pi \right ) ^{3}}\left ( 1-\left ( -1\right ) ^{n}\right ) \right ) \sin \left ( nx\right ) \end{align*}

In this case, we needed more terms to obtain good convergence. Because the periodic extension is now discontinuous at \(x=n\pi \) where \(n\) is odd. In part (a), the periodic extension was continuous over the whole domain. The following plot shows we needed more terms compared to part (a) to start seeing good convergence. This shows the result for one period from \(-\pi \) to \(\pi \). The blue color is for the original odd extended function and the red color is its Fourier seriesapproximation.

pict
Figure 2.7:Fourier approximation of odd extension of \(x^2\) over one period

pict
Figure 2.8:Code used to draw Fourier approximation for odd extension for one period

Due to discontinuous in the periodic extended function, there will be a Gibbs effect at the points of discontinuities \(x=n\pi \) where \(n\) is odd, where the approximation converges to the average of the function at those point. To see this, here is a plot showing the result for the case of \(16\) terms over \(3\) periods instead of one period as the above plot showed.

pict
Figure 2.9:Fourier approximation of odd extension of \(x^2\) over 3 periods to see Gibbs effect

pict
Figure 2.10:Code used to draw the above plot

2.1.2 Section 5, Problem 5

Problem By referring to the sine series for \(x\) in example 1 and one found for \(x^{2}\) in above problem show that\[ x\left ( \pi -x\right ) \sim \frac{8}{\pi }\sum _{n=1}^{\infty }\frac{\sin \left ( 2n-1\right ) x}{\left ( 2n-1\right ) ^{3}}\qquad 0<x<\pi \] Solution

From example 1, the Fourier sine series for \(x\) defined on \(0<x<\pi \), was found to be\[ x\sim 2\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{n}\sin x\qquad 0<x<\pi \] By writing \(x\left ( \pi -x\right ) =\pi x-x^{2}\) then we see that\begin{align*} \pi x-x^{2} & \sim \pi \left ( 2\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{n}\sin x\right ) -\left ( 2\pi ^{2}\sum _{n=1}^{\infty }\left ( \frac{1}{n\pi }\left ( -1\right ) ^{n+1}-\frac{2}{\left ( n\pi \right ) ^{3}}\left ( 1-\left ( -1\right ) ^{n}\right ) \right ) \sin \left ( nx\right ) \right ) \\ & =\sum _{n=1}^{\infty }2\pi \frac{\left ( -1\right ) ^{n+1}}{n}\sin x-\sum _{n=1}^{\infty }2\pi ^{2}\left ( \frac{1}{n\pi }\left ( -1\right ) ^{n+1}-\frac{2}{\left ( n\pi \right ) ^{3}}\left ( 1-\left ( -1\right ) ^{n}\right ) \right ) \sin \left ( nx\right ) \\ & =\sum _{n=1}^{\infty }\left [ 2\pi \frac{\left ( -1\right ) ^{n+1}}{n}-2\pi ^{2}\left ( \frac{1}{n\pi }\left ( -1\right ) ^{n+1}-\frac{2}{\left ( n\pi \right ) ^{3}}\left ( 1-\left ( -1\right ) ^{n}\right ) \right ) \right ] \sin \left ( nx\right ) \\ & =\sum _{n=1}^{\infty }\left [ 2\pi \frac{\left ( -1\right ) ^{n+1}}{n}-\frac{2\pi }{n}\left ( -1\right ) ^{n+1}+\frac{4}{n^{3}\pi }\left ( 1-\left ( -1\right ) ^{n}\right ) \right ] \sin \left ( nx\right ) \\ & =\sum _{n=1}^{\infty }\frac{4}{n^{3}\pi }\left ( 1-\left ( -1\right ) ^{n}\right ) \sin \left ( nx\right ) \end{align*}

Now when \(n=2,4,6,\cdots \) then \(\left ( 1-\left ( -1\right ) ^{n}\right ) =0\) and when \(n=1,3,5,\cdots \) then \(\left ( 1-\left ( -1\right ) ^{n}\right ) =2\). Hence the above sum becomes\begin{align*} \pi x-x^{2} & \sim \sum _{n=1,3,5,\cdots }^{\infty }\frac{8}{n^{3}\pi }\sin \left ( nx\right ) \\ & \sim \frac{8}{\pi }\sum _{n=1,3,5,\cdots }^{\infty }\frac{1}{n^{3}}\sin \left ( nx\right ) \end{align*}

Let \(n=2m-1\). Then when \(n=1\rightarrow m=1\), \(n=3\rightarrow m=2,\) \(n=5\rightarrow m=3\) and so on. Hence the above sum can be written using \(m\) as summation index as follows\[ \pi x-x^{2}\sim \frac{8}{\pi }\sum _{m=1}^{\infty }\frac{1}{\left ( 2m-1\right ) ^{3}}\sin \left ( \left ( 2m-1\right ) x\right ) \] Since summation index can be named anything, then renaming summation index from \(m\) back to \(n\) gives the form required\[ \pi x-x^{2}\sim \frac{8}{\pi }\sum _{n=1}^{\infty }\frac{1}{\left ( 2n-1\right ) ^{3}}\sin \left ( \left ( 2n-1\right ) x\right ) \]

2.1.3 Section 7, Problem 1

Problem Find the Fourier series on interval \(-\pi <x<\pi \) that corresponds to\[ f\left ( x\right ) =\left \{ \begin{array} [c]{ccc}-\frac{\pi }{2} & & -\pi <x<0\\ \frac{\pi }{2} & & 0<x<\pi \end{array} \right . \] Solution

A plot of the function \(f\left ( x\right ) \) over \(-\pi <x<\pi \) is

pict
Figure 2.11:Plot of \(f(x)\) for problem section 7.1

The periodic extension (with period \(T=2\pi \)) becomes (shown for \(-3\pi <x<3\pi \))

pict
Figure 2.12:Plot of \(f(x)\) for problem section 7.1 after periodic extension

Since the function \(f\left ( x\right ) \) is now periodic then its Fourier series is given by\[ f\left ( x\right ) \sim \frac{a_{0}}{2}+\sum _{n=1}^{\infty }a_{n}\cos \left ( \frac{2n\pi }{T}x\right ) +b_{n}\sin \left ( \frac{2n\pi }{T}x\right ) \] Where \(T\) is the period of the function being approximated which is \(T=2\pi \) in this case. Hence the above simplifies to\[ f\left ( x\right ) \sim \frac{a_{0}}{2}+\sum _{n=1}^{\infty }a_{n}\cos \left ( nx\right ) +b_{n}\sin \left ( nx\right ) \] Since the function \(f\left ( x\right ) \) is an odd function then only \(b_{n}\) terms exist and the above reduces to\begin{equation} f\left ( x\right ) \sim \sum _{n=1}^{\infty }b_{n}\sin \left ( nx\right ) \tag{1} \end{equation} Where\begin{align*} b_{n} & =\frac{1}{\left ( \frac{T}{2}\right ) }\int _{-\frac{T}{2}}^{\frac{T}{2}}f\left ( x\right ) \sin \left ( \frac{2n\pi }{T}x\right ) dx\\ & =\frac{1}{\pi }\int _{-\pi }^{\pi }f\left ( x\right ) \sin \left ( nx\right ) dx \end{align*}

Since \(f\left ( x\right ) \) is odd and \(\sin \) is odd, then the product is even, and the above simplifies to the Fourier sine series\begin{align*} b_{n} & =\frac{2}{\pi }\int _{0}^{\pi }f\left ( x\right ) \sin \left ( nx\right ) dx\\ & =\frac{2}{\pi }\int _{0}^{\pi }\left ( \frac{\pi }{2}\right ) \sin \left ( nx\right ) dx\\ & =\int _{0}^{\pi }\sin \left ( nx\right ) dx\\ & =\left [ \frac{-\cos nx}{n}\right ] _{0}^{\pi }\\ & =-\frac{1}{n}\left [ \cos n\pi -1\right ] \\ & =\frac{1}{n}\left [ 1+\left ( -1\right ) ^{n+1}\right ] \end{align*}

Therefore (1) becomes\[ f\left ( x\right ) \sim \sum _{n=1}^{\infty }\left ( \frac{1}{n}\left ( 1+\left ( -1\right ) ^{n+1}\right ) \right ) \sin \left ( nx\right ) \] When \(n=2,4,6,\cdots \) then \(b_{n}=0\) and when \(n=1,3,5,\cdots \) then \(b_{n}=\frac{2}{n}\). Therefore the above can be written as\[ f\left ( x\right ) \sim \sum _{n=1,3,5,\cdots }^{\infty }\frac{2}{n}\sin \left ( nx\right ) \] Let \(n=2m-1\). Then when \(n=1\rightarrow m=1\), \(n=3\rightarrow m=2,\) \(n=5\rightarrow m=3\) and so on. Hence the above sum can be written using \(m\) as summation index as follows\[ f\left ( x\right ) \sim \sum _{m=1}^{\infty }\frac{2}{2m-1}\sin \left ( \left ( 2m-1\right ) x\right ) \] Since summation index can be named anything, then renaming summation index from \(m\) to \(n\) gives\[ f\left ( x\right ) \sim \sum _{n=1}^{\infty }\frac{2}{2n-1}\sin \left ( \left ( 2n-1\right ) x\right ) \] Since the periodic extension of the original function \(f\left ( x\right ) \) is discontinuous at points \(x=n\pi \), then the Fourier approximation will converge to the average of \(f\left ( x\right ) \) at these points and Gibbs effect will result at these points as well. The following plot shows the result

pict
Figure 2.13:Fourier approximations using 8 terms

pict
Figure 2.14:Code used to generate the above plot

2.1.4 Chapter 1, Section 7, Problem 3

Problem Find the Fourier series on interval \(-\pi <x<\pi \) that corresponds to \(f\left ( x\right ) =x+\frac{1}{4}x^{2}\). suggestions: Use the series for \(x\) in example 2, section 7 and the one for \(x^{2}\) found above in problem Section 5, Problem 3(a).

Solution

Since \(x\) is odd, then we can from example 2 use the Fourier sine series for \(x\) defined on \(-\pi <x<\pi \)\begin{equation} x\sim 2\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{n}\sin \left ( nx\right ) \qquad \left ( -\pi <x<\pi \right ) \tag{1} \end{equation} And since \(x^{2}\) is even, then we can use the Fourier cosine series found in problem Section 5, Problem 3(a) solved above\begin{equation} x^{2}\sim \frac{\pi ^{2}}{3}+4\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{n^{2}}\cos \left ( nx\right ) \qquad \left ( -\pi <x<\pi \right ) \tag{2} \end{equation} Using (1,2), then we can write \(x+\frac{1}{4}x^{2}\) Fourier series as\begin{align*} x+\frac{1}{4}x^{2} & \sim \left ( 2\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{n}\sin nx\right ) +\frac{1}{4}\left ( \frac{\pi ^{2}}{3}+4\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{n^{2}}\cos \left ( nx\right ) \right ) \\ & \sim \frac{\pi ^{2}}{12}+\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{n^{2}}\cos \left ( nx\right ) +\frac{2\left ( -1\right ) ^{n+1}}{n}\sin nx\\ & \sim \frac{\pi ^{2}}{12}+\sum _{n=1}^{\infty }\left ( -1\right ) ^{n}\left ( \frac{\cos \left ( nx\right ) }{n^{2}}-\frac{2\sin \left ( nx\right ) }{n}\right ) \end{align*}

2.1.5 Section 7, Problem 4

Problem Find the Fourier series on interval \(-\pi <x<\pi \) that corresponds to \(f\left ( x\right ) =e^{ax}\) where \(a\neq 0\). suggestion: Use Euler’s formula \(e^{i\theta }=\cos \theta +i\sin \theta \) to write \(a_{n}+ib_{n}=\frac{1}{\pi }\int _{-\pi }^{\pi }f\left ( x\right ) e^{inx}dx\) for \(n=1,2,3,\cdots \). Then after evaluating this single integral, equate real and imaginary parts.

Solution\[ e^{ax}\sim \frac{a_{0}}{2}+\sum _{n=1}^{\infty }a_{n}\cos \left ( \frac{2\pi }{T}nx\right ) +b_{n}\sin \left ( \frac{2\pi }{T}nx\right ) \] But \(T=2\pi \) and the above becomes\[ e^{ax}\sim \frac{a_{0}}{2}+\sum _{n=1}^{\infty }a_{n}\cos \left ( nx\right ) +b_{n}\sin \left ( nx\right ) \] Where\begin{align*} a_{0} & =\frac{1}{\frac{T}{2}}\int _{-\frac{T}{2}}^{\frac{T}{2}}f\left ( x\right ) dx\\ & =\frac{1}{\pi }\int _{-\pi }^{\pi }e^{ax}dx\\ & =\frac{1}{\pi }\left [ \frac{e^{ax}}{a}\right ] _{-\pi }^{\pi }\\ & =\frac{1}{\pi a}\left ( e^{a\pi }-e^{-a\pi }\right ) \end{align*}

But \(\frac{e^{a\pi }-e^{-a\pi }}{2}=\sinh \left ( a\pi \right ) \) hence the above simplifies to\[ a_{0}=\frac{2}{\pi a}\sinh \left ( a\pi \right ) \] And for \(n>0\)\begin{align} a_{n} & =\frac{1}{\frac{T}{2}}\int _{-\frac{T}{2}}^{\frac{T}{2}}f\left ( x\right ) \cos \left ( \frac{2\pi }{T}nx\right ) dx\nonumber \\ & =\frac{1}{\pi }\int _{-\pi }^{\pi }e^{ax}\cos \left ( nx\right ) dx \tag{1} \end{align}

Let \(I=\int _{-\pi }^{\pi }e^{ax}\cos \left ( nx\right ) dx\). Using integration by parts, \(\int udv=uv-\int vdu\). Let \(u=\cos nx,dv=e^{ax}\) then \(v=\frac{e^{ax}}{a},du=-n\sin \left ( nx\right ) \). Hence\begin{align*} I & =uv-\int vdu\\ & =\left [ \cos \left ( nx\right ) \frac{e^{ax}}{a}\right ] _{-\pi }^{\pi }+\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\\ & =\left [ \cos \left ( n\pi \right ) \frac{e^{a\pi }}{a}-\cos \left ( n\pi \right ) \frac{e^{-a\pi }}{a}\right ] +\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\\ & =\left ( -1\right ) ^{n}\left [ \frac{e^{a\pi }-e^{-a\pi }}{a}\right ] +\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\\ & =\frac{2\left ( -1\right ) ^{n}}{a}\left [ \frac{e^{a\pi }-e^{-a\pi }}{2}\right ] +\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\\ & =\frac{2\left ( -1\right ) ^{n}}{a}\sinh \left ( a\pi \right ) +\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx \end{align*}

Applying integration by parts again on the integral above. Let \(u=\sin nx,dv=e^{ax}\) then \(v=\frac{e^{ax}}{a},du=n\cos \left ( nx\right ) \) and the above becomes\begin{align*} I & =\frac{2\left ( -1\right ) ^{n}}{a}\sinh \left ( a\pi \right ) +\frac{n}{a}\left ( \left ( \sin nx\frac{e^{ax}}{a}\right ) _{-\pi }^{\pi }-\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\cos \left ( nx\right ) dx\right ) \\ & =\frac{2\left ( -1\right ) ^{n}}{a}\sinh \left ( a\pi \right ) +\frac{n}{a}\left ( \frac{1}{a}\overset{0}{\overbrace{\left ( \sin \left ( n\pi \right ) e^{a\pi }+\sin \left ( n\pi \right ) e^{-a\pi }\right ) }}-\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\cos \left ( nx\right ) dx\right ) \\ & =\frac{2\left ( -1\right ) ^{n}}{a}\sinh \left ( a\pi \right ) -\frac{n^{2}}{a^{2}}\int _{-\pi }^{\pi }e^{ax}\cos \left ( nx\right ) dx \end{align*}

But \(\int _{-\pi }^{\pi }e^{ax}\cos \left ( nx\right ) dx=I\), the original integral we are solving for. Hence solving for \(I\) from the above gives gives\begin{align} I & =\frac{2\left ( -1\right ) ^{n}}{a}\sinh \left ( a\pi \right ) -\frac{n^{2}}{a^{2}}I\nonumber \\ I+\frac{n^{2}}{a^{2}}I & =\frac{2\left ( -1\right ) ^{n}}{a}\sinh \left ( a\pi \right ) \nonumber \\ I\left ( 1+\frac{n^{2}}{a^{2}}\right ) & =\frac{2\left ( -1\right ) ^{n}}{a}\sinh \left ( a\pi \right ) \nonumber \\ I & =\frac{\frac{2\left ( -1\right ) ^{n}}{a}\sinh \left ( a\pi \right ) }{1+\frac{n^{2}}{a^{2}}}\nonumber \\ & =\frac{2a\left ( -1\right ) ^{n}\sinh \left ( a\pi \right ) }{a^{2}+n^{2}} \tag{2} \end{align}

Using (2) in (1) gives\begin{align} a_{n} & =\frac{1}{\pi }\int _{-\pi }^{\pi }e^{ax}\cos \left ( nx\right ) dx\nonumber \\ & =\frac{a}{\pi }\frac{2\left ( -1\right ) ^{n}\sinh \left ( a\pi \right ) }{a^{2}+n^{2}} \tag{3} \end{align}

Now we will do the same to find \(b_{n}\)\begin{align} b_{n} & =\frac{1}{\frac{T}{2}}\int _{-\frac{T}{2}}^{\frac{T}{2}}f\left ( x\right ) \sin \left ( \frac{2\pi }{T}nx\right ) dx\nonumber \\ & =\frac{1}{\pi }\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx \tag{4} \end{align}

Let \(I=\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\). Using integration by parts, \(\int udv=uv-\int vdu\). Let \(u=\sin \left ( nx\right ) ,dv=e^{ax}\) then \(v=\frac{e^{ax}}{a},du=n\cos \left ( nx\right ) \). Hence\begin{align*} I & =uv-\int vdu\\ & =\left [ \sin \left ( nx\right ) \frac{e^{ax}}{a}\right ] _{-\pi }^{\pi }-\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\cos \left ( nx\right ) dx\\ & =\overset{0}{\overbrace{\left [ \sin \left ( n\pi \right ) \frac{e^{a\pi }}{a}-\sin \left ( n\pi \right ) \frac{e^{-a\pi }}{a}\right ] }}-\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\cos \left ( nx\right ) dx\\ & =-\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\cos \left ( nx\right ) dx \end{align*}

Now we apply integration by parts again on the integral above. Let \(u=\cos nx,dv=e^{ax}\) then \(v=\frac{e^{ax}}{a},du=-n\sin \left ( nx\right ) \) and the above becomes\begin{align*} I & =-\frac{n}{a}\left ( \left ( \cos \left ( nx\right ) \frac{e^{ax}}{a}\right ) _{-\pi }^{\pi }+\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\right ) \\ & =-\frac{n}{a}\left ( \frac{1}{a}\left ( \cos \left ( n\pi \right ) e^{a\pi }-\cos \left ( n\pi \right ) e^{-a\pi }\right ) +\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\right ) \\ & =-\frac{n}{a}\left ( \frac{1}{a}\cos \left ( n\pi \right ) \left ( e^{a\pi }-e^{-a\pi }\right ) +\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\right ) \\ & =-\frac{n}{a}\left ( \frac{2}{a}\cos \left ( n\pi \right ) \left ( \frac{e^{a\pi }-e^{-a\pi }}{2}\right ) +\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\right ) \\ & =-\frac{n}{a}\left ( \frac{2}{a}\cos \left ( n\pi \right ) \sinh \left ( a\pi \right ) +\frac{n}{a}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\right ) \\ & =-\frac{2n}{a^{2}}\left ( -1\right ) ^{n}\sinh \left ( a\pi \right ) -\frac{n^{2}}{a^{2}}\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx \end{align*}

But \(\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx=I\). Hence solving for \(I\) gives\begin{align} I & =-\frac{2n}{a^{2}}\left ( -1\right ) ^{n}\sinh \left ( a\pi \right ) -\frac{n^{2}}{a^{2}}I\nonumber \\ I+\frac{n^{2}}{a^{2}}I & =-\frac{2n}{a^{2}}\left ( -1\right ) ^{n}\sinh \left ( a\pi \right ) \nonumber \\ I\left ( 1+\frac{n^{2}}{a^{2}}\right ) & =-\frac{2n}{a^{2}}\left ( -1\right ) ^{n}\sinh \left ( a\pi \right ) \nonumber \\ I & =-\frac{\frac{2n}{a^{2}}\left ( -1\right ) ^{n}\sinh \left ( a\pi \right ) }{1+\frac{n^{2}}{a^{2}}}\nonumber \\ I & =-\frac{2n\left ( -1\right ) ^{n}}{a^{2}+n^{2}}\sinh \left ( a\pi \right ) \tag{5} \end{align}

Using (5) in (4) gives\begin{align*} b_{n} & =\frac{1}{\pi }\int _{-\pi }^{\pi }e^{ax}\sin \left ( nx\right ) dx\\ & =-\frac{1}{\pi }\frac{2n\left ( -1\right ) ^{n}}{a^{2}+n^{2}}\sinh \left ( a\pi \right ) \end{align*}

Now that we found \(a_{0},a_{n},b_{n}\) then the Fourier series is\begin{align*} e^{ax} & \sim \frac{a_{0}}{2}+\sum _{n=1}^{\infty }a_{n}\cos \left ( nx\right ) +b_{n}\sin \left ( nx\right ) \\ & \sim \frac{\frac{2}{\pi a}\sinh \left ( a\pi \right ) }{2}+\sum _{n=1}^{\infty }\frac{a}{\pi }\frac{2\left ( -1\right ) ^{n}\sinh \left ( a\pi \right ) }{a^{2}+n^{2}}\cos \left ( nx\right ) -\frac{1}{\pi }\frac{2n\left ( -1\right ) ^{n}}{a^{2}+n^{2}}\sinh \left ( a\pi \right ) \sin \left ( nx\right ) \\ & \sim \frac{\sinh \left ( a\pi \right ) }{\pi a}+\frac{1}{\pi }\sinh \left ( a\pi \right ) \sum _{n=1}^{\infty }\frac{2\left ( -1\right ) ^{n}}{a^{2}+n^{2}}\left ( a\cos \left ( nx\right ) -n\sin \left ( nx\right ) \right ) \\ & \sim \sinh \left ( a\pi \right ) \left ( \frac{1}{\pi a}+\frac{1}{\pi }\sum _{n=1}^{\infty }\frac{2\left ( -1\right ) ^{n}}{a^{2}+n^{2}}\left ( a\cos \left ( nx\right ) -n\sin \left ( nx\right ) \right ) \right ) \\ & \sim \frac{2\sinh \left ( a\pi \right ) }{\pi }\left ( \frac{1}{2a}+\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{a^{2}+n^{2}}\left ( a\cos \left ( nx\right ) -n\sin \left ( nx\right ) \right ) \right ) \end{align*}

Which is what we are required to show.

The following plots shows the approximation as more terms are added. We also notice the Gibbs effect at the points of discontinuities after the original function was periodic extended. The value \(a=1\) was used. Hence this is approximation of \(e^{x}\) using \(-\pi <x<\pi \) as original period.

pict
Figure 2.15:Fourier approximations using with increasing terms

pict
Figure 2.16:Code used to generate the above plot

2.1.6 Chapter 1, Section 8, Problem 1

   Part a
   Part b

Problem (a) Use the Fourier sine series found in example 1, section 5 for \(f\left ( x\right ) =x\) for \(0<x<\pi \), to show that\begin{equation} x\sim \frac{2}{\pi }\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{n}\sin n\pi x\qquad \left ( -1<x<1\right ) \tag{1} \end{equation} (b) Obtain the correspondence in part (a) by using expression (11) in section 9 for the coefficient in a Fourier sine series on \(0<x<c\)

Part a

The Fourier sine series found in example 1, section 5 for \(f\left ( x\right ) =x\) for \(0<x<\pi \) is\begin{equation} x\sim 2\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{n}\sin nx\qquad \left ( 0<x<\pi \right ) \tag{2} \end{equation} Which has period \(T_{2}=2\pi \) after odd extension. To convert the above to the range \(-1<x<1\), then by looking at this diagram

pict
Figure 2.17:Finding scale for correspondence

We see that by symmetry \(\frac{x}{\pi }=\frac{x^{\prime }}{1}\). Hence \(x=\pi x^{\prime }\). Therefore we want \(x\rightarrow \pi x^{\prime }\) but \(x^{\prime }\) is just \(x\) in the new domain. Hence \(x\rightarrow \pi x\) in the new Fourier series. Therefore replacing \(x\) by \(\pi x\) in (2) gives\begin{equation} x\sim 2\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{n}\sin n\pi x\qquad \left ( 0<x<1\right ) \tag{3} \end{equation} Equation (3) is now scaled by multiplying it by \(\frac{x^{\prime }}{x}=\frac{1}{\pi }\) giving\begin{equation} x\sim \frac{2}{\pi }\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{n}\sin n\pi x\qquad \left ( 0<x<1\right ) \tag{4} \end{equation}

Part b

Expression (11) in section 8 is\[ b_{n}=\frac{2}{c}\int _{0}^{c}f\left ( x\right ) \sin \left ( \frac{n\pi x}{c}\right ) dx \] Let \(c=1\) and since \(f\left ( x\right ) =x\), then above becomes\[ b_{n}=2\int _{0}^{1}x\sin \left ( n\pi x\right ) dx \] Let \(u=x,dv=\sin \left ( n\pi x\right ) \) then \(du=1,v=\frac{-\cos \left ( n\pi x\right ) }{n\pi }\). Hence \(udv=uv-\int vdu\) and the integral above becomes\begin{align*} b_{n} & =2\left ( \frac{-1}{n\pi }\left [ x\cos \left ( n\pi x\right ) \right ] _{0}^{1}+\frac{1}{n\pi }\int _{0}^{1}\cos \left ( n\pi x\right ) dx\right ) \\ & =2\left ( \frac{-1}{n\pi }\left [ \cos \left ( n\pi \right ) \right ] +\frac{1}{n\pi }\left [ \frac{\sin \left ( n\pi x\right ) }{n\pi }\right ] _{0}^{1}\right ) \\ & =2\left ( \frac{-1}{n\pi }\left [ \left ( -1\right ) ^{n}\right ] +\frac{1}{\left ( n\pi \right ) ^{2}}\overset{0}{\overbrace{\left [ \sin \left ( n\pi x\right ) \right ] _{0}^{1}}}\right ) \\ & =\frac{2}{n\pi }\left ( -1\right ) ^{n+1} \end{align*}

Hence \begin{align*} x & \sim \sum _{n=1}^{\infty }b_{n}\sin n\pi x\\ & \sim \frac{2}{\pi }\sum _{n=1}^{\infty }\frac{1}{n}\left ( -1\right ) ^{n+1}\sin n\pi x \end{align*}

Which is the same as (1) in part (a)

2.1.7 Chapter 1, Section 8, Problem 6

Problem Use method in example 2 section 8 to show that \[ e^{x}\sim \frac{\sinh c}{c}+2\sinh c\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{c^{2}+\left ( n\pi \right ) ^{2}}\left ( c\cos \left ( \frac{n\pi x}{c}\right ) -n\pi \sin \left ( \frac{n\pi x}{c}\right ) \right ) \qquad -c<x<c \] Solution

From problem 4 section 7, we know that\begin{equation} e^{ax}\sim \frac{\sinh a\pi }{a\pi }+2\frac{\sinh a\pi }{\pi }\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{a^{2}+n^{2}}\left ( a\cos \left ( nx\right ) -n\sin \left ( nx\right ) \right ) \qquad -\pi <x<\pi \tag{1} \end{equation} To convert the above to the range \(-c<x<c\), then by looking at this diagram

pict
Figure 2.18:Finding scale for correspondence

We see that by symmetry, \(\frac{x}{\pi }=\frac{x^{\prime }}{c}\) where \(x^{\prime }\) is the \(x\) in the new range we want, which is \(-c<x<c\). Hence \(x=\frac{x^{\prime }\pi }{c}\) or since \(x^{\prime }\) is just \(x\) in the new domain, then this implies \(x\rightarrow \frac{x\pi }{c}\). Then replacing \(x\) by \(\frac{x\pi }{c}\) in (1) gives\begin{equation} e^{\frac{a\pi x}{c}}\sim \frac{\sinh a\pi }{a\pi }+2\frac{\sinh a\pi }{\pi }\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{a^{2}+n^{2}}\left ( a\cos \left ( \frac{n\pi x}{c}\right ) -n\sin \left ( \frac{n\pi x}{c}\right ) \right ) \qquad -x<x<c \tag{2} \end{equation} We see that the trigonometric terms inside the sum is multiplied by \(a\), hence we replace that by \(\frac{c}{\pi }\) in the above. This is the same as \(\frac{x^{\prime }}{x}=\frac{c}{\pi }\). Hence letting \(a=\frac{c}{\pi }\) in (2) gives\begin{align*} e^{x} & \sim \frac{\sinh c}{c}+2\frac{\sinh c}{\pi }\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{\left ( \frac{c}{\pi }\right ) ^{2}+n^{2}}\left ( \frac{c}{\pi }\cos \left ( \frac{n\pi x}{c}\right ) -n\sin \left ( \frac{n\pi x}{c}\right ) \right ) \\ & \sim \frac{\sinh c}{c}+2\frac{\sinh c}{\pi }\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{\frac{c^{2}}{\pi }+\pi n^{2}}\left ( c\cos \left ( \frac{n\pi x}{c}\right ) -n\pi \sin \left ( \frac{n\pi x}{c}\right ) \right ) \\ & \sim \frac{\sinh c}{c}+2\sinh c\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n}}{c^{2}+\pi ^{2}n^{2}}\left ( c\cos \left ( \frac{n\pi x}{c}\right ) -n\pi \sin \left ( \frac{n\pi x}{c}\right ) \right ) \end{align*}

Which is what we asked to show.