MATH201/content/Fourier Series (lec 28-29).md

9.3 KiB

Remember the heat flow equation? We obtained that it's solution could be expressed in the form:

\sum_{n=1}^\infty c_{n}\sin\left( \frac{n\pi x}{L} \right)\quad\text{for}\quad0\leq x\leq L

But what is c_{n}? They are the coefficients of a fourier transform. We want to develop a way to compute them. Let's derive how to compute the coefficients of a fourier transform. (feel free to skip to the end) f(x)=\sum_{n=1}^\infty b_{n}\sin\left( \frac{n\pi x}{L} \right) where L is length of the rod

This is a Fourier series: f(x)=\frac{a_{0}}{2}+\sum_{n=1}^\infty\left( a_{n}\cos\left( \frac{n\pi x}{L} \right) + b_{n}\sin\left( \frac{n\pi x}{L}\right) \right) x \in [-L,L] almost everywhere piecewise continuous (?) has a lot of benefits over taylor series. f(x) doesn't have to be infinitely differentiable (analytic) f(x) can even have jump discontinuities lets assume the equation is true when x \in [-L,L] \int _{-L} ^L f(x) \, dx=\int _{-L}^L \frac{a_{0}}{2} \, dx+\int _{-L}^L (\text{put summation here}) \, dx \int _{-L}^L \cos\left( \frac{n\pi x}{L} \right) \, dx=\frac{L}{n\pi}\sin\left( \frac{n\pi x}{L} \right)|_{-L}^L=0 same for \int _{-L}^L \sin\left( \frac{n\pi x}{L} \right)\, dx=0 (it equals 0) so \int _{-L} ^L f(x) \, dx=\int _{-L}^L \frac{a_{0}}{2} \, dx+\int _{-L}^L0 \, dx \int _{-L} ^L f(x) \, dx=\int _{-L}^L \frac{a_{0}}{2} \, dx+\int _{-L}^L0 \, dx a_{0}=\frac{1}{L}\int _{L}^{2?a_{0}L} f(x) \, dx \int _{-L}^L f(x)\cos\left( \frac{m\pi x}{L} \right)\, dx=\frac{a_{0}}{2}\cancelto{ 0 }{ \int _{-L}^L \cos\left( \frac{m\pi x}{L} \right) \, dx }+\sum_{n=1}^\infty\left( a_{n}\int _{-L}^L\cos\left( \frac{n\pi x}{L} \right)\cos\left( \frac{m\pi x}{L} \right) \, dx \right)+b_{n}\int _{-L}^L \sin\left( \frac{n\pi x}{L} \right)\cos\left( \frac{m\pi x}{L} \right) \, dx use trig identities (will be provided on exam): \cos(\alpha)\cos(\beta)=\frac{1}{2}(\cos(\alpha-\beta)+\cos(\alpha+\beta)) \sin(\alpha)\cos(\beta)=\frac{1}{2}(\sin(\alpha+\beta)+\sin(\alpha-\beta)) \sin(\alpha)\sin(\beta)=\frac{1}{2}(\cos(\alpha-\beta)-\cos(\alpha+\beta)) \int _{-L}^L \cos \frac{n\pi x}{L}\cos \frac{m\pi x}{L}\, dx=\frac{1}{2}(\int _{-L}^L \left( \cos \frac{(n-m)\pi x}{L} \right) \, dx+\cancelto{ 0 }{ \frac{\cos(n+m)\pi x}{L} }dx = \begin{cases}0 & n\ne m \\L & n=m\end{cases}

\int _{-L}^L \sin \frac{n\pi x}{L}\cos \frac{m\pi}{L} \, dx=0; \int _{-L}^L \sin \frac{n\pi x}{L}\cos \frac{m\pi}{L} \, dx=\begin{cases}0 & n\ne m \\L & n=m\end{cases}

going back,

a_{m}=\frac{1}{L}\int _{-L}^L f(x)\cos \frac{m\pi x}{L} \, dx \quad\text{valid for all }m=0,1,2,\dots
b_{m}=\frac{1}{L}\int _{-L}^L f(x)\sin \frac{m\pi x}{L} \, dx=b_{m} \quad m=1,2,\dots

now we know how to compute the coefficients for Fourier series!

