---
# System prepended metadata

title: L11
tags: [微分方程特論]

---

# L11
###### tags: `微分方程特論`
###### date: `20 May 2020`

Given $f(x)$ defined on $-L<x<L$
$\displaystyle  f(x)\sim\frac{1}{2}a_0+\sum^\infty_{n=1}\left(a_n\cos \frac{n\pi x}{L}+b_n\sin \frac{n\pi x}{L}\right)$
$\displaystyle  a_0=\frac{1}{L}\int^L_{-L} f(x)dx$
$\displaystyle a_n=\frac{1}{L}\int^L_{-L}  f(x)\cos \frac{n\pi x}{L} dx,\quad n=1,2,3\ldots$
$\displaystyle b_n=\frac{1}{L}\int^L_{-L} f(x)\sin \frac{n\pi x}{L} dx,\quad n=1,2,3\ldots$

Extend $f(x)$ to any periodic functions with period $2L$
i.e. $f(x+2L)=f(x)$, $\forall x$

`insert Fig. 1`

:book: Sec. 8.1 Problem 30
![](https://i.imgur.com/PssuHgV.png =350x)

Hence, 
$a_n=\frac{1}{L}\int^L_{-L}  f(x)\cos \frac{n\pi x}{L} dx=\frac{1}{L}\int_0^{2L}  f(x)\cos \frac{n\pi x}{L} dx$

### Example 
(Example of Sec. 8.1)
$f(x)=\left\{\begin{array}{ll}1,&0<x<2;\\-1,&2<x<4.\end{array}\right.$
$f(x+4)=f(x)$
Find its Fourier series.
#### Solution
$\displaystyle a_0=\dfrac{1}{2}\int^2_{-2} f(x)dx=0$ ($\because$ $f$ is odd)

$\displaystyle a_n=\frac{1}{L}\int^L_{-L}  f(x)\cos \frac{n\pi x}{L} dx=0$ ($\because$ $f$ is odd)

$\displaystyle \begin{align}b_n&=\frac{1}{L}\int^{L}_{-L} f(x)\sin \frac{n\pi x}{L} dx=\frac{2}{2}\int^{2}_{0} \sin \frac{n\pi x}{2} dx\\&=\left.-\frac{2}{n\pi}\cos\frac{n\pi x}{2}\right|^2_0=-\frac{2}{n\pi}\left(\cos n\pi -1\right)=\left\{\begin{array}{ll}0,&n~\text{even}\\\frac{4}{n\pi},&n~\text{odd}\end{array}\right.\end{align}$

$\displaystyle f(x) \sim \sum^\infty_{n=1}b_n\sin\frac{n\pi x}{2}=\sum^\infty_{k=1}b_{2k-1}\sin\frac{(2k-1)\pi x}{2}=\sum^\infty_{k=1}\frac{4}{(2k-1)\pi}\sin\frac{(2k-1)\pi x}{2}$

![](https://i.imgur.com/YNHoGeL.png)

### Def. piecewise continuity
abbr. p-cont.
$f$ is piecewise continuous on a bounded closed interval $[a,b]$ if $[a,b]$ can be divided into finite subintervals such that 
1. $f$ is continuous in the interior of each of these subintervals
2. 

![](https://i.imgur.com/2dn5tBT.png)

### Def. 
$f$ is p-cont on $(-\infty,\infty)$ if $f$ is p-cont. on every bounded closed intervals.

### Def. piecewise smoothness
abbr. p-smooth
[ref](https://sites.math.washington.edu/~rtr/papers/rtr190-PiecewiseSmooth.pdf)
If $f$ and $f'$ are piecewise continuous, then $f$ is said to be **piecewise smooth**.

### Thm. (p.566)
Suppose $f$ is periodic and p-smooth, then the Fourier series of $f$ converges to $\frac{f(x+)+f(x-)}{2}$, where $$f(x+)=\lim_{y=x^+}f(y)\\f(x-)=\lim_{y=x^-}f(y)$$

`insert Fig.3`

#### Note
If $f$ is cont. at $x$, then $f(x+)=f(x-)=f(x)$ and $\frac{f(x+)+f(x-)}{2}=f(x)$. Thus, the Fourier series of $f$ converges to $f(x)$ if $f$ is cont. at $x$.

In the previous example, $\sum^\infty_{k=1}\frac{4}{(2k-1)\pi}\sin\frac{(2k-1)\pi x}{2}$ converges to $\frac{f(x+)+f(x-)}{2}$, i.e. $0$ at discontinuities or $f(x)$ at continuities.


### Example
$f(x)=x^2,\quad 0<x<2$ with period $2$
Find its Fouries series
Discuss the convergence.

#### Solution 
The Fourier coefficients are 
$\displaystyle  a_0=\int^{2}_{0} x^2dx=\left[\dfrac{1}{3}x^3\right]^2_0=\dfrac{8}{3}$
$\require{cancel}\displaystyle \begin{align}a_n&=\int^{2}_{0}  x^2\cos n\pi x\   dx=\cancelto{0}{\left[\frac{1}{n\pi}x^2\sin n\pi x\right]^{2}_{0}}-\int^{2}_{0}\frac{2x}{n\pi}\sin n\pi x\ dx\\&=-\dfrac{2}{n\pi}\left\{\left[-\dfrac{x}{n\pi}\cos n\pi x\right]^{2}_{0}+\int^{2}_{0}\dfrac{1}{n\pi}\cos n\pi x\ dx\right\}\\&=\left(\dfrac{2}{n\pi}\right)^2-\cancelto{0}{\dfrac{2}{n\pi}\left[\dfrac{1}{(n\pi)^2}\sin n\pi x\right]^{2}_{0}}\\&=\dfrac{4}{n^2\pi^2}\end{align}$
$\displaystyle \begin{align}b_n&=\int^{2}_{0}  x^2\sin n\pi x\   dx=\left[-\frac{1}{n\pi}x^2\cos n\pi x\right]^{2}_{0}+\int^{2}_{0}\frac{2x}{n\pi}\cos n\pi x\ dx\\&=-\dfrac{4}{n\pi}+\dfrac{2}{n\pi}\left\{\cancelto{0}{\left[\dfrac{x}{n\pi}\sin n\pi x\right]^{2}_{0}}-\int^{2}_{0}\dfrac{1}{n\pi}\sin n\pi x\ dx\right\}\\&=-\dfrac{4}{n\pi}+\cancelto{0}{\dfrac{2}{n\pi}\left[\dfrac{1}{(n\pi)^2}\cos n\pi x\right]^{2}_{0}}\\&=-\dfrac{4}{n\pi}\end{align}$
![](https://i.imgur.com/nYoWCgg.png =350x)
![](https://i.imgur.com/ermkgGm.png =350x)

Therefore, the Fourier seires of $f$ $$\displaystyle \begin{align} f(x)&\sim\frac{1}{2}a_0+\sum^\infty_{n=1}\left(a_n\cos \frac{n\pi x}{L}+b_n\sin \frac{n\pi x}{L}\right)\\&=\dfrac{4}{3}+\sum^\infty_{n=1}\left(\dfrac{4}{n^2\pi^2}\cos n\pi x-\dfrac{4}{n\pi}\sin n\pi x\right)\end{align}$$ converges to $$\frac{f(x+)+f(x-)}{2}=\left\{\begin{array}{ll} 2,&x=2k,\ k\in\mathbb{Z};\\f(x),&\text{otherwise}.\end{array}\right.$$

When $x=0$, the Fourier series becomes $$\frac{4}{3}+\sum^\infty_{n=1}\frac{4}{n^2\pi^2}=\frac{f(0+)+f(0-)}{2}=2\\\implies \frac{4}{\pi^2}\sum^\infty_{n=1}\frac{1}{n^2}=\frac{2}{3}\\\implies \sum^\infty_{n=1}\frac{1}{n^2}=\dfrac{1}{1^2}+\dfrac{1}{2^2}+\dfrac{1}{3^2}+\cdots=\frac{\pi^2}{6}$$

When $x=1$, the Fourier series becomes $$\frac{4}{3}+\sum^\infty_{n=1}\left(\frac{4}{n^2\pi^2}\cos n\pi\right)=f(1)=1\\\implies \dfrac{4}{\pi^2}\sum^\infty_{n=1}\dfrac{(-1)^{n}}{n^2}=-\frac{1}{3} \\\implies\sum^\infty_{n=1}\dfrac{(-1)^{n+1}}{n^2}=\dfrac{1}{1^2}-\dfrac{1}{2^2}+\dfrac{1}{3^2}-\cdots=\frac{\pi^2}{12}$$

Adding these infinite series, $2\left(\dfrac{1}{1^2}+\dfrac{1}{3^2}+\dfrac{1}{5^2}+\cdots\right)=\dfrac{3\pi^2}{12}\\\implies \dfrac{1}{1^2}+\dfrac{1}{3^2}+\dfrac{1}{5^2}+\cdots=\dfrac{\pi^2}{8}$

## Sec. 8.2
If $f(x)$ is even on $(-L,L)$, then $b_n=0$ and $$f(x)\sim \frac{1}{2}a_0+\sum^\infty_{n=1}a_n\cos \frac{n\pi x}{L},$$ also known as **Fourier cosine series**, with coefficients being $$\displaystyle  a_0=\frac{2}{L}\int^L_0 f(x)dx$$ and $$\displaystyle a_n=\frac{2}{L}\int^L_0  f(x)\cos \frac{n\pi x}{L} dx,\quad n=1,2,3\ldots.$$

If $f(x)$ is odd on $(-L,L)$, then $a_0=0$, $a_n=0$ ($n=1,2,3,\ldots$) and $$f(x)\sim \sum^\infty_{n=1}b_n\sin \frac{n\pi x}{L},$$ also known as **Fourier sine series**, with coefficients being $$\displaystyle b_n=\frac{2}{L}\int^L_0  f(x)\sin \frac{n\pi x}{L} dx,\quad n=1,2,3\ldots.$$


Recall that the S-L problem $y''+\lambda y=0;\ y(0)=0,y(L)=0$ has eigenvalues $\lambda_n=n^2$ and associated (normalized) eigenfunctions $\phi_n(x)=\sqrt{\frac{2}{L}}\sin\frac{n\pi x}{L}$, which form an orthonormal system.


### Even extension
Given $f(x)$ defined on $0<x<L$, its domain can be *extended* （延拓） to a larger interval $-L<x<L$ such that $f(x)$ is even on $-L<x<L$, i.e. let $$F(x)=\left\{\begin{array}{ll}f(-x),&-L<x<0\\f(x),&0<x<L\end{array}\right.,$$ so that $F(x)=F(-x)$ and $F(x)$ is even on $-L<x<L$.

So the Fourier series of $F(x)$ is a Fourier cosine series $$F(x)\sim \frac{1}{2}a_0+\sum^\infty_{n=1}a_n\cos \frac{n\pi x}{L}, $$ with coefficients being $$\displaystyle  a_0=\frac{1}{L}\int^L_{-L} F(x)dx=\boxed{\frac{2}{L}\int^L_0 f(x)dx}$$ and $$\displaystyle \begin{align}a_n&=\frac{1}{L}\int^L_{-L}  F(x)\cos \frac{n\pi x}{L} dx,\quad n=1,2,3\ldots\\&=\boxed{\frac{2}{L}\int^L_0  f(x)\cos \frac{n\pi x}{L} dx},\quad n=1,2,3\ldots.\end{align}$$
p.572

### Odd extension
Similarly, if we define $$F(x)=\left\{\begin{array}{ll}-f(-x),&-L<x<0\\f(x),&0<x<L\end{array}\right.,$$ then the Fourier series of $F(x)$ is a Fourier sine series $$f(x)\sim \sum^\infty_{n=1}b_n\sin \frac{n\pi x}{L},$$ where $$\displaystyle \begin{align}b_n&=\frac{1}{L}\int^L_{-L} F(x)\sin \frac{n\pi x}{L} dx,\quad n=1,2,3\ldots.\\&=\boxed{\frac{2}{L}\int^L_0  f(x)\sin \frac{n\pi x}{L} dx},\quad n=1,2,3\ldots.\end{align}$$

In conclusion,
![](https://i.imgur.com/6M2SfAP.png)

### Example 
$f(x)=x,\quad 0<x<L$
Find its Fourier cosine series and Fourier sine series.
#### solution
1. Fourier cosine series
    
    $\displaystyle a_0=\frac{2}{L}\int^L_0 x\ dx=\frac{2}{L}\left[\frac{1}{2}x^2\right]^L_0=L$
    $\begin{align}\displaystyle a_n&=\frac{2}{L}\int^L_0  x\ \cos \frac{n\pi x}{L} dx=\cdots\\&=\frac{2L}{n^2\pi^2}\left[\frac{(-1)^n}{\cos n\pi}-1\right]=\left\{\begin{array}{ll}0,&n\text{ even}\\\dfrac{-4L}{n^2\pi^2},&\text{ odd}\end{array}\right.\end{align}$
    
    The Fourier cosine series is $$\displaystyle \frac{1}{2}L+\sum^\infty_{k=1}\dfrac{-4L}{(2k-1)^2\pi^2}\cos \frac{(2k-1)\pi x}{L}.$$
    
2. Fourier sine series
    $\begin{align}\displaystyle b_n&=\frac{2}{L}\int^L_0 x \sin \frac{n\pi x}{L} dx=\cdots\\&=\frac{2L}{n\pi}(-1)^{n+1}\end{align}$
    The Fourier sine series is $$\displaystyle \sum^\infty_{n=1}\frac{2(-1)^{n+1}L}{n\pi}\sin \frac{n\pi x}{L}.$$
    
### Thm.
$f$ p-smooth on $(0,L)$
1. Fourier cosine series converges to $\frac{f(x+)+f(x-)}{2}$,
    But $f(0+)=f(0-)$
    $\therefore$
    - at $x=0$, the series converges to $f(0+)$;
    - at $x=L$, the series converges to $f(L-)$.

2. Fourier sine series converges to $\frac{f(x+)+f(x-)}{2}$
    But $f(0+)=f(0-)$,
    $\therefore$
    - at $x=0$, the series converges to $0$;
    - at $x=L$, the series converges to $0$.


### Example
The Fourier cosine series of $f(x)=x,\quad 0<x<\pi$ is $$\displaystyle \frac{\pi}{2}-\frac{4}{\pi}\sum^\infty_{k=1}\frac{\cos[(2k-1)x]}{(2k-1)^2}.$$ Since it is continuous at each point for $0<x<\pi$, it converges to $f(x)$ at each point for $0<x<\pi$.

The Fourier sine series of $f(x)=x,\quad 0<x<\pi$ is $$\displaystyle 2\sum^\infty_{n=1}\frac{(-1)^{n+1}\sin nx}{n}.$$
at $x=\pi\pm 2k\pi$ converges to $0$
at $x=0\pm 2k\pi$ converges to $0$
elsewhere converges to $f(x)$
![](https://i.imgur.com/sDUdDcz.png =250x)


### Thm. (termwise diff/int)
(p.574)
Suppose that: 
- $f$ is continuous $\forall x$
- $f$ is preiodic with period $2L$
- $f'$ is piecewise smooth $\forall x$

 $\displaystyle  f(x)=\frac{1}{2}a_0+\sum^\infty_{n=1}\left(a_n\cos \frac{n\pi x}{L}+b_n\sin \frac{n\pi x}{L}\right)$
 
 Then, $\displaystyle f'(x)=\frac{n\pi}{L}\sum^\infty_{n=1}\left(-a_n \sin\frac{n\pi x}{L}+b_n\cos \frac{n\pi x}{L}\right)$
 
## PDE
![](https://i.imgur.com/Nserq2W.png)





