\documentclass[a4paper,12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{amsbsy}
\usepackage{hyperref}
%\usepackage{todonotes}
%\usepackage[disable]{todonotes}
%\usepackage{tikz}
%\usepackage{pgfplots}

%\pgfplotsset{width=7cm,compat=1.16}
\hypersetup{colorlinks=true,allcolors=black}

\theoremstyle{plain}
\begingroup
\newtheorem{teo}{Theorem}[section]
\newtheorem{prop}[teo]{Proposition}
\newtheorem{cor}[teo]{Corollary}
\newtheorem{lem}[teo]{Lemma}
\endgroup

\theoremstyle{definition}
\begingroup
\newtheorem{defin}[teo]{Definition}
\newtheorem{oss}[teo]{Remark}
\newtheorem{exam}[teo]{Example}
\newtheorem{exerc}{Exercise}
\endgroup

\newcommand{\N}{\ensuremath{\mathbb{N}}}

\begin{document}

\section*{Fourier analysis week 4}

Skicka frågor om denna PDF till carljoar@chalmers.se

Lycka till! /CJ

%This week, we will solve EÖ1, 4.2.6 and 4.3.5. Please note that there might be changes to the below solutions. They will be updated, but for now, we publish them so that you see what the tutorials will be like. Happy calculations! /CJ

\begin{exerc}[4.2.6]
	A radioactive rod is initially at zero temperature and its endpoints are kept at zero temperature. Suppose that the reaction that produces
	the heat inside the rod dies out over time, so that the differential equation
	is $u_t=ku_{xx}+Re^{-ct}$. What is the solution?
\end{exerc}

\textit{Solution:}  We need to solve
%
\begin{equation}
\label{eq:radio}
  u_t=ku_{xx}+Re^{-ct},\quad u(x,0)=0,\quad u(0,t)=u(L,t)=0
\end{equation}
%
We can try expanding everything in Fourier sine series (why not cosine?),
\[
  u(x,t)=\sum_1^\infty b_n(t)\sin \frac{n\pi x}{L},\quad Re^{-ct}=\frac{4R}{\pi}\sum_{n\ \mathrm{odd}} \frac{e^{-ct}}{n}\sin \frac{n\pi x}{L}
\]
and insert in~(\ref{eq:radio}) to obtain
\[
  b_n'(t)+\frac{n^2\pi^2k}{L^2}b_n(t)=\frac{4R}{\pi}\frac{e^{-ct}}{n}\qquad n\ \mathrm{odd}
\]
and
\[
  b_n'(t)+\frac{n^2\pi^2k}{L^2}b_n(t)=0\qquad n\ \mathrm{even}.
\]
Equivalently, using the technique with integrating factor %(``We use our human right to multiply by $e^{(...)}$ on both sides.''),
\[
\frac{d}{dt}\left[b_n(t)\exp\frac{n^2\pi^2kt}{L^2}\right]=\frac{4R}{\pi}\frac{e^{-ct}}{n}\exp\frac{n^2\pi^2kt}{L^2}\qquad n\ \mathrm{odd}
\]
and
\[
\frac{d}{dt}\left[b_n(t)\exp\frac{n^2\pi^2kt}{L^2}\right]=0\qquad n\ \mathrm{even}.
\]
Integrating these, we obtain
\[
b_n(t)\exp\frac{n^2\pi^2kt}{L^2}=\frac{4R}{\pi}\frac{1}{n(n^2\pi^2k/L^2-c)}\exp\left(\frac{n^2\pi^2k}{L^2}t-ct\right)+\beta \qquad n\ \mathrm{odd}
\]
and
\[
b_n(t)\exp\frac{n^2\pi^2kt}{L^2}=\gamma \qquad n\ \mathrm{even}.
\]
We may introduce a constant $\alpha$ and write $\beta=-\alpha 4R/[\pi n(n^2\pi^2k/L^2-c)]$ for convenience. So
\[
u(x,t)=\frac{4R}{\pi}\sum_{n\  \mathrm{odd}}\frac{e^{-ct}-\alpha e^{-n^2\pi^2kt/L^2}}{n(n^2\pi^2k/L^2-c)}\sin\frac{n\pi x}{L}+\sum_{n\ \mathrm{even}}\gamma e^{-n^2\pi^2kt/L^2}\sin\frac{n\pi x}{L}
\]
What are the constants $\gamma$ and $\alpha$? We use the initial condition $u(x,0)=0$. Then  
\[
  0=u(x,0)=\frac{4R}{\pi}\sum_{n\  \mathrm{odd}}\frac{1-\alpha }{n(n^2\pi^2k/L^2-c)}\sin\frac{n\pi x}{L}+\sum_{n\ \mathrm{even}}\gamma \sin\frac{n\pi x}{L}.
\]
Hence, $\gamma=0$ and $\alpha=1$. The function $u(x,t)$ then takes the form
\[
 u(x,t)=\frac{4R}{\pi}\sum_{n\  \mathrm{odd}}\frac{e^{-ct}-e^{-n^2\pi^2kt/L^2}}{n(n^2\pi^2k/L^2-c)}\sin\frac{n\pi x}{L}
\]
Can we do all this? How can we motivate that the calculations make sense? Especially, can we differentiate the coefficients $b_n(t)$?


\begin{exerc}
	Funktionen $f$ är 2-periodisk och är lika med $(x+1)^2$ på intervallet $[-1,1]$. Utveckla $f$ i Fourierserie och finn en 2-periodisk lösning till $2y''-y'-y=f$.
\end{exerc}

\textit{Lösning:}
Låt 
\[
f(x)=\sum_{-\infty}^\infty c_n e^{in\pi x}
\]
Här är basfunktionerna valda till $\{\exp in\pi x\}$ vilka är 2-periodiska eftersom 
$$e^{in\pi x}=e^{in\pi[x+2]}=e^{in\pi x}\underbrace{e^{2in\pi}}_{=1}.$$
Vi kan sätta skalärprodukten till 
\[
\langle f,g\rangle = \frac{1}{2}\int_{-1}^1 f(x)\bar{g}(x) dx
\]
för att $\{\exp in\pi x\}$ ska bli en ON-bas för $L^2(-1,1)$. (Folland kallar detta rum $L^2_w$, där $w=1/2$, se kapitel 3.4.) Skåda!
\[
\langle e^{in\pi \cdot},e^{im\pi \cdot}\rangle = \frac{1}{2}\int_{-1}^1 e^{i(n-m)\pi x} dx
=
\begin{cases}
  1, & n=m \\
  0, & n\neq m
\end{cases}
\]
Här använde vi att $n-m$ är ett heltal så att
\[
n\neq m\implies \frac{1}{2}\int_{-1}^1 e^{i(n-m)\pi x} dx = \frac{1}{2}\left[\frac{e^{i(n-m)\pi t}}{i(n-m)\pi}\right]_{-1}^1=\frac{1}{2}e^{2i(n-m)\pi}\frac{e^{2i(n-m)\pi}-1}{i(n-m)\pi}=0
\]
eftersom $\exp(2i(n-m)\pi)=1$. Nu när vi har övertygat oss om att vi har en ON-bas kan vi köra på som vanligt:
\[
  c_m=\langle f,e^{im\pi \cdot}\rangle = \frac{1}{2}\int_{-1}^1 (t+1)^2 e^{-im\pi t} dt = \frac{1}{2}\int_{-1}^1 (t^2+2t+1) e^{-im\pi t} dt
\]
Denna integral beräknas med partiell integration om $n\neq 0$. Om $n=0$ är 
\[
c_0= \frac{1}{2}\int_{-1}^1 (t^2+2t+1) dt = \frac{4}{3}.
\]
Om $n\neq 0$ är 
\[
c_m = \frac{2(-1)^n(1+in\pi)}{n^2\pi^2}.
\]
Alltså är 
\[
f(x)=\frac{4}{3} + \sum_{n\in\N\setminus\{0\}}\frac{2(-1)^n(1+in\pi)}{n^2\pi^2}e^{in\pi x}.
\]
För att lösa $2y''-y'-y=f$ ansätter vi 
\[
  y(x)=\sum_{-\infty}^\infty y_n e^{in\pi x}
\]
Insättning i differentialekvationen ger
\[
  (-2n^2\pi^2-in\pi -1)y_n=c_n \quad \forall n\in\{...,-2-1,0,1,2,...\}
\]
Om $n=0$ ges $y_0=-c_0=-4/3$. Samla ihop resultaten:
\[
  y(x)=-\frac{4}{3} + \sum_{n\in\N\setminus\{0\}} \frac{2(-1)^{n+1}(1+in\pi)}{\pi^2n^2(2n^2\pi^2+in\pi+1)}e^{in\pi x}
\]


\end{document}