properties: for functions f, g, If \int _{-L}^Lf(x)g(x) \, dx=\begin{cases}0 & f\ne g \\L & f=g \end{cases} then f, g are orthogonal the forier expantion is called an ortho normal expansion, taylor is not ortho normal. #end of lec 28 #start of lec 29 last lecture we derived how to find the coefficients in a fourier series. f(x)=\frac{a_{0}}{2}+\sum_{n=1}^\infty\left( a_{n}\cos\left( \frac{n\pi x}{L} \right) + b_{n}\sin\left( \frac{n\pi x}{L}\right) \right) x \in [-L,L]

Theorem:

If f and f' are piecewise continuous on [-L,L], then the fourier series converges to: \frac{1}{2}(f(x^-)+f(x^+)) for all x \in (-L,L) Basically meaning, the fourier series converges. At x=\pm L the fourier series converges to \frac{1}{2}(f(-L^+)+f(L^-)) !Partial differential equations (lec 26-27) 2023-11-22 13.15.26.excalidraw

Theorem:

If f(x) is continuous on (-\infty,\infty) and 2L periodic and if f' is continuous, then the taylor series converges to f(x) everywhere !Partial differential equations (lec 26-27) 2023-11-22 13.14.05.excalidraw #ex lets compute the fourier transform of: f(x)=\begin{cases}1, & -\pi\leq x\leq 0 \\x, & 0<x\leq \pi\end{cases} L here is \pi clearly. lets find the coefficients a_{n} and b_{n} a_{n}=\frac{1}{\pi}\left( \int _{-\pi}^0 \cos\left( \frac{n\pi x}{\pi} \right)\, dx +\int _{0}^\pi x\cos(nx)\, dx\right) using integration by parts for second term: =\frac{1}{\pi}\left( \frac{1}{n}\cancelto{ 0 }{ \sin(nx) }|_{-\pi}^0 +\frac{1}{n}\left( x\cancelto{ 0 }{ \sin(nx) }|_{0}^\pi-\int _{0}^\pi \sin(nx) \, dx \right)\right) a_{n}=\frac{1}{n^2\pi}(\cos(nx)|_{0}^\pi)=\frac{1}{n^2\pi}((-1)^n-1) n=0,1,2,\dots now lets find b_{n} b_{n}=\frac{1}{\pi}\left( \int _{-\pi}^0\sin(nx) \, dx+\int _{0}^\pi x\sin(nx) \, dx \right) =\frac{1}{\pi}\left( \frac{-1}{n}\cos(nx)|_{-\pi}^0-\frac{1}{n}\left( x\cos(nx)|_{0}^\pi-\int _{0}^\pi \cos(nx)\, dx \right) \right) b_{n}=\frac{1}{n\pi}((-1)^n(1-\pi)-1) n=1,2,\dots

we find that a_{2n}=0 a_{2k-1}=-\frac{2}{n^2\pi} for k=1,2,\dots what about when n=0? a_{0}=\frac{1}{\pi}\left( \int _{-\pi}^0 \, dx+\int _{0}^\pi x \, dx \right) =\frac{1}{\pi}\left( x|_{-\pi}^0+\frac{x^2}{2}|_{0}^\pi \right) =\frac{1}{\pi}\left( 0+\pi+\frac{\pi^2}{2} \right)=\frac{\pi}{2}+1

#ex lets compute the fourier transform of f(x)=x from -\pi\leq x\leq \pi we have to take a windowed form of f to make this possible, L=\pi at the left and right edge of the interval, the fourier series is equal to 0. (from the previous theorem) find the coefficients: a_{n}=\frac{1}{\pi}\int _{-\pi}^\pi x\cos(nx) \, dx=0 Why is it zero? because the integrand is an odd function. (odd times even is odd.) and because we are integrating from -\pi to \pi (symmetric interval) definition of odd: f(x)=-f(-x) definition of even: f(x)=f(-x) odd times even is odd. odd times odd is even. even times even is even. huge exam time saving technique. find b_{n} b_{n}=\frac{1}{\pi}\int _{-\pi}^\pi x\sin(nx) \, dx=\frac{2}{\pi}\int _{0}^\pi x\sin(nx) \, dx using integration by parts: b_{n}=\frac{2}{n}(-1)^{n+1} another take away: if f is odd, the cos terms are 0 if f is even, the sin terms are 0.

