Week 13

Tutorial 13: Heat & Wave Equations



⚠️
Notice the question changed in Question 1.
  1. Solve the heat equation
    1. 2ut22ux2=0,0<x<2,t>0\frac{\partial^2 u}{\partial t^2}-\frac{\partial^{2} u}{\partial x^{2}}=0, \quad 0<x<2, t>0
      subject to
      u(0,t)=u(1,t)=0t>0u(x,0)=πx0<x<2\begin{array}{ll} u(0, t)=u(1, t)=0 & t>0 \\ u(x, 0)=\pi x & 0<x<2 \end{array}
      👉
      Solution
      2ux2=2ut2\frac{\partial^2 u}{\partial x^2}=\frac{\partial^2u}{\partial t^2}
      Suppose u(x,t)=XTu(x,t)=XT
      ux=XTut=XT2ux2=XT2ut2=XT\begin{alignat*}{3}\frac{\partial u}{\partial x}&=X'T\qquad\qquad\frac{\partial u}{\partial t}&&=XT'\\\frac{\partial^2u}{\partial x^2}&=X''T\qquad\qquad\frac{\partial^2 u}{\partial t^2}&&=XT''\end{alignat*}
      XT=XTXX=TT=λ\begin{aligned}X''T&=XT''\\\frac{X''}{X}&=\frac{T''}{T}=-\lambda\end{aligned}
      X+λX=0T+λT=0\begin{align}X''+\lambda X&=0\\T'+\lambda T&=0\end{align}
      Case 1: λ=0\lambda=0
      X=0T=0m2=0m2=0m1,2=0m1,2=0X(x)=C1eCx+C2xeCxT(t)=C3ect+C4eCt=C1+C2x=C3+C4tu(x,t)=XT=(C1+C2x)(C3+C4t)\begin{alignat*}{3}X''&=0\qquad\qquad\quad\qquad\qquad T''&&=0\\m^2&=0\qquad\quad\qquad\qquad\qquad m^2&&=0\\m_{1,2}&=0\qquad\quad\qquad\qquad\qquad m_{1,2}&&=0\\\Rightarrow X(x)&=C_1e^{Cx}+C_2xe^{Cx}\quad \Rightarrow T(t)&&=C_3e^{ct}+C_4e^{Ct}\\&=C_1+C_2x\quad\qquad &&=C_3+C_4t\end{alignat*}\\\therefore u(x,t)=XT=(C_1+C_2x)(C_3+C_4t)
      Case 2: λ<0\lambda<0 (α2-\alpha^2)
      Xα2X=0Tα2T=0m2α2=0m2α2=0m1,2=±αm1,2=±αX(x)=C1coshαx+C2sinhαxT(t)=C3coshαt+C4sinhαtu(x,t)=XT=(C1coshαx+C2sinhαx)(C3coshαt+C4sinhαt)\begin{alignat*}{3}X''-\alpha^2X&=0\qquad\qquad\qquad\qquad\qquad T''-\alpha^2T&&=0\\m^2-\alpha^2&=0\qquad\qquad\qquad\qquad\qquad m^2-\alpha^2&&=0\\m_{1,2}&=\pm\alpha\qquad\qquad\qquad\qquad\quad\qquad m_{1,2}&&=\pm\alpha\\\Rightarrow X(x)&=C_1\cosh\alpha x+C_2\sinh\alpha x\quad\Rightarrow T(t)&&=C_3\cosh\alpha t+C_4\sinh\alpha t\end{alignat*}\\\therefore u(x,t)=XT=(C_1\cosh\alpha x+C_2\sinh\alpha x)(C_3\cosh\alpha t+C_4\sinh\alpha t)
      Case 3: λ>0\lambda>0 (+α2+\alpha^2)
      X+α2X=0T+α2T=0m2+α2=0m2+α2=0m1,2=±αiM1,2=±αiX(x)=C1cosαx+C2sinαxT(t)=C3cosαt+C4sinαtu(x,t)=XT=(C1cosαx+C2sinαx)(X3cosαt+C4sinαt)\begin{alignat*}{3}X''+\alpha^2X&=0\qquad\qquad\qquad\qquad T''+\alpha^2T&&=0\\m^2+\alpha^2&=0\qquad\qquad\qquad\qquad m^2+\alpha^2&&=0\\m_{1,2}&=\pm\alpha i\qquad\qquad\qquad\qquad\quad M_{1,2}&&=\pm\alpha i\\\Rightarrow X(x)&=C_1\cos\alpha x+C_2\sin\alpha x\quad\Rightarrow T(t)&&=C_3\cos\alpha t+C_4\sin\alpha t\end{alignat*}\\\therefore u(x,t)=XT=(C_1\cos\alpha x+C_2\sin\alpha x)(X_3\cos\alpha t+C_4\sin\alpha t)
      Applying the boundary conditions: u(0,t)=0u(0,t)=0, u(1,t)=0u(1,t)=0
      Case 1:
      u(0,t)=(C1+C2(0))(C3+C4t)=C1(C3+C4t)=0C1=0u(x,t)=(C2x)(C3+C4t)u(1,t)=C2(C3+C4t)=0C2=0u(x,t)=C3+C4t\begin{aligned}u(0,t)&=(C_1+C_2(0))(C_3+C_4t)\\&=C_1(C_3+C_4 t)=0\Rightarrow C_1=0\\\Rightarrow u(x,t)&=(C_2x)(C_3+C_4t)\\u(1,t)&=C_2(C_3+C_4t)=0\Rightarrow C_2=0\\\end{aligned}\\\therefore u(x,t)=C_3+C_4t
      Case 2
      u(0,t)=(C1cosh0+C2sinh0)(C3coshαt+C4sinhαt)=0C1=0u(x,t)=(C2sinhαx)(C3coshαt+C4sinhαt)u(1,t)=(C2sinhα)(C3coshαt+C4sinhαt)=0C2sinhα=0C2=0u(x,t)=C3coshαt+C4sinhαt\begin{aligned}u(0,t)&=(C_1\cosh0+C_2\sinh0)(C_3\cosh\alpha t+C_4\sinh\alpha t)=0\Rightarrow C_1=0\\\Rightarrow u(x,t)&=(C_2\sinh\alpha x)(C_3\cosh\alpha t+C_4\sinh\alpha t)\\u(1,t)&=(C_2\sinh\alpha)(C_3\cosh\alpha t+C_4\sinh\alpha t)=0\\C_2\sinh\alpha&=0\Rightarrow C_2=0\end{aligned}\\\therefore u(x,t)=C_3\cosh\alpha t+C_4\sinh\alpha t
      Case 3
      u(0,t)=(C1cos0+C2sin0)(C3cosαt+C4sinαt)=0C1=0u(x,t)=C2sinαx(C3cosαt+C4sinαt)u(1,t)=C2sinα(C3cosαt+C4sinαt)=0C2sinα=0C2=0u(x,t)=C3cosαt+C4sinαt\begin{aligned}u(0,t)&=(C_1\cos0+C_2\sin0)(C_3\cos\alpha t+C_4\sin\alpha t)=0\Rightarrow C_1=0\\\Rightarrow u(x,t)&=C_2\sin\alpha x(C_3\cos\alpha t+C_4\sin\alpha t)\\u(1,t)&=C_2\sin\alpha(C_3\cos\alpha t+C_4\sin\alpha t)=0\\C_2\sin\alpha&=0\Rightarrow C_2=0\end{aligned}\\\therefore u(x,t)=C_3\cos\alpha t+C_4\sin\alpha t
      For non-trivial solutions, let C20C_2\neq0sinα=0\sin\alpha=0α=nπn=1,2,...\alpha=n\pi\quad n=1,2,...
      Eigenvalues:
      αn=αn2=n2π2,n=1,2,...\alpha_n=\alpha_n^2=n^2\pi^2,\quad n=1,2,...
      Eigenvectors:
      X(x)=Cnsinαx=Cnsinnπx,n=1,2,...X(x)=C_n\sin\alpha x=C_n\sin n\pi x, \quad n=1,2,...
      Applying initial conditions: u(x,0)=πxu(x,0)=\pi x, utt=0=0\left.\frac{\partial u}{\partial t}\right|_{t=0}=0
      un(x,t)=(Cnsinnπx)(C3cosαt+C4sinαt),n=1,2,...=(Ancosnπt)+Bnsinnπt)sinnπxu(x,t)=n=1(Ancosnπt+Bnsinnπt)sinnπx\begin{aligned}u_n(x,t)&=(C_n\sin n\pi x)(C_3\cos\alpha t+C_4\sin\alpha t),\quad n=1,2,...\\&=(A_n\cos n\pi t)+B_n\sin n\pi t)\sin n\pi x\\\Rightarrow u(x,t)&=\sum_{n=1}^\infty (A_n\cos n\pi t+B_n\sin n\pi t)\sin n\pi x\end{aligned}
      u(x,0)=n=1(Ancos0+Bnsin0)sinnπx=sinπxn=1Ansinnπx=sinπxAn=2101sinπxsinnπxdx\begin{aligned}u(x,0)=\sum_{n=1}^\infty (A_n\cos 0+B_n\sin0)\sin n\pi x&=\sin\pi x\\\sum_{n=1}^\infty A_n\sin n\pi x&=\sin\pi x\end{aligned}\\\Rightarrow A_n=\frac{2}{1}\int_0^1\sin\pi x\sin n\pi x dx
      An=201sinπxsinnπxdx=20112(cos(πxnπx)cos(πx+nπx))dx=01cos(1n)πxdx=01cos(1+n)πxdx=[sin(1n)πx(1n)πsin(1+n)πx(1+n)π]01=sin(1n)π(1n)πsin(1+n)π(1+n)π,n=1,2,3,...\begin{aligned}A_n&=2\int_0^1\sin\pi x\sin n\pi xdx\\&=2\int_0^1\frac{1}{2}\left(\cos(\pi x-n\pi x)-\cos(\pi x+n\pi x)\right)dx\\&=\int_0^1\cos(1-n)\pi xdx=\int_0^1\cos(1+n)\pi xdx\\&=\left[\frac{\sin(1-n)\pi x}{(1-n)\pi}-\frac{\sin(1+n)\pi x}{(1+n)\pi}\right]_0^1\\&=\frac{\sin(1-n)\pi}{(1-n)\pi}-\frac{\sin(1+n)\pi}{(1+n)\pi},\quad n=1,2,3,...\end{aligned}
      For n=2,3,...n=2,3,..., An=0A_n=0
      For n=1n=1
      A1=20112(cos(11)πxcos(1+1)πx)dx=01(cos0cos2πx)dx=011dx01cos2πxdx=x01sin2πx2π01=1\begin{aligned}A_1&=2\int_0^1\frac{1}{2}(\cos(1-1)\pi x-\cos(1+1)\pi x)dx\\&=\int_0^1(\cos0-\cos 2\pi x)dx\\&=\int_0^11dx-\int_0^1\cos 2\pi xdx\\&=\left.x\right|_0^1-\left.\frac{\sin 2\pi x}{2\pi}\right|_0^1=1\end{aligned}
      ut=n=1(Annπsinnπt+Bnnπcosnπt)sinπxutt=0=n=1(Annπsin0+Bnnπcos0)sinπx=0n=1(Bnnπ)sinπx=0Bn=0\frac{\partial u}{\partial t}=\sum_{n=1}^\infty \left(-A_nn\pi\sin n\pi t+B_nn\pi\cos n\pi t\right)\sin\pi x\\\left.\frac{\partial u}{\partial t}\right|_{t=0}=\sum_{n=1}^\infty(-A_nn\pi\sin0+B_nn\pi\cos0)\sin\pi x=0\\\sum_{n=1}^\infty(B_nn\pi)\sin\pi x=0\Rightarrow B_n=0
      Solution exists only when n=1n=1. Thus,
      u(x,t)=cosπtsinπxu(x,t)=\cos\pi t\sin\pi x
  1. Solve the heat equation
    1. ut1162ux2=0,0<x<1,t>0\frac{\partial u}{\partial t}-\frac{1}{16} \frac{\partial^{2} u}{\partial x^{2}}=0, \quad 0<x<1, t>0
      subject to
      u(0,t)=u(1,t)=0t>0u(x,0)=2sin2πx0<x<1\begin{array}{ll} u(0, t)&=u(1, t)=0 & t>0 \\ u(x, 0)&=2 \sin 2 \pi x & 0<x<1 \end{array}
      👉
      Solution
      Suppose u(x,t)=X(x)T(t)u(x,t)=X(x)T(t)
      ux=XTut=XT2ux2=XT\begin{alignat*}{3}\frac{\partial u}{\partial x}&=X'T\qquad\qquad\frac{\partial u}{\partial t}&&=XT'\\\frac{\partial^2u}{\partial x^2}&=X''T\end{alignat*}
      XT116XT=0XT=116XTX16X=TT=λ\begin{aligned}XT'-\frac{1}{16}X''T&=0\\XT'&=\frac{1}{16}X''T\\\frac{X''}{16X}&=\frac{T'}{T}=-\lambda\end{aligned}
      X+16λX=0T+λT=0\begin{align}X''+16\lambda X&=0\\T'+\lambda T&=0\end{align}
      Case 1: λ=0\lambda=0
      X=0X(x)=C1x+C2u(0,t)=0,X(0)=0=C2u(1,t)=0,X(1)=C1=0X''=0\quad\Rightarrow\quad X(x)=C_1x+C_2\\u(0,t)=0,\quad X(0)=0=C_2\\u(1,t)=0,\quad X(1)=C_1=0
      ⇒ This is a trivial solution.
      Case 2: λ=α2<0\lambda=-\alpha^2<0
      X16α2X=0X(x)=C1cosh(4αx)+C2sinh(4αx)u(0,t)=0,C1=0u(1,t)=0,C2sinh4α=0X''-16\alpha^2X=0\\X(x)=C_1\cosh(4\alpha x)+C_2\sinh(4\alpha x)\\\begin{aligned}u(0,t)=0,\quad &C_1=0\\u(1,t)=0,\quad &C_2\sinh4\alpha=0\end{aligned}
      Since sinh4α0,C2=0\sinh4\alpha\neq0,\quad C_2=0
      ⇒ This is a trivial solution
      Case 3:
      X+16α2X=0X(x)=C1cos(4αx)+C2sin(4αx)u(0,t)=0,C1=0u(1,t)=0,C2=sin4α=0X''+16\alpha^2X=0\\X(x)=C_1\cos(4\alpha x)+C_2\sin(4\alpha x)\\\begin{aligned}u(0,t)=0,\quad&C_1=0\\u(1,t)=0,\quad&C_2=\sin4\alpha=0\end{aligned}
      To obtain non-trivial solution, sin4α=0\sin4\alpha=0
      4α=nπ,n=1,2,3,...α=nπ4,n=1,2,3,...\begin{aligned}4\alpha=n\pi,\quad&n=1,2,3,...\\\alpha=\frac{n\pi}{4},\quad&n=1,2,3,...\end{aligned}
      Eigenvalue:
      λ=α2=n2π216,n=1,2,3,...\lambda=\alpha^2=\frac{n^2\pi^2}{16},\quad n=1,2,3,...
      Eigenfunction:
      Xn(x)=C2sin((nπ4)x)=C2sin(nπx)X_n(x)=C_2\sin\left(\left(\frac{n\pi}{4}\right)x\right)=C_2\sin(n\pi x)
      T+α2T=0T(t)=C3eα2tTn(t)=C3en2π216tT'+\alpha^2T=0\\\begin{aligned}T(t)&=C_3e^{-\alpha^2t}\\T_n(t)&=C_3e^{-\frac{n^2\pi^2}{16}t}\end{aligned}
      un(x,t)=XnTn=Bnen2π216tsin(nπx),n=1,2,3,...u_n(x,t)=X_nT_n=B_ne^{-\frac{n^2\pi^2}{16}t}\sin(n\pi x),\quad n=1,2,3,...
      By superposition principle,
      u(x,t)=n=1Bnen2π216tsin(nπx)u(x,t)=\sum_{n=1}^\infty B_ne^{-\frac{n^2\pi^2}{16}t}\sin(n\pi x)
      Given u(x,0)=2sin(2πx)u(x,0)=2\sin(2\pi x)
      2sin(2πx)=n=1Bnsin(nπx)Bn=2012sin(2πx)sin(nπx)dx\begin{aligned}2\sin(2\pi x)&=\sum_{n=1}^\infty B_n\sin (n\pi x)\\B_n&=2\int_0^12\sin(2\pi x)\sin(n\pi x)dx\end{aligned}
      012sin(2πx)sin(nπx)dx={1,n=20,otherwise\int_0^12\sin(2\pi x)\sin(n\pi x)dx=\begin{cases}1,&n=2\\0,&\text{otherwise}\end{cases}
      Bn={2,n=20,otherwiseB_n=\begin{cases}2,&n=2\\0,&\text{otherwise}\end{cases}
      u(x,t)=B2eπ24tsin(2πx)=2eπ24tsin(2πx)\begin{aligned}\therefore u(x,t)&=B_2e^{-\frac{\pi^2}{4}t}\sin(2\pi x)\\&=2e^{-\frac{\pi^2}{4}t}\sin(2\pi x)\end{aligned}
  1. Solve the wave equation
    1. 2ut22ux2=0,0<x<1,t>0\frac{\partial^{2} u}{\partial t^{2}}-\frac{\partial^{2} u}{\partial x^{2}}=0, \quad 0<x<1, t>0
      subject to the given conditions
      u(0,t)=u(1,t)=0t>0u(x,0)=sinπx,ut(x,0)=00<x<1\begin{aligned} u(0, t)&=u(1, t)=0 & t>0 \\ u(x, 0)&=\sin \pi x, \quad \frac{\partial u}{\partial t}(x, 0)=0 &0<x<1 \end{aligned}
      👉
      Solution
      Suppose u(x,t)=X(x)T(t)u(x,t)=X(x)T(t)
      XTXT=01XX=1TT=λX=λXT=λT\begin{aligned}XT'-X''T&=0\\\frac{1}{X}X''&=\frac{1}{T}T'=-\lambda\end{aligned}\\\therefore X''=-\lambda X\qquad T'=-\lambda T
      u(0,t)=0,X(0)=0u(2,t)=0,X(2)=0u(0,t)=0\quad,\quad\therefore X(0)=0\\u(2,t)=0\quad,\quad\therefore X(2)=0
      For X4+λX=0X^4+\lambda X=0, X(0)=0X(0)=0 and X(2)=0X(2)=0
      Case 1: λ>0\lambda>0
      r1,2=±λiX(x)=C1cos(λx)+C2sin(λx)C1=0,sin(2λ)=0λn=(nπ2)2,n=1,2,3,...r_{1,2}=\pm\sqrt{\lambda}i\\\begin{aligned}X(x)=&C_1\cos(\sqrt{\lambda}x)+C_2\sin(\sqrt{\lambda}x)\\&\Rightarrow C_1=0\quad,\quad\sin(2\sqrt{\lambda})=0\\\end{aligned}\\\\\lambda_n=\left(\frac{n\pi}{2}\right)^2,\quad n=1,2,3,...
      Case 2: λ=0\lambda=0
      X=0X(c)=C1x+C2C1=0,C2=0X''=0\\X(c)=C_1x+C_2\\\Rightarrow C_1=0,\quad C_2=0
      ⇒ Only trivial solution
      Case 3: λ<0\lambda<0
      r1,2=±λX(c)=C1cosh(λx)+C2sinh(λx)C1=0,C2=0r_{1,2}=\pm\sqrt{\lambda}\\X(c)=C_1\cosh(\sqrt{\lambda}x)+C_2\sinh(\sqrt{\lambda}x)\\\Rightarrow C_1=0,\quad C_2=0
      ⇒ Only trivial solution
      For T=λTT’=-\lambda T
      From (1), λ=λn=(nπ2)2\lambda=\lambda_n=\left(\frac{n\pi}{2}\right)^2
      T(t)=C1eλnt,n=1,2,3,...\therefore T(t)=C_1e^{-\lambda_n t}\quad,\quad n=1,2,3,...
      Hence,
      Un(x,t)=Xn(x)Tn(t)=Bnsin(nπx2)e(nπ2)2t,n=1,2,3,...U(x,t)=sinπx2=Bnsin(nπx2)\begin{aligned}U_n(x,t)&=X_n(x)T_n(t)\\&=B_n\sin\left(\frac{n\pi x}{2}\right)e^{-\left(\frac{n\pi}{2}\right)^2t}\quad,\quad n=1,2,3,...\\\\U(x,t)&=\sin\frac{\pi x}{2}=B_n\sin\left(\frac{n\pi x}{2}\right)\end{aligned}
      Thus,
      Bn=02sinπx2sin(nπx2)dx={1,for n=10,for all n1\begin{aligned}B_n&=\int_0^2\sin\frac{\pi x}{2}\cdot\sin\left(\frac{n\pi x}{2}\right)dx\\&=\begin{cases}1,&\text{for }n=1\\0,&\text{for all }n\neq1\end{cases}\end{aligned}
      U(x,t)=sin(πx2)eπ24t\therefore U(x,t)=\sin\left(\frac{\pi x}{2}\right)e^{-\frac{\pi^2}{4}t}