Find the solution to \(y^{\prime \prime }-y=e^{x},y\left ( 0\right ) =1,y\left ( 1\right ) =0\)
solution
The solution to the homogeneous ODE is \(y_{h}=Ae^{x}+Be^{-x}\). Let the particular be \(y_{p}=Cxe^{x}\). Hence \(y_{p}^{\prime }=Ce^{x}+Cxe^{x}\) and \(y_{p}^{\prime \prime }=Ce^{x}+Ce^{x}+Cxe^{x}\). Substituting into the ODE gives\begin{align*} 2Ce^{x}+Cxe^{x}-Cxe^{x} & =e^{x}\\ 2C & =1\\ C & =\frac{1}{2} \end{align*}
Hence \(y_{p}=\frac{1}{2}xe^{x}\) and the complete solution is \[ y=Ae^{x}+Be^{-x}+\frac{1}{2}xe^{x}\] \(A,B\) are now found from boundary conditions. At \(x=0\)\begin{equation} 1=A+B \tag{1} \end{equation} And at \(x=1\)\begin{equation} 0=Ae+Be^{-1}+\frac{1}{2}e \tag{2} \end{equation} (1,2) are now solved for \(A,B\). From (1), \(A=1-B.\) (2) becomes\begin{align*} 0 & =\left ( 1-B\right ) e+Be^{-1}+\frac{1}{2}e\\ & =e-Be+Be^{-1}+\frac{1}{2}e\\ & =B\left ( e^{-1}-e\right ) +\frac{3}{2}e\\ B & =-\frac{3}{2}\frac{e}{e^{-1}-e}\\ & =\frac{3}{2}\frac{e}{e-e^{-1}} \end{align*}
Hence \begin{align*} A & =1-\frac{3e}{2\left ( e-e^{-1}\right ) }=\frac{2\left ( e-e^{-1}\right ) -3e}{2\left ( e-e^{-1}\right ) }\\ & =\frac{2e-2e^{-1}-3e}{2\left ( e-e^{-1}\right ) }\\ & =\frac{-e-2e^{-1}}{2\left ( e-e^{-1}\right ) }\\ & =\frac{e+2e^{-1}}{2\left ( e^{-1}-e\right ) } \end{align*}
Therefore the solution is\begin{align*} y & =Ae^{x}+Be^{-x}+\frac{1}{2}xe^{x}\\ & =\frac{e+2e^{-1}}{2\left ( e^{-1}-e\right ) }e^{x}+\frac{3}{2}\frac{e}{e-e^{-1}}e^{-x}+\frac{1}{2}xe^{x} \end{align*}
Find Fourier cosine series for \[ f\left ( x\right ) =\left \{ \begin{array} [c]{ccc}x & & 0<x<1\\ 1 & & 1<x<2 \end{array} \right . \] Choose \(L=2\). Apply the Fourier convergence theorem. What do we get at \(x=1\)?
solution
For cosine series, the function is even extended from \(x=-2\cdots 2\). Therefore only \(a_{n}\) terms exist.\[ f\left ( x\right ) =\frac{a_{0}}{2}+\sum _{n=1}^{\infty }a_{n}\cos \left ( \frac{n\pi }{L}x\right ) \] Where \(L=2\). But \(\frac{a_{0}}{2}\) is average value. Since the area is \(2\left ( \frac{1}{2}+1\right ) =3\), then the average is \(\frac{3}{4}\), since the extent is \(4\). Therefore \(a_{0}=\frac{3}{2}\). To find \(a_{n}\)\[ a_{n}=\frac{1}{L}\int _{-L}^{L}f\left ( x\right ) \cos \left ( \frac{n\pi }{L}x\right ) dx \] But \(f\left ( x\right ) \) and cosine are even. Hence the above simplifies to\begin{align*} a_{n} & =\int _{0}^{2}f\left ( x\right ) \cos \left ( \frac{n\pi }{2}x\right ) dx\\ & =\left ( \int _{0}^{1}x\cos \left ( \frac{n\pi }{2}x\right ) dx+\int _{1}^{2}\cos \left ( \frac{n\pi }{2}x\right ) dx\right ) \end{align*}
But \(\int x\cos axdx=\frac{\cos ax}{a^{2}}+\frac{x\sin ax}{a}\), therefore \begin{align*} \int _{0}^{1}x\cos \left ( \frac{n\pi }{2}x\right ) dx & =\left ( \frac{\cos \left ( \frac{n\pi }{2}x\right ) }{\left ( \frac{n\pi }{2}\right ) ^{2}}+\frac{x\sin \left ( \frac{n\pi }{2}x\right ) }{\frac{n\pi }{2}}\right ) _{0}^{1}\\ & =\left ( \frac{2}{n\pi }\right ) ^{2}\left ( \cos \left ( \frac{n\pi }{2}x\right ) +\frac{n\pi }{2}x\sin \left ( \frac{n\pi }{2}x\right ) \right ) _{0}^{1}\\ & =\left ( \frac{2}{n\pi }\right ) ^{2}\left ( \cos \left ( \frac{n\pi }{2}\right ) +\frac{n\pi }{2}\sin \left ( \frac{n\pi }{2}\right ) -1\right ) \end{align*}
And\begin{align*} \int _{1}^{2}\cos \left ( \frac{n\pi }{2}x\right ) dx & =\left ( \frac{\sin \frac{n\pi }{2}x}{\frac{n\pi }{2}}\right ) _{1}^{2}\\ & =\frac{2}{n\pi }\left ( \sin n\pi -\sin \frac{n\pi }{2}\right ) \\ & =-\frac{2}{n\pi }\sin \frac{n\pi }{2} \end{align*}
Hence\begin{align*} a_{n} & =\left ( \frac{2}{n\pi }\right ) ^{2}\left ( \cos \left ( \frac{n\pi }{2}\right ) +\frac{n\pi }{2}\sin \left ( \frac{n\pi }{2}\right ) -1\right ) -\frac{2}{n\pi }\sin \frac{n\pi }{2}\\ & =\left ( \frac{2}{n\pi }\right ) ^{2}\cos \left ( \frac{n\pi }{2}\right ) +\left ( \frac{2}{n\pi }\right ) \sin \left ( \frac{n\pi }{2}\right ) -\left ( \frac{2}{n\pi }\right ) ^{2}-\frac{2}{n\pi }\sin \left ( \frac{n\pi }{2}\right ) \\ & =\frac{2}{n^{2}\pi ^{2}}\left ( -2+2\cos \left ( \frac{n\pi }{2}\right ) +n\pi \sin \left ( \frac{n\pi }{2}\right ) \right ) \end{align*}
Which simplifies to \(a_{n}=-\frac{8\sin \left ( \frac{n\pi }{4}\right ) ^{2}}{n^{2}\pi ^{2}}\). Therefore\begin{align*} f\left ( x\right ) & =\frac{3}{4}-\frac{8}{\pi ^{2}}\sum _{n=1}^{\infty }\frac{1}{n^{2}}\sin \left ( \frac{n\pi }{4}\right ) ^{2}\cos \left ( \frac{n\pi }{2}x\right ) \\ & =\frac{3}{4}-\frac{8}{\pi ^{2}}\sin \left ( \frac{\pi }{4}\right ) ^{2}\cos \left ( \frac{\pi }{2}x\right ) -\frac{8}{\pi ^{2}}\frac{1}{4}\sin \left ( \frac{2\pi }{4}\right ) ^{2}\cos \left ( \pi x\right ) -\cdots \\ & =\frac{3}{4}-\frac{4}{\pi ^{2}}\cos \left ( \frac{\pi }{2}x\right ) -\frac{2}{\pi ^{2}}\cos \left ( \pi x\right ) -\cdots \end{align*}
At \(x=1\)\begin{align*} f\left ( 1\right ) & =\frac{3}{4}-\frac{8}{\pi ^{2}}\sum _{n=1}^{\infty }\frac{1}{n^{2}}\sin \left ( \frac{n\pi }{4}\right ) ^{2}\cos \left ( \frac{n\pi }{2}\right ) \\ & =\frac{3}{4}-\frac{8}{\pi ^{2}}\sum _{n=1}^{\infty }\frac{1}{n^{2}}\sin \left ( \frac{n\pi }{4}\right ) ^{2}\cos \left ( \frac{n\pi }{2}\right ) \end{align*}
In the limit, \(\sum _{n=1}^{\infty }\frac{1}{n^{2}}\sin \left ( \frac{n\pi }{4}\right ) ^{2}\cos \left ( \frac{n\pi }{2}\right ) =-\frac{\pi ^{2}}{32}\). Therefore the above becomes\begin{align*} f\left ( 1\right ) & =\frac{3}{4}+\frac{8}{\pi ^{2}}\frac{\pi ^{2}}{32}\\ & =\frac{3}{4}+\frac{1}{4}\\ & =1 \end{align*}
Which is the value of original \(f\left ( x\right ) \) at \(1\) as expected.
To apply Fourier convergence theorem. The function \(f\left ( x\right ) \) is piecewise continuous over \(-2<x<2\).\[ f^{\prime }\left ( x\right ) =\left \{ \begin{array} [c]{ccc}1 & & 0<x<1\\ 0 & & 1<x<2 \end{array} \right . \] \(f^{\prime }\left ( x\right ) \) is also piecewise continuous. Therefore, the Fourier series of \(f\left ( x\right ) \) will converge to the average of \(f\left ( x\right ) \) at each point.
Find Fourier sine series for \[ f\left ( x\right ) =\left \{ \begin{array} [c]{ccc}x & & 0<x<1\\ 1 & & 1<x<2 \end{array} \right . \] Choose \(L=2\).
solution
For sine series, the function is odd extended from \(x=-2\cdots 2\). Therefore only \(b_{n}\) terms exist.\[ f\left ( x\right ) =\sum _{n=1}^{\infty }b_{n}\sin \left ( \frac{n\pi }{L}x\right ) \] Where \(L=2\). To find \(b_{n}\)\[ b_{n}=\frac{1}{2}\int _{-2}^{2}f\left ( x\right ) \sin \left ( \frac{n\pi }{L}x\right ) dx \] But \(f\left ( x\right ) \) is now odd, and sine is odd, hence the product is even and the above simplifies to\begin{align*} b_{n} & =\int _{0}^{2}f\left ( x\right ) \sin \left ( \frac{n\pi }{2}x\right ) dx\\ & =\left ( \int _{0}^{1}x\sin \left ( \frac{n\pi }{2}x\right ) dx+\int _{1}^{2}\sin \left ( \frac{n\pi }{2}x\right ) dx\right ) \end{align*}
But \(\int x\sin axdx=\frac{\sin ax}{a^{2}}-\frac{x\cos ax}{a}\), therefore \begin{align*} \int _{0}^{1}x\sin \left ( \frac{n\pi }{2}x\right ) dx & =\left ( \frac{\sin \left ( \frac{n\pi }{2}x\right ) }{\left ( \frac{n\pi }{2}\right ) ^{2}}-\frac{x\cos \left ( \frac{n\pi }{2}x\right ) }{\frac{n\pi }{2}}\right ) _{0}^{1}\\ & =\left ( \frac{2}{n\pi }\right ) ^{2}\left ( \sin \left ( \frac{n\pi }{2}x\right ) -\frac{n\pi }{2}x\cos \left ( \frac{n\pi }{2}x\right ) \right ) _{0}^{1}\\ & =\left ( \frac{2}{n\pi }\right ) ^{2}\left ( \sin \left ( \frac{n\pi }{2}\right ) -\frac{n\pi }{2}\cos \left ( \frac{n\pi }{2}\right ) \right ) \end{align*}
And\begin{align*} \int _{1}^{2}\sin \left ( \frac{n\pi }{2}x\right ) dx & =-\left ( \frac{\cos \frac{n\pi }{2}x}{\frac{n\pi }{2}}\right ) _{1}^{2}\\ & =-\frac{2}{n\pi }\left ( \cos n\pi -\cos \frac{n\pi }{2}\right ) \end{align*}
Therefore\begin{align*} b_{n} & =\left ( \frac{2}{n\pi }\right ) ^{2}\left ( \sin \left ( \frac{n\pi }{2}\right ) -\frac{n\pi }{2}\cos \left ( \frac{n\pi }{2}\right ) \right ) -\frac{2}{n\pi }\left ( \cos n\pi -\cos \frac{n\pi }{2}\right ) \\ & =-\frac{2\left ( n\pi \cos n\pi -2\sin \frac{n\pi }{2}\right ) }{n^{2}\pi ^{2}} \end{align*}
Therefore\[ f\left ( x\right ) =\frac{2}{\pi ^{2}}\sum _{n=1}^{\infty }\frac{2\sin \frac{n\pi }{2}-n\pi \cos n\pi }{n^{2}}\sin \left ( \frac{n\pi }{L}x\right ) \] As in problem 2, both \(f\left ( x\right ) \) and \(f^{\prime }\left ( x\right ) \) are P.W.C. So F.S. converges to average of \(f\left ( x\right ) \) at all points.
Solve heat PDE \(u_{t}=u_{xx}\) with boundary conditions \(u_{x}\left ( 0,t\right ) =0,u_{x}\left ( 2,t\right ) =0\) and initial conditions \(u\left ( x,0\right ) =f\left ( x\right ) \) with \(f\left ( x\right ) \) from problem 2. Find steady state solution.\[ f\left ( x\right ) =\left \{ \begin{array} [c]{ccc}x & & 0<x<1\\ 1 & & 1<x<2 \end{array} \right . \]
solution
When both ends are insulated the solution to the heat PDE is\[ u\left ( x,t\right ) =\frac{c_{0}}{2}+\sum _{n=1}^{\infty }c_{n}e^{-\lambda _{n}t}\cos \left ( \sqrt{\lambda _{n}}x\right ) \] Where \(\lambda _{n}=\left ( \frac{n\pi }{L}\right ) ^{2}\) with \(n=1,2,3,\cdots \). Since \(L=2\), then\[ u\left ( x,t\right ) =\frac{c_{0}}{2}+\sum _{n=1}^{\infty }c_{n}e^{-\left ( \frac{n\pi }{2}\right ) ^{2}t}\cos \left ( \frac{n\pi }{2}x\right ) \] At \(t=0\)\begin{equation} f\left ( x\right ) =\frac{c_{0}}{2}+\sum _{n=1}^{\infty }c_{n}\cos \left ( \frac{n\pi }{2}x\right ) \tag{1} \end{equation} But the F.S. of \(f\left ( x\right ) \) was found in problem 2, with even extension. It is\begin{equation} f\left ( x\right ) =\frac{3}{4}-\sum _{n=1}^{\infty }\frac{8}{\pi ^{2}n^{2}}\sin \left ( \frac{n\pi }{4}\right ) ^{2}\cos \left ( \frac{n\pi }{2}x\right ) \tag{2} \end{equation} Comparing (1) and (2) gives\begin{align*} \frac{c_{0}}{2} & =\frac{3}{4}\\ c_{n} & =\frac{8}{\pi ^{2}n^{2}}\sin \left ( \frac{n\pi }{4}\right ) ^{2} \end{align*}
Hence solution is\[ u\left ( x,t\right ) =\frac{3}{4}+\sum _{n=1}^{\infty }\frac{8}{\pi ^{2}n^{2}}\sin \left ( \frac{n\pi }{4}\right ) ^{2}e^{-\left ( \frac{n\pi }{2}\right ) ^{2}t}\cos \left ( \frac{n\pi }{2}x\right ) \] At steady state, the solution is \[ u\left ( x,\infty \right ) =\frac{3}{4}\] Since as \(t\rightarrow \infty \), the term \(e^{-\left ( \frac{n\pi }{2}\right ) ^{2}t}\rightarrow 0\).
Solve heat PDE \(u_{t}=u_{xx}\) with boundary conditions \(u\left ( 0,t\right ) =t,u\left ( \pi ,t\right ) =0\) and initial conditions \(u\left ( x,0\right ) =0\)
solution
Since boundary conditions are nonhomogeneous, the PDE is converted to one with homogenous BC using a reference function. The reference function needs to only satisfy the nonhomogeneous B.C.
In this case, it is clear that the following function satisfies the nonhomogeneous B.C.\[ r\left ( x,t\right ) =t\left ( 1-\frac{x}{\pi }\right ) \] Therefore\[ u\left ( x,t\right ) =w\left ( x,t\right ) +r\left ( x,t\right ) \] Substituting this back into \(u_{t}=u_{xx}\) gives\[ w_{t}+r_{t}=w_{xx}+r_{xx}\] but \(r_{t}=1-\frac{x}{\pi }\) and \(r_{xx}=0\), therefore the above simplifies to\begin{align} w_{t} & =w_{xx}+\frac{x}{\pi }-1\nonumber \\ w_{t} & =w_{xx}+Q\left ( x\right ) \tag{1} \end{align}
Where \(Q\left ( x\right ) =\frac{x}{\pi }-1\) and where now this PDE now has now homogenous B.C\begin{align*} w\left ( 0,t\right ) & =0\\ w\left ( \pi ,t\right ) & =0 \end{align*}
Since a source term exist in the PDE (nonhomogeneous in the PDE itself), then equation (1) is solved using the method of eigenfunction expansion. Let \[ w\left ( x,t\right ) =\sum a_{n}\left ( t\right ) \Phi _{n}\left ( x\right ) \] Where \(\Phi _{n}\left ( x\right ) \) is the eigenfunction of the homogeneous PDE \(w_{t}=w_{xx}\), which is known to be have the eigenfunction \(\Phi _{n}\left ( x\right ) =\sin \left ( \sqrt{\lambda _{n}}x\right ) =\sin nx\) where the eigenvalues are known to be \(\lambda _{n}=\left ( \frac{n\pi }{\pi }\right ) ^{2}=n^{2}\) with \(n=1,2,3,\cdots \). Therefore the above becomes\begin{equation} w\left ( x,t\right ) =\sum a_{n}\left ( t\right ) \sin \left ( nx\right ) \tag{1A} \end{equation} Substituting this back into (1) gives\[ \sum a_{n}^{\prime }\left ( t\right ) \Phi _{n}\left ( x\right ) =\sum a_{n}\left ( t\right ) \Phi _{n}^{\prime \prime }\left ( x\right ) +\sum q_{n}\Phi _{n}\left ( x\right ) \] Where \(Q\left ( x\right ) =\sum q_{n}\Phi _{n}\left ( x\right ) \) is the eigenfunction expansion of the source term. In the above, and after replacing \(\Phi _{n}^{\prime \prime }\left ( x\right ) \) by \(-\lambda _{n}\Phi _{n}\left ( x\right ) \) since \(\Phi _{n}\left ( x\right ) \) satisfies the eigenvalue PDE \(\Phi _{n}^{\prime \prime }\left ( x\right ) +\lambda _{n}\Phi _{n}\left ( x\right ) =0\) the above becomes\begin{align} \sum a_{n}^{\prime }\left ( t\right ) \Phi _{n}\left ( x\right ) & =-\sum a_{n}\left ( t\right ) \lambda _{n}\Phi _{n}\left ( x\right ) +\sum q_{n}\Phi _{n}\left ( x\right ) \nonumber \\ a_{n}^{\prime }\left ( t\right ) & =-a_{n}\left ( t\right ) \lambda _{n}+q_{n}\nonumber \\ a_{n}^{\prime }\left ( t\right ) +a_{n}\left ( t\right ) \lambda _{n} & =q_{n}\tag{2} \end{align}
\(q_{n}\) is now found by applying orthogonality on \(Q\left ( x\right ) =\sum q_{n}\Phi _{n}\left ( x\right ) \) as follows\begin{align*} Q\left ( x\right ) & =\sum _{n=1}^{\infty }q_{n}\Phi _{n}\left ( x\right ) \\ \int _{0}^{\pi }Q\left ( x\right ) \Phi _{n}\left ( x\right ) dx & =\frac{\pi }{2}q_{n}\\ q_{n} & =\frac{2}{\pi }\int _{0}^{\pi }\left ( \frac{x}{\pi }-1\right ) \sin \left ( nx\right ) dx\\ & =\frac{2}{\pi }\left ( \frac{-n\pi +\sin \left ( n\pi \right ) }{n^{2}\pi }\right ) \\ & =\frac{2}{\pi }\left ( \frac{-n\pi }{n^{2}\pi }\right ) \\ & =\frac{-2}{n\pi } \end{align*}
Equation (2) becomes\[ a_{n}^{\prime }\left ( t\right ) +a_{n}\left ( t\right ) n^{2}=\frac{-2}{n\pi }\] The solution to this first order ODE can be easily found as\begin{equation} a_{n}\left ( t\right ) =-\frac{2}{n^{3}\pi }+a_{n}\left ( 0\right ) e^{-n^{2}t}\tag{3} \end{equation} Therefore (1A) becomes\begin{equation} w\left ( x,t\right ) =\sum _{n=1}^{\infty }\left ( -\frac{2}{n^{3}\pi }+a_{n}\left ( 0\right ) e^{-n^{2}t}\right ) \sin \left ( nx\right ) \tag{4} \end{equation} At time \(t=0\) the above becomes\begin{equation} w\left ( x,0\right ) =\sum _{n=1}^{\infty }\left ( -\frac{2}{n^{3}\pi }+a_{n}\left ( 0\right ) \right ) \sin \left ( nx\right ) \tag{5} \end{equation} But \begin{align*} w\left ( x,0\right ) & =u\left ( x,0\right ) -r\left ( x,0\right ) \\ & =0-0\\ & =0 \end{align*}
Therefore (5) becomes\[ 0=\sum _{n=1}^{\infty }\left ( -\frac{2}{n^{3}\pi }+a_{n}\left ( 0\right ) \right ) \sin \left ( nx\right ) \] Which implies\[ a_{n}\left ( 0\right ) =\frac{2}{n^{3}\pi }\] Hence from (4)\begin{equation} w\left ( x,t\right ) =\sum _{n=1}^{\infty }\frac{2}{n^{3}\pi }\left ( e^{-n^{2}t}-1\right ) \sin \left ( nx\right ) \tag{6} \end{equation} The complete solution is therefore\begin{align*} u\left ( x,t\right ) & =w\left ( x,t\right ) +r\left ( x,t\right ) \\ & =t\left ( 1-\frac{x}{\pi }\right ) +\sum _{n=1}^{\infty }\frac{2}{n^{3}\pi }\left ( e^{-n^{2}t}-1\right ) \sin \left ( nx\right ) \end{align*}
Solve wave PDE \(u_{tt}=4u_{xx}\) on bounded domain \(0<x<\pi ,t>0\) with boundary conditions \(u\left ( 0,t\right ) =0,u\left ( \pi ,t\right ) =0\) and initial conditions \(u\left ( x,0\right ) =\sin ^{2}x,u_{t}\left ( x,0\right ) =0\). Find d’Alembert solution and Fourier series solution.
solution
Putting the PDE in standard form \(u_{tt}=a^{2}u_{xx}\) shows that \(a=2.\) Let \(f\left ( x\right ) =u\left ( x,0\right ) =\sin ^{2}x\) and \(g\left ( x\right ) =u_{t}\left ( x,0\right ) =0\), then the d’Alembert solution is (per key solution, one must use the sign function). Let \(F\left ( x\right ) =sign\left ( \sin x\right ) \sin ^{2}x\), then the solution becomes \begin{align*} u\left ( x,t\right ) & =\frac{1}{2}\left ( F\left ( x+at\right ) +F\left ( x-at\right ) \right ) +\frac{1}{2a}\int _{x-at}^{x+at}g\left ( s\right ) ds\\ & =\frac{1}{2}\left ( F\left ( x+at\right ) +F\left ( x-at\right ) \right ) \end{align*}
Now the Fourier solution is found. Applying separation of variables gives\begin{align*} T^{\prime \prime }X & =4X^{\prime \prime }T\\ \frac{1}{4}\frac{T^{\prime \prime }}{T} & =\frac{X^{\prime \prime }}{X}=-\lambda \end{align*}
The eigenvalue ODE is \(X^{\prime \prime }+\lambda X=0\) with \(X\left ( 0\right ) =0,X\left ( \pi \right ) =0\). This has eigenfunctions \(\Phi _{n}\left ( x\right ) =\sin \left ( \sqrt{\lambda _{n}}x\right ) \) with \(\lambda _{n}=n^{2}\) where \(n=1,2,3,\cdots \). The time ODE becomes\[ T^{\prime \prime }+4\lambda _{n}T=0 \] Since \(\lambda _{n}>0\), the solution is\begin{align*} T\left ( t\right ) & =A_{n}\cos \left ( \sqrt{4\lambda _{n}}t\right ) +B_{n}\sin \left ( \sqrt{4\lambda _{n}}t\right ) \\ & =A_{n}\cos \left ( 2nt\right ) +B_{n}\sin \left ( 2nt\right ) \end{align*}
And \[ T^{\prime }=-2nA_{n}\sin \left ( 2nt\right ) +2nB_{n}\cos \left ( 2nt\right ) \] Since \(T^{\prime }\left ( 0\right ) =0\), then the above implies that \(B_{n}=0\). Therefore the solution simplifies to\[ T_{n}\left ( t\right ) =A_{n}\cos \left ( 2nt\right ) \] And the fundamental solution becomes\begin{align*} u_{n} & =T_{n}X_{n}\\ & =c_{n}\cos \left ( 2nt\right ) \sin \left ( nx\right ) \end{align*}
Hence by superposition, the general solution is\[ u\left ( x,t\right ) =\sum _{n=1}^{\infty }c_{n}\cos \left ( 2nt\right ) \sin \left ( nx\right ) \] At \(t=0\), \(u\left ( x,0\right ) =\sin ^{2}x\), therefore the above becomes\[ \sin ^{2}x=\sum _{n=1}^{\infty }c_{n}\sin \left ( nx\right ) \] Applying orthogonality gives\begin{align} \int _{0}^{\pi }\sin ^{2}x\sin \left ( nx\right ) dx & =c_{n}\frac{\pi }{2}\tag{1}\\ \int _{0}^{\pi }\left ( \frac{1}{2}-\frac{1}{2}\cos 2x\right ) \sin \left ( nx\right ) dx & =c_{n}\frac{\pi }{2}\nonumber \end{align}
To evaluate \(\int _{0}^{\pi }\left ( \frac{1}{2}-\frac{1}{2}\cos 2x\right ) \sin \left ( nx\right ) dx\), it is split into \(\int _{0}^{\pi }\left ( \frac{1}{2}\sin \left ( nx\right ) -\frac{1}{2}\cos 2x\sin \left ( nx\right ) \right ) dx\). But the first part is \begin{align*} \int _{0}^{\pi }\frac{1}{2}\sin \left ( nx\right ) dx & =-\frac{1}{2n}\left ( \cos \left ( nx\right ) \right ) _{0}^{\pi }\\ & =-\frac{1}{2n}\left ( \cos \left ( n\pi \right ) -1\right ) \end{align*}
For even \(n=2,4,\cdots \) the above vanishes. For odd \(n=1,3,5,\cdots \) the above becomes\[ \int _{0}^{\pi }\frac{1}{2}\sin \left ( nx\right ) dx=\frac{1}{n}\] Now the second integral is evaluated\[ \int _{0}^{\pi }-\frac{1}{2}\cos 2x\sin \left ( nx\right ) dx=-\frac{1}{2}\int _{0}^{\pi }\cos 2x\sin \left ( nx\right ) dx \] Using \(\int _{0}^{\pi }\sin \left ( px\right ) \cos \left ( qx\right ) dx=-\frac{\cos \left ( p-q\right ) x}{2\left ( p-q\right ) }-\frac{\cos \left ( p+q\right ) x}{2\left ( p+q\right ) }\), then the above becomes, where \(p=n,q=2\)
\begin{align*} -\frac{1}{2}\int _{0}^{\pi }\sin \left ( nx\right ) \cos 2xdx & =-\frac{1}{2}\left ( -\frac{\cos \left ( n-2\right ) x}{2\left ( n-2\right ) }-\frac{\cos \left ( n+2\right ) x}{2\left ( n+2\right ) }\right ) _{0}^{\pi }\\ & =\frac{1}{2}\left ( \frac{\cos \left ( n-2\right ) x}{2\left ( n-2\right ) }+\frac{\cos \left ( n+2\right ) x}{2\left ( n+2\right ) }\right ) _{0}^{\pi }\\ & =\frac{1}{2}\left ( \frac{\cos \left ( n-2\right ) \pi }{2\left ( n-2\right ) }+\frac{\cos \left ( n+2\right ) \pi }{2\left ( n+2\right ) }-\frac{1}{2\left ( n-2\right ) }-\frac{1}{2\left ( n+2\right ) }\right ) \end{align*}
For even \(n=2,4,\cdots \) the above vanishes, since it becomes \(\frac{1}{2}\left ( \frac{1}{2\left ( n-2\right ) }+\frac{1}{2\left ( n+2\right ) }-\frac{1}{2\left ( n-2\right ) }-\frac{1}{2\left ( n+2\right ) }\right ) \), and for odd \(n=1,3,5,\cdots \), the above becomes\begin{align*} -\frac{1}{2}\int _{0}^{\pi }\sin \left ( nx\right ) \cos 2xdx & =\frac{1}{2}\left ( \frac{-1}{2\left ( n-2\right ) }-\frac{1}{2\left ( n+2\right ) }-\frac{1}{2\left ( n-2\right ) }-\frac{1}{2\left ( n+2\right ) }\right ) \\ & =\frac{1}{2}\left ( \frac{-2}{2\left ( n-2\right ) }+\frac{-2}{2\left ( n+2\right ) }\right ) \\ & =\frac{-1}{2\left ( n-2\right ) }+\frac{-1}{2\left ( n+2\right ) }\\ & =-\frac{n}{n^{2}-4} \end{align*}
Therefore, the final result of integration is \begin{align*} \int _{0}^{\pi }\sin ^{2}x\sin \left ( nx\right ) dx & =\frac{1}{n}-\frac{n}{n^{2}-4}\qquad n=1,3,5,\cdots \\ & =-\frac{4}{n\left ( n^{2}-4\right ) }\qquad n=1,3,5,\cdots \end{align*}
Hence from (1), this results in\begin{align*} c_{n} & =-\frac{2}{\pi }\frac{4}{n\left ( n^{2}-4\right ) }\\ & =-\frac{8}{\pi n\left ( n^{2}-4\right ) }\qquad n=1,3,5,\cdots \end{align*}
Hence the final solution is\[ u\left ( x,t\right ) =\frac{-8}{\pi }\sum _{n=1,3,5,\cdots }^{\infty }\frac{1}{n^{3}-4n}\cos \left ( 2nt\right ) \sin \left ( nx\right ) \]
The above solution was verified against numerical solution. The result gave an exact match (20 terms was used in the sum).
Find d’Alembert solution for wave PDE \(u_{tt}=4u_{xx}\) on infinite domain with initial position \(u\left ( x,0\right ) =\sin x\) and initial velocity \(u_{t}\left ( x,0\right ) =\cos x\)
solution
Putting the PDE in standard form \(u_{tt}=a^{2}u_{xx}\) shows that \(a=2.\) Let \(f\left ( x\right ) =u\left ( x,0\right ) =\sin x\) and \(g\left ( x\right ) =u_{t}\left ( x,0\right ) =\cos x\), then the d’Alembert solution is \begin{align*} u\left ( x,t\right ) & =\frac{1}{2}\left ( f\left ( x+at\right ) +f\left ( x-at\right ) \right ) +\frac{1}{2a}\int _{x-at}^{x+at}g\left ( s\right ) ds\\ & =\frac{1}{2}\left ( \sin \left ( x+2t\right ) +\sin \left ( x-2t\right ) \right ) +\frac{1}{4}\int _{x-2t}^{x+2t}\cos \left ( s\right ) ds\\ & =\frac{1}{2}\sin \left ( x+2t\right ) +\frac{1}{2}\sin \left ( x-2t\right ) +\frac{1}{4}\sin \left ( s\right ) _{x-2t}^{x+2t}\\ & =\frac{1}{2}\sin \left ( x+2t\right ) +\frac{1}{2}\sin \left ( x-2t\right ) +\frac{1}{4}\left ( \sin \left ( x+2t\right ) -\sin \left ( x-2t\right ) \right ) \\ & =\frac{1}{2}\sin \left ( x+2t\right ) +\frac{1}{2}\sin \left ( x-2t\right ) +\frac{1}{4}\sin \left ( x+2t\right ) -\frac{1}{4}\sin \left ( x-2t\right ) \\ & =\frac{3}{4}\sin \left ( x+2t\right ) +\frac{1}{4}\sin \left ( x-2t\right ) \end{align*}
Solve the Dirichlet problem \(u_{xx}+u_{yy}=0\) inside the disk \(x^{2}+y^{2}<1\) and \(u\left ( x,y\right ) =\left \{ \begin{array} [c]{ccc}20 & & y>0\\ 0 & & y<0 \end{array} \right . \) on the unit circle \(x^{2}+y^{2}=1\). Find \(u\left ( 0,0\right ) \) and \(u\left ( 0,\frac{1}{2}\right ) \)
solution
The PDE in polar coordinates is\begin{equation} u_{rr}+\frac{1}{r}u_{r}+u_{\theta \theta }=0\tag{1} \end{equation} Where \(r\) is radial distance and \(\theta \) the polar angle. The boundary conditions in polar coordinates become\[ f\left ( \theta \right ) =\left \{ \begin{array} [c]{ccc}20 & & 0<\theta <\pi \\ 0 & & \pi <\theta <2\pi \end{array} \right . \] The solution to (1) is\[ u\left ( r,\theta \right ) =\frac{c_{0}}{2}+\sum _{n=1}^{\infty }r^{n}\left ( a_{n}\cos \left ( n\theta \right ) +b_{n}\sin \left ( n\theta \right ) \right ) \] At \(r=1\) (on the boundary) the above solution become\[ f\left ( \theta \right ) =\frac{c_{0}}{2}+\sum _{n=1}^{\infty }a_{n}\cos \left ( n\theta \right ) +b_{n}\sin \left ( n\theta \right ) \] By orthogonality on cosine the above becomes\begin{equation} \int _{0}^{2\pi }f\left ( \theta \right ) \cos \left ( m\theta \right ) d\theta =\int _{0}^{2\pi }\frac{c_{0}}{2}\cos \left ( m\theta \right ) d\theta +\sum _{n=1}^{\infty }a_{n}\int _{0}^{2\pi }\cos \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta +b_{n}\int _{0}^{2\pi }\cos \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta \tag{2} \end{equation} For \(n=0\)\begin{align*} \int _{0}^{2\pi }f\left ( \theta \right ) d\theta & =\int _{0}^{2\pi }\frac{c_{0}}{2}d\theta \\ \int _{0}^{\pi }20d\theta & =\frac{c_{0}}{2}\left ( 2\pi \right ) \\ 20\pi & =\frac{c_{0}}{2}\left ( 2\pi \right ) \\ c_{0} & =20 \end{align*}
For \(n>0\) (2) becomes\[ \int _{0}^{2\pi }f\left ( \theta \right ) \cos \left ( m\theta \right ) d\theta =\sum _{n=1}^{\infty }a_{n}\int _{0}^{2\pi }\cos \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta +b_{n}\int _{0}^{2\pi }\cos \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta \] But \(\int _{0}^{2\pi }\cos \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta =0\) for all \(n,m\) and the above reduces to\begin{align*} \int _{0}^{2\pi }f\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta & =a_{n}\pi \\ \int _{0}^{\pi }20\cos \left ( n\theta \right ) d\theta & =a_{n}\pi \\ \frac{20}{n}\left [ \sin \left ( n\theta \right ) \right ] _{0}^{\pi } & =a_{n}\pi \\ \frac{20}{n}\left ( \sin \left ( n\pi \right ) -0\right ) & =a_{n}\pi \end{align*}
Hence \(a_{n}=0\) for all \(n>0\). By orthogonality on sine, for \(n>0\), (2) becomes\[ \int _{0}^{2\pi }f\left ( \theta \right ) \sin \left ( m\theta \right ) d\theta =\sum _{n=1}^{\infty }a_{n}\int _{0}^{2\pi }\sin \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta +b_{n}\int _{0}^{2\pi }\sin \left ( m\theta \right ) \sin \left ( n\theta \right ) d\theta \] But \(\int _{0}^{2\pi }\sin \left ( m\theta \right ) \cos \left ( n\theta \right ) d\theta =0\) for all \(m,n\) and the above reduces to\begin{align*} \int _{0}^{2\pi }f\left ( \theta \right ) \sin \left ( n\theta \right ) d\theta & =b_{n}\pi \\ \int _{0}^{\pi }20\sin \left ( n\theta \right ) d\theta & =b_{n}\pi \\ -\frac{20}{n}\left ( \cos \left ( n\theta \right ) \right ) _{0}^{\pi } & =b_{n}\pi \\ -\frac{20}{n}\left ( \cos \left ( n\pi \right ) -1\right ) & =b_{n}\pi \\ \frac{20}{n}\left ( 1-\cos \left ( n\pi \right ) \right ) & =b_{n}\pi \end{align*}
When \(n=2,4,6,\cdots \) the above gives \(b_{n}=0\). For \(n=1,3,5,\cdots \) the above gives\begin{align*} \frac{40}{n} & =b_{n}\pi \\ b_{n} & =\frac{40}{n\pi } \end{align*}
Therefore the complete solution is\[ u\left ( r,\theta \right ) =10+\frac{40}{\pi }\sum _{n=1,3,5,\cdots }^{\infty }\frac{r^{n}}{n}\sin \left ( n\theta \right ) \] At \(u\left ( 0,0\right ) \), which corresponds to \(r=0\),\(\theta =0\), the above gives \(u\left ( 0,0\right ) =10\). At \(u\left ( 0,\frac{1}{2}\right ) \) which corresponds to \(r=\frac{1}{2},\theta =\frac{\pi }{2}\) the solution gives\[ u\left ( r,\theta \right ) =10+\frac{40}{\pi }\sum _{n=1,3,5,\cdots }^{\infty }\left ( \frac{1}{2}\right ) ^{n}\frac{1}{n}\sin \left ( \frac{n\pi }{2}\right ) \] Evaluated numerically, it converges to \(15.90381156\)
To convert to \(x,y\), the solution is first written as\[ u\left ( r,\theta \right ) =10+\frac{40}{\pi }\left ( r\sin \left ( \theta \right ) +\frac{1}{3}r^{3}\sin \left ( 3\theta \right ) +\frac{1}{5}r^{5}\sin \left ( 5\theta \right ) +\cdots \right ) \] But \[ r\sin \left ( \theta \right ) =y \] And\begin{align*} r^{3}\sin \left ( 3\theta \right ) & =\sum _{\substack{k=1\\odd}}^{3}\frac{n!}{k!\left ( n-k\right ) !}x^{n-k}\left ( -1\right ) ^{\frac{k-1}{2}}y^{k}\\ & =\frac{6}{2}x^{2}y-y^{3} \end{align*}
And\begin{align*} r^{5}\sin \left ( 5\theta \right ) & =\sum _{\substack{k=1\\odd}}^{5}\frac{n!}{k!\left ( n-k\right ) !}x^{n-k}\left ( -1\right ) ^{\frac{k-1}{2}}y^{k}\\ & =\frac{120}{24}x^{4}y-\frac{120}{12}x^{2}y^{3}+xy^{5} \end{align*}
And so on. Hence the solution in \(xy\) is\[ u\left ( x,y\right ) =10+\frac{40}{\pi }\left ( y+\frac{1}{3}\left ( 3x^{2}y-y^{3}\right ) +\frac{1}{5}\left ( 5x^{4}y-10x^{2}y^{3}+xy^{5}\right ) +\cdots \right ) \] To verify is the above 3 terms give good approximation, the value at \(x=0,y=\frac{1}{2}\) is now evaluated from the above, which gives \(15.8356812467\). Which is very close to the above result. One more term can be added to improve this. I am not sure now if there is a way to obtain closed form expression in \(x,y\,\ \)as the case was with the solution in polar coordinates.
Solve \(u_{xx}+u_{yy}=0\) inside semi-infinite strip \(0<x<a,y>0\) with \(u\left ( 0,y\right ) -0,u\left ( a,y\right ) =0,u\left ( x,0\right ) =F\left ( x\right ) \) and additional conditions that \(u\left ( x,y\right ) \rightarrow 0\) as \(y\rightarrow \infty \)
solution
This is a plot of the boundary conditions.
Let \(u=X\left ( x\right ) Y\left ( y\right ) \). Substituting this in the PDE gives\begin{align*} X^{\prime \prime }Y+Y^{\prime \prime }X & =0\\ \frac{X^{\prime \prime }}{X} & =-\frac{Y^{\prime \prime }}{Y}=-\lambda \end{align*}
Which gives the eigenvalue ODE\begin{align*} X^{\prime \prime }\left ( x\right ) +\lambda X\left ( x\right ) & =0\\ X\left ( 0\right ) & =0\\ X\left ( a\right ) & =0 \end{align*}
which gives the eigenfunction \(\Phi _{n}\left ( x\right ) =c_{n}\sin \left ( \sqrt{\lambda _{n}}x\right ) \) where \(\lambda _{n}=\left ( \frac{n\pi }{a}\right ) ^{2}\) for \(n=1,2,3,\cdots \). The corresponding \(Y\) ODE is\[ Y^{\prime \prime }-\lambda _{n}Y=0 \] Since \(\lambda _{n}>0\), then the solution to this ODE is\[ Y_{n}=A_{n}e^{\sqrt{\lambda _{n}}y}+B_{n}e^{-\sqrt{\lambda _{n}}y}\] Since \(\lambda _{n}>0\) and the solution goes to zero for large \(y\), then \(A_{n}\) must be zero. Therefore the above simplifies to\[ Y_{n}\left ( y\right ) =B_{n}e^{-\sqrt{\lambda _{n}}y}\] And the complete solution becomes\[ u\left ( x,y\right ) =\sum _{n=1}^{\infty }c_{n}e^{-\sqrt{\lambda _{n}}y}\sin \left ( \sqrt{\lambda _{n}}x\right ) \] Where constants are combined into \(c_{n}\). Since \(\lambda _{n}=\left ( \frac{n\pi }{a}\right ) ^{2}\), the above becomes\[ u\left ( x,y\right ) =\sum _{n=1}^{\infty }c_{n}e^{-\frac{n\pi }{a}y}\sin \left ( \frac{n\pi }{a}x\right ) \] At \(y=0\), the above becomes\[ F\left ( x\right ) =\sum _{n=1}^{\infty }c_{n}\sin \left ( \frac{n\pi }{a}x\right ) \] Applying orthogonality gives\begin{align*} \int _{0}^{a}F\left ( x\right ) \sin \left ( \frac{n\pi }{a}x\right ) dx & =c_{n}\frac{a}{2}\\ c_{n} & =\frac{2}{a}\int _{0}^{a}F\left ( x\right ) \sin \left ( \frac{n\pi }{a}x\right ) dx \end{align*}
Hence the complete solution is\[ u\left ( x,y\right ) =\frac{2}{a}\sum _{n=1}^{\infty }\left ( \int _{0}^{a}F\left ( x\right ) \sin \left ( \frac{n\pi }{a}x\right ) dx\right ) e^{-\frac{n\pi }{a}y}\sin \left ( \frac{n\pi }{a}x\right ) \]
Problem
Find the Fourier cosine series of \[ f\left ( x\right ) =\left \{ \begin{array} [c]{ccc}x & & 0<x\leq 1\\ 0 & & 1<x\leq 2 \end{array} \right . \] Take \(L=2\).
solution
To obtain the Fourier cosine series, the function \(f\left ( x\right ) \) is first even extended to \(-2<x<2\) with period \(2L\) or \(4\). Then repeated again with period \(2L\) over the whole \(x\) domain. The following plot shows the original \(f\left ( x\right ) \)
The following plot shows then even extended \(f_{e}\left ( x\right ) \) over \(3\) periods for illustrations
The Fourier cosine series is\[ f\left ( x\right ) =\frac{a_{0}}{2}+\sum _{n=1}^{\infty }a_{n}\cos \left ( \frac{n\pi }{L}x\right ) \] Where \[ a_{0}=\frac{1}{L}\int _{-L}^{L}f\left ( x\right ) dx \] Since extension is even, then the above simplifies to\[ a_{0}=\frac{2}{L}\int _{0}^{L}f\left ( x\right ) dx \] But \(L=2\), therefore\begin{align*} a_{0} & =\int _{0}^{2}f\left ( x\right ) dx=\int _{0}^{1}xdx+\int _{1}^{2}0dx\\ & =\frac{1}{2}\left ( x^{2}\right ) _{0}^{1}\\ & =\frac{1}{2} \end{align*}
And\[ a_{n}=\frac{1}{L}\int _{-L}^{L}f\left ( x\right ) \cos \left ( \frac{n\pi }{L}\right ) dx \] Since cosine is even, and \(f\left ( x\right ) \) extension is even, then the product is even and the above simplifies to\[ a_{n}=\frac{2}{L}\int _{0}^{L}f\left ( x\right ) \cos \left ( \frac{n\pi }{L}\right ) dx \] Since \(L=2\)\begin{align*} a_{n} & =\int _{0}^{2}f\left ( x\right ) \cos \left ( \frac{n\pi }{2}\right ) dx\\ & =\int _{0}^{1}x\cos \left ( \frac{n\pi }{2}\right ) dx+\int _{1}^{2}0\cos \left ( \frac{n\pi }{2}\right ) dx\\ & =\int _{0}^{1}x\cos \left ( \frac{n\pi }{2}\right ) dx \end{align*}
But \[ \int x\cos \left ( ax\right ) dx=\frac{\cos ax}{a^{2}}+\frac{x\sin ax}{a}\] Where \(a=\frac{n\pi }{2}\) here. Therefore the integral becomes\begin{align*} a_{n} & =\int _{0}^{1}x\cos \left ( \frac{n\pi }{2}\right ) dx\\ & =\left ( \frac{\cos \left ( \frac{n\pi }{2}x\right ) }{\left ( \frac{n\pi }{2}\right ) ^{2}}+\frac{x\sin \left ( \frac{n\pi }{2}x\right ) }{\left ( \frac{n\pi }{2}\right ) }\right ) _{0}^{1}\\ & =\frac{\cos \left ( \frac{n\pi }{2}\right ) }{\left ( \frac{n\pi }{2}\right ) ^{2}}+\frac{\sin \left ( \frac{n\pi }{2}\right ) }{\left ( \frac{n\pi }{2}\right ) }-\frac{1}{\left ( \frac{n\pi }{2}\right ) ^{2}}\\ & =\frac{4\cos \left ( \frac{n\pi }{2}\right ) }{\left ( n\pi \right ) ^{2}}+\frac{2\sin \left ( \frac{n\pi }{2}\right ) }{n\pi }-\frac{4}{\left ( n\pi \right ) ^{2}}\\ & =\frac{4\cos \left ( \frac{n\pi }{2}\right ) +2n\pi \sin \left ( \frac{n\pi }{2}\right ) -4}{n^{2}\pi ^{2}}\\ & =\frac{2}{n^{2}\pi ^{2}}\left ( 2\cos \left ( \frac{n\pi }{2}\right ) +n\pi \sin \left ( \frac{n\pi }{2}\right ) -2\right ) \end{align*}
Therefore the Fourier series is\[ f\left ( x\right ) =\frac{1}{4}+\sum _{n=1}^{\infty }\frac{2}{n^{2}\pi ^{2}}\left ( 2\cos \left ( \frac{n\pi }{2}\right ) +n\pi \sin \left ( \frac{n\pi }{2}\right ) -2\right ) \cos \left ( \frac{n\pi }{2}x\right ) \] By Fourier convergence theorem, since \(f\left ( x\right ) \) and \(f^{\prime }\left ( x\right ) \) are piecewise contiguous, the Fourier series will converge to each point of \(f\left ( x\right ) \) where there is no jump discontinuity, and will converge to the average of \(f\left ( x\right ) \) at the point where there is a jump. In this example, it will converge to \(\frac{1}{2}\) at the points where is a jump discontinuity There are \(x=1,3,5,\cdots \) and at \(x=-1,-3,-5,\cdots \). At all other points, Fourier series will converge to \(f\left ( x\right ) \). This is a plot of the above Fourier series for increasing number of terms
Problem Solve heat PDE \(u_{t}=9u_{xx}\) on \(0<x<\pi ,t>0\) with boundary conditions \(u_{x}\left ( 0,t\right ) =u_{x}\left ( \pi ,t\right ) =0\) and initial conditions \(u\left ( x,0\right ) =f\left ( x\right ) =5\sin ^{2}x\)
solution
The solution to the heat PDE with isolated end points is\[ u\left ( x,t\right ) =A_{0}+\sum _{n=1}^{\infty }c_{n}e^{-\lambda _{n}a^{2}t}\cos \left ( \sqrt{\lambda _{n}x}\right ) \] Where \(\lambda _{n}=\left ( \frac{n\pi }{L}\right ) ^{2}\) for \(n=1,2,3\cdots \). But \(L=\pi \) here. Hence \(\lambda _{n}=n^{2}\) and \(a=3\). Therefore the above solution becomes\begin{equation} u\left ( x,t\right ) =A_{0}+\sum _{n=1}^{\infty }c_{n}e^{-9n^{2}t}\cos \left ( nx\right ) \tag{1} \end{equation} At \(t=0\) the above becomes\begin{align*} f\left ( x\right ) & =A_{0}+\sum _{n=1}^{\infty }c_{n}\cos \left ( nx\right ) \\ 5\sin ^{2}x & =A_{0}+\sum _{n=1}^{\infty }c_{n}\cos \left ( nx\right ) \end{align*}
But \(\sin ^{2}x=\frac{1}{2}-\frac{1}{2}\cos \left ( 2x\right ) \), therefore the above becomes\[ \frac{5}{2}-\frac{5}{2}\cos \left ( 2x\right ) =A_{0}+\sum _{n=1}^{\infty }c_{n}\cos \left ( nx\right ) \] Hence \(A_{0}=\frac{5}{2}\) and \(c_{2}=-\frac{5}{2}\) and all other \(c_{n}=0\). Therefore the solution (1) becomes\[ u\left ( x,t\right ) =\frac{5}{2}-\frac{5}{2}e^{-36t}\cos \left ( 2x\right ) \] At steady state when \(t\rightarrow \infty \), the solution becomes \(u\left ( x\right ) =\frac{5}{2}\). The solution \(u\left ( \frac{\pi }{2},t\right ) \) becomes
\begin{align*} u\left ( \frac{\pi }{2},t\right ) & =\frac{5}{2}-\frac{5}{2}e^{-36t}\cos \left ( 2\frac{\pi }{2}\right ) \\ & =\frac{5}{2}-\frac{5}{2}e^{-36t}\cos \left ( \pi \right ) \\ & =\frac{5}{2}+\frac{5}{2}e^{-36t}\\ & =\frac{5}{2}\left ( 1+e^{-36t}\right ) \end{align*}
Problem
Solve the wave equation \(u_{tt}=u_{xx}\) on string, where initial position \(f\left ( x\right ) =0\) and initial velocity is \(g\left ( x\right ) =\sin \left ( x\right ) +\sin \left ( 2x\right ) \). The string is fixed at both ends.
solution
\(a=1\) in this problem. Using D’Alembert method\[ u\left ( x,t\right ) =\frac{1}{2}\left ( f\left ( x+at\right ) +f\left ( x-at\right ) \right ) +\frac{1}{2}\int _{x-at}^{x+at}g\left ( s\right ) ds \] Where \(f,g\) above are the odd extensions. Since \(f\left ( x\right ) \) is zero and \(a=1\), the above simplifies to\begin{align*} u\left ( x,t\right ) & =\frac{1}{2}\int _{x-t}^{x+t}g\left ( s\right ) ds\\ & =\frac{1}{2}\int _{x-t}^{x+t}\sin \left ( s\right ) +\sin \left ( 2s\right ) ds\\ & =\frac{1}{2}\left ( -\cos \left ( s\right ) -\frac{1}{2}\cos \left ( 2s\right ) \right ) _{x-t}^{x+t}\\ & =-\frac{1}{2}\left ( \cos \left ( s\right ) +\frac{1}{2}\cos \left ( 2s\right ) \right ) _{x-t}^{x+t}\\ & =-\frac{1}{2}\left ( \cos \left ( x+t\right ) +\frac{1}{2}\cos \left ( 2\left ( x+t\right ) \right ) -\cos \left ( x-t\right ) -\frac{1}{2}\cos \left ( 2\left ( x-t\right ) \right ) \right ) \\ & =-\frac{1}{2}\cos \left ( x+t\right ) -\frac{1}{4}\cos \left ( 2\left ( x+t\right ) \right ) +\frac{1}{2}\cos \left ( x-t\right ) +\frac{1}{4}\cos \left ( 2\left ( x-t\right ) \right ) \\ & =\frac{1}{2}\left ( \cos \left ( x-t\right ) -\cos \left ( x+t\right ) \right ) +\frac{1}{4}\left ( \cos \left ( 2\left ( x-t\right ) \right ) -\cos \left ( 2\left ( x+t\right ) \right ) \right ) \end{align*}
Using Fourier series method. The solution with initial position zero is\[ u\left ( x,t\right ) =\sum _{n=1}^{\infty }c_{n}\sin \left ( \sqrt{\lambda _{n}}at\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) \] Where \(\lambda _{n}=\left ( \frac{n\pi }{L}\right ) ^{2}\) with \(n=1,2,3,\cdots \). Since \(L=\pi \) and \(a=1\), the above solution simplifies to\begin{equation} u\left ( x,t\right ) =\sum _{n=1}^{\infty }c_{n}\sin \left ( nt\right ) \sin \left ( nx\right ) \tag{1} \end{equation} To determine \(c_{n}\), the velocity from the above solution is \(\frac{\partial u\left ( x,t\right ) }{\partial t}=\sum _{n=1}^{\infty }c_{n}n\cos \left ( nt\right ) \sin \left ( nx\right ) \). And at \(t=0\), this becomes\[ f\left ( x\right ) =\sum _{n=1}^{\infty }nc_{n}\sin \left ( nx\right ) \] But \(f\left ( x\right ) =\sin \left ( x\right ) +\sin \left ( 2x\right ) \). Hence the above becomes\[ \sin \left ( x\right ) +\sin \left ( 2x\right ) =\sum _{n=1}^{\infty }nc_{n}\sin \left ( nx\right ) \] Therefore by inspection \(c_{1}=1\) and \(2c_{2}=1\) or \(c_{2}=\frac{1}{2}\). Therefore the solution (1) becomes\[ u\left ( x,t\right ) =\sin \left ( t\right ) \sin \left ( x\right ) +\frac{1}{2}\sin \left ( 2t\right ) \sin \left ( 2x\right ) \] Since the Fourier series and the D’Alembert must be the same, then this implies that\[ \sin \left ( t\right ) \sin \left ( x\right ) +\frac{1}{2}\sin \left ( 2t\right ) \sin \left ( 2x\right ) =\frac{1}{2}\left ( \cos \left ( x-t\right ) -\cos \left ( x+t\right ) \right ) +\frac{1}{4}\left ( \cos \left ( 2\left ( x-t\right ) \right ) -\cos \left ( 2\left ( x+t\right ) \right ) \right ) \] This was confirmed on the computer as well. In this problem, it turned out that it is easier to use the Fourier method, since the initial velocity was given as a Fourier sine series already.
Problem
Solve Laplace PDE \(u_{rr}+\frac{1}{r}u_{r}+\frac{1}{r^{2}}u_{\theta \theta }=0\) inside annulus \(a<r<b\) where \(a>0\). The boundary conditions is \(u\left ( a\cos \theta ,a\sin \theta \right ) =0\) and \(u\left ( b\cos \theta ,b\sin \theta \right ) =f\left ( \theta \right ) \).
solution
Let \(u\left ( r,\theta \right ) =R\left ( r\right ) \Theta \left ( \theta \right ) \). Substituting this back into the PDE gives\[ r^{2}\frac{R^{\prime \prime }}{R}+r\frac{R^{\prime }}{R}+\frac{\Theta ^{\prime \prime }}{\Theta }=0 \] Or\[ r^{2}\frac{R^{\prime \prime }}{R}+r\frac{R^{\prime }}{R}=-\frac{\Theta ^{\prime \prime }}{\Theta }=\lambda \] The eigenvalue ODE is\begin{align*} \Theta ^{\prime \prime }+\lambda \Theta & =0\\ \Theta \left ( 0\right ) & =\Theta \left ( 2\pi \right ) \\ \Theta ^{\prime }\left ( 0\right ) & =\Theta ^{\prime }\left ( 2\pi \right ) \end{align*}
The solution to the above is known to be\begin{equation} \Theta _{n}\left ( \theta \right ) =c_{n}\cos \left ( \sqrt{\lambda _{n}}\theta \right ) +k_{n}\sin \left ( \sqrt{\lambda _{n}}\theta \right ) \tag{1} \end{equation} Where \(\lambda _{n}=n^{2}\) and \(n=0,1,2,3,\cdots \). Therefore solution (1) becomes\begin{align} \Theta _{n}\left ( \theta \right ) & =c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) \qquad n=1,2,3,\cdots \tag{1A}\\ \Theta _{n}\left ( \theta \right ) & =c_{0}\qquad n=0\tag{1B} \end{align}
Therefore the solution to the \(\Theta _{n}\left ( \theta \right ) \) ode is\[ \Theta _{n}\left ( \theta \right ) =\left \{ \begin{array} [c]{ccc}c_{0} & & n=0\\ c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) & & n=1,2,3,\cdots \end{array} \right . \] The solution to the \(R\left ( r\right ) \) ode (this is a Euler ODE) will have two solutions, one when \(\lambda _{0}=0\) when \(n=0\) and another solution for \(\lambda _{n}=n^{2}\) when \(n>0\). When eigenvalue is zero, the \(R\left ( r\right ) \) ODE becomes\begin{align*} r^{2}\frac{R^{\prime \prime }}{R}+r\frac{R^{\prime }}{R} & =0\\ r^{2}R^{\prime \prime }+rR^{\prime } & =0\\ rR^{\prime \prime }+R^{\prime } & =0 \end{align*}
This has the solution \begin{equation} R_{0}\left ( r\right ) =A_{0}\ln \left ( r\right ) +B_{0}\tag{2} \end{equation} Applying the boundary conditions \(r=a\) to the above gives\begin{align*} 0 & =A_{0}\ln \left ( a\right ) +B_{0}\\ B_{0} & =-A_{0}\ln \left ( a\right ) \end{align*}
Therefore (2) becomes\begin{align} R_{0}\left ( r\right ) & =A_{0}\ln \left ( r\right ) -A_{0}\ln \left ( a\right ) \nonumber \\ & =A_{0}\left ( \ln \left ( r\right ) -\ln \left ( a\right ) \right ) \tag{3} \end{align}
The above is only for the zero eigenvalue. When \(n>0\), the \(R\left ( r\right ) \) ode becomes the Euler ODE\begin{align*} r^{2}R^{\prime \prime }+rR^{\prime }-\lambda _{n}R & =0\\ r^{2}R^{\prime \prime }+rR^{\prime }-n^{2}R & =0 \end{align*}
The solution to this ODE is\begin{equation} R_{n}\left ( r\right ) =A_{n}r^{n}+D_{n}r^{-n}\tag{4} \end{equation} Here the term \(D_{n}r^{-n}\) does not vanish as the case with the solution to the disk. But using the boundary condition that \(u=0\) when \(r=a\), the above ODE at \(r=a\) becomes\begin{align*} R_{n}\left ( a\right ) & =0=A_{n}a^{n}+D_{n}a^{-n}\\ D_{n} & =-A_{n}\frac{a^{n}}{a^{-n}}\\ & =-A_{n}a^{2n} \end{align*}
Substituting the above back in (4) gives\begin{align} R_{n}\left ( r\right ) & =A_{n}r^{n}-A_{n}a^{2n}r^{-n}\nonumber \\ & =A_{n}\left ( r^{n}-a^{2n}r^{-n}\right ) \tag{4A} \end{align}
Therefore the solution to the \(R\left ( r\right ) \) ode is\[ R_{n}\left ( r\right ) =\left \{ \begin{array} [c]{ccc}A_{0}\left ( \ln \left ( r\right ) -\ln \left ( a\right ) \right ) & & n=0\\ A_{n}\left ( r^{n}-a^{2n}r^{-n}\right ) & & n=1,2,3,\cdots \end{array} \right . \] The fundamental solution is\begin{align*} u_{n}\left ( r,\theta \right ) & =R_{n}\left ( r\right ) \Theta _{n}\left ( \theta \right ) \\ & =\overset{\text{zero eigenvalue}}{\overbrace{c_{0}A_{0}\left ( \ln \left ( r\right ) -\ln \left ( a\right ) \right ) }}+\overset{n>0\text{ eigenvalues}}{\overbrace{\left ( r^{n}-a^{2n}r^{-n}\right ) \left ( c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) \right ) }} \end{align*}
By superposition, the complete solution is\[ u\left ( r,\theta \right ) =c_{0}A_{0}\left ( \ln \left ( r\right ) -\ln \left ( a\right ) \right ) +\sum _{n=1}^{\infty }A_{n}\left ( r^{n}-a^{2n}r^{-n}\right ) \left ( c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) \right ) \] Combining \(c_{0}A_{0}\) into \(c_{0}\) and \(A_{n}c_{n}\) into \(c_{n}\) and \(A_{n}k_{n}\) into \(k_{n}\) the above simplifies to\begin{equation} u\left ( r,\theta \right ) =c_{0}\left ( \ln \left ( r\right ) -\ln \left ( a\right ) \right ) +\sum _{n=1}^{\infty }\left ( r^{n}-a^{2n}r^{-n}\right ) \left ( c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) \right ) \tag{5} \end{equation} Now the boundary condition at \(r=b\) is used to determined \(c_{0},c_{n}\) and \(k_{n}\). At \(r=b\) and for \(n=0\) case, the above becomes, by orthogonality \begin{align} \int _{0}^{2\pi }f\left ( \theta \right ) d\theta & =\left ( 2\pi \right ) c_{0}\left ( \ln \left ( b\right ) -\ln \left ( a\right ) \right ) \nonumber \\ c_{0} & =\frac{1}{2\pi \left ( \ln \left ( b\right ) -\ln \left ( a\right ) \right ) }\int _{0}^{2\pi }f\left ( \theta \right ) d\theta \tag{6} \end{align}
And for \(n>0\), solution (5) becomes\begin{equation} f\left ( \theta \right ) =\sum _{n=1}^{\infty }\left ( b^{n}-a^{2n}b^{-n}\right ) \left ( c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) \right ) \tag{7} \end{equation} By orthogonality with \(\cos \left ( n\theta \right ) \) equation (7) becomes\begin{align*} \int _{0}^{2\pi }f\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta & =\left ( b^{n}-a^{2n}b^{-n}\right ) c_{n}\pi \\ c_{n} & =\frac{1}{\left ( b^{n}-a^{2n}b^{-n}\right ) \pi }\int _{0}^{2\pi }f\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta \end{align*}
And by orthogonality with \(\sin \left ( n\theta \right ) \) equation (4) becomes\begin{align*} \int _{0}^{2\pi }f\left ( \theta \right ) \sin \left ( n\theta \right ) d\theta & =\left ( b^{n}-a^{2n}b^{-n}\right ) k_{n}\pi \\ k_{n} & =\frac{1}{\left ( b^{n}-a^{2n}b^{-n}\right ) \pi }\int _{0}^{2\pi }f\left ( \theta \right ) \sin \left ( n\theta \right ) d\theta \end{align*}
This completes the solution. Solution (5) becomes \begin{align*} u\left ( r,\theta \right ) & =\frac{1}{2\pi }\frac{\ln \left ( r\right ) -\ln \left ( a\right ) }{\ln \left ( b\right ) -\ln \left ( a\right ) }\int _{0}^{2\pi }f\left ( \theta \right ) d\theta +\sum _{n=1}^{\infty }\left ( r^{n}-a^{2n}r^{-n}\right ) \left ( c_{n}\cos \left ( n\theta \right ) +k_{n}\sin \left ( n\theta \right ) \right ) \\ c_{n} & =\frac{1}{\left ( b^{n}-a^{2n}b^{-n}\right ) \pi }\int _{0}^{2\pi }f\left ( \theta \right ) \cos \left ( n\theta \right ) d\theta \\ k_{n} & =\frac{1}{\left ( b^{n}-a^{2n}b^{-n}\right ) \pi }\int _{0}^{2\pi }f\left ( \theta \right ) \sin \left ( n\theta \right ) d\theta \end{align*}