if f is only defined between 0 and L: you can create an odd extension: \bar{f}=\begin{cases}f(x) & 0\leq x\leq L \\-f(-x), & -L\leq x<0 & & \end{cases} this will contain only sin terms you also have a choise to extend it as an even function, symmetrically across the y axis. \bar{f}=\begin{cases}f(x) & 0\leq x\leq L \\f(-x), & -L\leq x<0 & & \end{cases} this will contain only cos terms. #end of lec 29 #start of lec 30 from last lecture: f(x) is defined on [0,L] odd extention: \bar{f}(x)=\begin{cases}f(x), & 0\leq x\leq L \\-f(-x,) & -L\leq x<0\end{cases} and the a coeffecients (cos terms) are zero. not only that, but the b terms are: \sum_{n=1}^\infty b_{n}\sin\left( \frac{n\pi x}{L} \right); \qquad b_{n}=\frac{1}{L}\int _{-L}^L\bar{f}(x) \sin\left( \frac{n\pi x}{L} \right) \, dx

b_{n}=\frac{2}{L}\int _{0}^L f(x)\sin\left( \frac{n\pi x}{L} \right)\, dx

"How about that, this is called a foureir sin series." For even extension: \bar{f}(x)=\begin{cases}f(x), & 0\leq x\leq L \\f(-x,) & -L\leq x<0\end{cases} and the b coeffecients (sin terms) are zero. not only that but the a terms are: \frac{a_{0}}{2}+\sum_{n=1}^\infty a_{n}\cos\left( \frac{n\pi x}{L} \right) a_{n}=\frac{2}{L}\int _{0}^L f(x)\cos\left( \frac{n\pi x}{L} \right)\, dx

remember that \sum_{n=1}^\infty b_{n}\sin\left( \frac{n\pi x}{L} \right) was the expansion of the eigen value function from the heat equation? then \frac{a_{0}}{2}+\sum_{n=1}^\infty a_{n}\cos\left( \frac{n\pi x}{L} \right) is also an expansion of some related eigen value function.

#ex Fourier sine series for f(x)=x^2 from 0\leq x\leq \pi well that means we want the odd extension: !Lec 30 2023-11-24 13.15.17.excalidraw the \cos() (a_{n}) terms are zero. the b terms are: b_{n}=\frac{2}{\pi}\int _{0}^\pi x^2\sin(nx) \, dx =-\frac{2}{\pi n}\left[ x^2\cos(nx)|_{0}^\pi-2\int _{0}^\pi x\cos(nx)\, dx \right] =-\frac{2}{n\pi}\left[ \pi^2(-1)^n-\frac{2}{n}\left( x\cancelto{ 0 }{ \sin(nx) }|_{0}^\pi-\int _{0}^\pi \sin(nx)\, dx \right) \right] b_{n}=-\frac{2}{n\pi}\left[ \pi^2(-1)^n-\frac{2}{n^2}\cos(nx)|_{0}^\pi \right]=\frac{2\pi}{n}(-1)^{n+1}+\frac{4}{n^3\pi}((-1)^n-1) for n=1,2,3,\dots note no n=0 so no divison by zero problems here.

#ex fourier cosine series of f(x)=\sin(x) for 0\leq x\leq \pi !Lec 30 2023-11-24 13.23.08.excalidraw a_{n}=\frac{2}{\pi}\int _{0}^\pi \sin(x)\cos(nx)\, dx for n=0,1,2,\dots use trig identity: (by the way the identites will be provided in the exam.)

=\frac{2}{\pi} \frac{1}{2}\int _{0}^\pi (\sin(1-n)x+\sin(n+1)x)\, dx integrating gives you: a_{n}=-\frac{1}{\pi} \frac{1}{n+1} (-1)^{n+1}+\frac{1}{\pi} \frac{1}{n+1}+\frac{1}{\pi} \frac{1}{n-1}(-1)^{n-1}-\frac{1}{\pi} \frac{1}{n-1} what about when n=0 or n=1? a_{0}=\frac{4}{\pi}=\frac{2}{\pi}\int _{0}^\pi \sin(x) \, dx a_{1}=\frac{2}{\pi}\int _{0}^\pi \sin(x)\cos(x) \, dx=\frac{1}{\pi}\int _{0}^\pi \sin(2x)\, dx=0 "0 is a very very special number it took humanity many numbers of years to invent 0" referring to when dividing by 0. additionally we know that the terms cancel when: a_{2k-1}=0 for k=1,2,\dots a_{2k}=\frac{2}{\pi} \frac{1}{2k+1}+\frac{2}{\pi} \frac{1}{2k-1} for k=1,2,\dots then:

\bar{f}(x)=\frac{2}{\pi}+\frac{2}{\pi}\sum_{k=1}^\infty\left( \frac{1}{2k+1}+\frac{1}{2k-1} \right)\cos(2kx)

We have prepared ourselves now, now we start solving PDE's. He's encouraging us to attend the lectures in these last two weeks. He's making it sound like PDE's are hard.