Problem Solve the boundary value problem \begin{equation} y^{\prime \prime }\left ( x\right ) -y\left ( x\right ) =x \tag{1} \end{equation} with \(y\left ( 0\right ) =1,y\left ( 1\right ) =1\)
solution
The general solution is the sum of the homogeneous and the particular solution\begin{equation} y=y_{h}+y_{p}\tag{2} \end{equation} Where \(y_{h}\left ( x\right ) \) is the homogeneous solution of \(y_{h}^{\prime \prime }-y_{h}=0\). Since this is a constant coefficients ODE, the characteristic equation is found by assuming \(y_{h}=e^{rx}\) and substituting this into \(y^{\prime \prime }\left ( x\right ) -y\left ( x\right ) =0\) and finding the roots. This results in\begin{align*} r^{2}-1 & =0\\ r & =\pm 1 \end{align*}
Therefore the two linearly independent basis solutions are \(y_{1}=e^{x}\) and \(y_{2}=e^{-x}\). The homogeneous solution is a linear combination of these two basis solutions. In other words\[ y_{h}\left ( x\right ) =c_{1}e^{x}+c_{2}e^{-x}\] Before proceeding to find the general solution, a check is made now to determine if a unique solution exists or not. The Wronskian \(W\left ( x\right ) \) is \[\begin{vmatrix} y_{1}\left ( 0\right ) & y_{2}\left ( 0\right ) \\ y_{1}\left ( 1\right ) & y_{2}\left ( 2\right ) \end{vmatrix} =\begin{vmatrix} e^{0} & e^{-0}\\ e^{1} & e^{-1}\end{vmatrix} =\begin{vmatrix} 1 & 1\\ e^{1} & e^{-1}\end{vmatrix} =e^{-1}-e\neq 0 \] Since \(W\left ( x\right ) \neq 0\), then a unique solution exists.
The particular solution is now found using the method of undetermined coefficients. Since the RHS is polynomial, let the particular solution guess be the following polynomial \[ y_{p}=A+Bx+Cx^{2}\] Therefore \(y_{p}^{\prime }=B+2Cx\) and \(y_{p}^{\prime \prime }=2C\). Substituting these into the original ODE (1) gives\begin{align*} 2C-\left ( A+Bx+Cx^{2}\right ) & =x\\ x^{2}\left ( -C\right ) +x\left ( -B\right ) +\left ( 2C-A\right ) & =x \end{align*}
Comparing coefficients of both sides results in\begin{align*} -C & =0\\ -B & =1\\ 2C-A & =0 \end{align*}
Solving for the coefficients gives\begin{align*} C & =0\\ B & =-1\\ A & =0 \end{align*}
Therefore the particular solution is now found as\begin{align*} y_{p} & =A+Bx+Cx^{2}\\ & =-x \end{align*}
The full solution from (2) becomes\begin{equation} y=\overset{y_{h}}{\overbrace{c_{1}e^{x}+c_{2}e^{-x}}}-x\tag{3} \end{equation} Boundary conditions are now used to determine \(c_{1}\) and \(c_{2}\). At \(x=0\) the above becomes\begin{equation} 1=c_{1}+c_{2}\tag{4} \end{equation} And at \(x=1\) (3) gives\begin{align} 1 & =c_{1}e+c_{2}e^{-1}-1\nonumber \\ c_{1}e+c_{2}e^{-1} & =2\tag{5} \end{align}
Equations (4,5) are now solved for \(c_{1},c_{2}\). From (4), \(c_{1}=1-c_{2}\). Substituting this into (5) gives\begin{align*} \left ( 1-c_{2}\right ) e+c_{2}e^{-1} & =2\\ c_{2}\left ( -e+e^{-1}\right ) +e & =2\\ c_{2} & =\frac{2-e}{e^{-1}-e} \end{align*}
Therefore \[ c_{1}=1-\frac{2-e}{e^{-1}-e}\] Hence the general solution (3) becomes\begin{align*} y\left ( x\right ) & =\left ( 1-\frac{2-e}{e^{-1}-e}\right ) e^{x}+\left ( \frac{2-e}{e^{-1}-e}\right ) e^{-x}-x\\ & =\frac{\left ( e^{-1}-e-2+e\right ) }{e^{-1}-e}e^{x}+\frac{2-e}{e^{-1}-e}e^{-x}-x \end{align*}
Or\[ y\left ( x\right ) =\frac{\left ( e^{-1}-2\right ) }{e^{-1}-e}e^{x}+\frac{\left ( 2-e\right ) e^{-x}}{e^{-1}-e}-x \] This is a plot of the above solution
Problem Find the Fourier sine series for \(f\left ( x\right ) =x\left ( 1-x\right ) ,0\leq x\leq 1\). Use the result to evaluate the infinite series \(\frac{1}{1^{3}}-\frac{1}{3^{3}}+\frac{1}{5^{3}}-\frac{1}{7^{3}}\cdots \)
solution
This is a plot of the function \(f\left ( x\right ) =x\left ( 1-x\right ) ,0\leq x\leq 1\)
In the above \[ L=1 \] To obtain the Fourier sine series, the function is first odd extended to \(-1\leq x<0\) and after the extension is made, it is repeated using a period \(2L\) so that it becomes a periodic function. Here is a plot of the periodic function, called \(f_{o}\left ( x\right ) \) now. One period is shown in this plot for illustration.
Since \(f_{o}\left ( x\right ) \) is an odd function, its Fourier series will contain \(b_{n}\) terms only. The \(b_{n}\) terms are given by the standard formula\[ b_{n}=\frac{1}{L}\int _{-L}^{L}f_{o}\left ( x\right ) \sin \left ( \frac{n\pi }{L}x\right ) dx \] But \(f_{o}\left ( x\right ) \) is odd function and sine is also odd, therefore the product is an even function, and the above simplifies to\[ b_{n}=\frac{2}{L}\int _{0}^{L}f_{o}\left ( x\right ) \sin \left ( \frac{n\pi }{L}x\right ) dx \] But over \(0<x<1\), \(\ \)the function \(f_{o}\left ( x\right ) \) is the same as the original function \(f\left ( x\right ) \) which is the non-periodic function given. Therefore the above can be written as\[ b_{n}=\frac{2}{L}\int _{0}^{L}f\left ( x\right ) \sin \left ( \frac{n\pi }{L}x\right ) dx \] Since \(L=1\) in this problem, the above simplifies to\[ \fbox{$b_n=2\int _0^1f\left ( x\right ) \sin \left ( n\pi x\right ) dx$}\] And since \(f\left ( x\right ) =x\left ( 1-x\right ) \), and the above becomes\begin{align} b_{n} & =2\int _{0}^{1}\left ( x-x^{2}\right ) \sin \left ( n\pi x\right ) dx\nonumber \\ & =2\left ( \int _{0}^{1}x\sin \left ( n\pi x\right ) dx-\int _{0}^{1}x^{2}\sin \left ( n\pi x\right ) dx\right ) \nonumber \\ & =2\left ( I_{1}-I_{2}\right ) \tag{1} \end{align}
These two integrals are solved using integration by parts. Considering \(I_{1}=\int _{0}^{1}x\sin \left ( n\pi x\right ) dx\) and using \(\int udv=uv-\int vdu\). Let \(u=x,dv=\sin \left ( n\pi x\right ) \), then \(du=1\) and \(v=-\left ( \frac{1}{n\pi }\right ) \cos \left ( n\pi x\right ) \). Hence\begin{align*} I_{1} & =uv-\int vdu\\ & =\left ( -x\left ( \frac{1}{n\pi }\right ) \cos \left ( n\pi x\right ) \right ) _{0}^{1}+\frac{1}{n\pi }\int _{0}^{1}\cos \left ( n\pi x\right ) dx\\ & =\left ( \frac{-1}{n\pi }\cos \left ( n\pi \right ) \right ) +\frac{1}{\left ( n\pi \right ) ^{2}}\left ( \sin \left ( n\pi x\right ) \right ) _{0}^{1}\\ & =\left ( \frac{-1}{n\pi }\left ( -1\right ) ^{n}\right ) +\frac{1}{\left ( n\pi \right ) ^{2}}\left ( \sin \left ( n\pi \right ) -0\right ) \\ & =\left ( \frac{-1}{n\pi }\left ( -1\right ) ^{n}\right ) \\ & =\frac{\left ( -1\right ) ^{n+1}}{n\pi } \end{align*}
For the second integral, let \(I_{2}=\int _{0}^{1}x^{2}\sin \left ( n\pi x\right ) dx\) and \(u=x^{2},dv=\sin \left ( n\pi x\right ) \), therefore \(du=2x,v=-\frac{1}{n\pi }\cos \left ( n\pi x\right ) \). Hence\begin{align*} I_{2} & =uv-\int vdu\\ & =\left ( -x^{2}\frac{1}{n\pi }\cos \left ( n\pi x\right ) \right ) _{0}^{1}+\frac{2}{n\pi }\int _{0}^{1}x\cos \left ( n\pi x\right ) dx\\ & =\left ( -\frac{1}{n\pi }\left ( -1\right ) ^{n}\right ) +\frac{2}{n\pi }\int _{0}^{1}x\cos \left ( n\pi x\right ) dx \end{align*}
The above integral in the RHS is also found by integration by parts. Let \(u=x,dv=\cos \left ( n\pi x\right ) \) or \(du=1,v=\frac{1}{n\pi }\sin \left ( n\pi x\right ) \). The above becomes\begin{align*} I_{2} & =\frac{\left ( -1\right ) ^{n+1}}{n\pi }+\frac{2}{n\pi }\left [ \left ( x\frac{1}{n\pi }\sin \left ( n\pi x\right ) \right ) _{0}^{1}-\frac{1}{n\pi }\int _{0}^{1}\sin \left ( n\pi x\right ) dx\right ] \\ & =\frac{\left ( -1\right ) ^{n+1}}{n\pi }+\frac{2}{n\pi }\left [ 0-\frac{1}{n\pi }\left ( -\frac{1}{n\pi }\cos \left ( n\pi x\right ) \right ) _{0}^{1}\right ] \\ & =\frac{\left ( -1\right ) ^{n+1}}{n\pi }+\frac{2}{n\pi }\left [ \frac{1}{\left ( n\pi \right ) ^{2}}\left ( \cos \left ( n\pi \right ) -1\right ) \right ] \\ & =\frac{\left ( -1\right ) ^{n+1}}{n\pi }+\frac{2}{\left ( n\pi \right ) ^{3}}\left ( \left ( -1\right ) ^{n}-1\right ) \end{align*}
Substituting \(I_{1},I_{2}\) found above back into equation (1) gives the final result\begin{align*} b_{n} & =2\left ( \frac{\left ( -1\right ) ^{n+1}}{n\pi }-\left ( \frac{\left ( -1\right ) ^{n+1}}{n\pi }+\frac{2}{\left ( n\pi \right ) ^{3}}\left ( \left ( -1\right ) ^{n}-1\right ) \right ) \right ) \\ & =2\left ( \frac{\left ( -1\right ) ^{n+1}}{n\pi }-\frac{\left ( -1\right ) ^{n+1}}{n\pi }-\frac{2}{\left ( n\pi \right ) ^{3}}\left ( \left ( -1\right ) ^{n}-1\right ) \right ) \\ & =2\left ( \frac{\left ( -1\right ) ^{n+1}}{n\pi }-\frac{\left ( -1\right ) ^{n+1}}{n\pi }-\frac{2\left ( -1\right ) ^{n}}{\left ( n\pi \right ) ^{3}}+\frac{2}{\left ( n\pi \right ) ^{3}}\right ) \\ & =4\left ( -\frac{\left ( -1\right ) ^{n}}{\left ( n\pi \right ) ^{3}}+\frac{1}{\left ( n\pi \right ) ^{3}}\right ) \\ & =4\left ( \frac{1-\left ( -1\right ) ^{n}}{\left ( n\pi \right ) ^{3}}\right ) \end{align*}
For odd \(n\), the above gives\begin{align*} b_{n} & =\left \{ 4\left ( \frac{2}{\pi ^{3}}\right ) ,4\left ( \frac{2}{\left ( 3\pi \right ) ^{3}}\right ) ,4\left ( \frac{2}{\left ( 5\pi \right ) ^{3}}\right ) ,\cdots \right \} \\ & =8\left \{ \left ( \frac{1}{\pi ^{3}}\right ) ,\left ( \frac{1}{\left ( 3\pi \right ) ^{3}}\right ) ,\left ( \frac{1}{\left ( 5\pi \right ) ^{3}}\right ) ,\cdots \right \} \end{align*}
And for even \(n\) all \(b_{n}=0\). Therefore\[ b_{n}=\left \{ \begin{array} [c]{ccc}\frac{8}{\left ( n\pi \right ) ^{3}} & & n=1,3,5,\cdots \\ 0 & & \text{otherwise}\end{array} \right . \] The Fourier sine series for \(f\left ( x\right ) \) can now be written as\begin{align*} f\left ( x\right ) & =\sum _{n=1,3,5,\cdots }b_{n}\sin \left ( n\pi x\right ) \\ & =\frac{8}{\pi ^{3}}\sum _{n=1,3,5,\cdots }\frac{1}{n^{3}}\sin \left ( n\pi x\right ) \end{align*}
Since \(f\left ( x\right ) =x\left ( 1-x\right ) ,\) the above is the same as \[ x\left ( 1-x\right ) =8\left ( \frac{1}{\pi ^{3}}\sin \left ( \pi x\right ) +\frac{1}{3^{3}\pi ^{3}}\sin \left ( 3\pi x\right ) +\frac{1}{5^{3}\pi ^{3}}\sin \left ( 5\pi x\right ) +\frac{1}{7^{3}\pi ^{3}}\sin \left ( 7\pi x\right ) +\cdots \right ) \] To obtain the required result, let \(x=\frac{1}{2}\) in the above, which gives\begin{align*} \frac{1}{2}\left ( 1-\frac{1}{2}\right ) & =8\left ( \frac{1}{1^{3}\pi ^{3}}\sin \left ( \frac{\pi }{2}\right ) +\frac{1}{3^{3}\pi ^{3}}\sin \left ( \frac{3}{2}\pi \right ) +\frac{1}{5^{3}\pi ^{3}}\sin \left ( \frac{5}{2}\pi \right ) +\frac{1}{7^{3}\pi ^{3}}\sin \left ( \frac{7}{2}\pi \right ) +\cdots \right ) \\ \frac{1}{4} & =\frac{8}{\pi ^{3}}\left ( \frac{1}{1^{3}}\sin \left ( \frac{\pi }{2}\right ) +\frac{1}{3^{3}}\sin \left ( \frac{3}{2}\pi \right ) +\frac{1}{5^{3}}\sin \left ( \frac{5}{2}\pi \right ) +\frac{1}{7^{3}}\sin \left ( \frac{7}{2}\pi \right ) +\cdots \right ) \\ \frac{\pi ^{3}}{32} & =\frac{1}{1^{3}}-\frac{1}{3^{3}}+\frac{1}{5^{3}}-\frac{1}{7^{3}}+\cdots \end{align*}
The above can also be written as\[ \frac{\pi ^{3}}{32}=\sum _{n=1}^{\infty }\frac{\left ( -1\right ) ^{n+1}}{\left ( -1+2n\right ) ^{3}}\]
Problem Find the solution to heat equation \(u_{t}=u_{xx}\) with initial conditions \(u\left ( x,0\right ) =f\left ( x\right ) \) with \(f\left ( x\right ) =x\left ( 1-x\right ) ,0\leq x\leq 1\) and boundary conditions \(u\left ( 0,t\right ) =u\left ( 1,t\right ) =0\). Approximate \(u\left ( \frac{1}{2},1\right ) \) to \(10\) decimal places.
solution
Using separation of variables, let \(u\left ( x,t\right ) =X\left ( x\right ) T\left ( t\right ) \). Substituting this back into the PDE gives\begin{align*} T^{\prime }X & =X^{\prime \prime }T\\ \frac{T^{\prime }}{T} & =\frac{X^{\prime \prime }}{X}=-\lambda \end{align*}
Where the separation constant is some real value \(-\lambda \). This gives the following two ODE’s to solve\begin{align} T^{\prime }+\lambda T & =0\tag{1}\\ X^{\prime \prime }+\lambda X & =0\tag{2} \end{align}
Starting with the spatial ODE in order to obtain the eigenvalues and eigenfunctions. The boundary conditions on the spatial ODE become\begin{align*} X\left ( 0\right ) & =0\\ X\left ( 1\right ) & =0 \end{align*}
Since equation (2) is a constant coefficient ODE, its characteristic equation is \(r^{2}+\lambda =0\), which has the solution \(r=\pm \sqrt{-\lambda }\), therefore its solution is given by\begin{align} X\left ( x\right ) & =c_{1}e^{rx}+c_{2}e^{-rx}\nonumber \\ & =c_{1}e^{\sqrt{-\lambda }x}+c_{2}e^{-\sqrt{-\lambda }x}\tag{3} \end{align}
There are three cases to consider, depending on if \(\lambda <0,\lambda =0,\lambda >0\). Each one of these cases gives a different solution that needs to be examined to see if the solution satisfies the boundary conditions.
Case 1 Assuming \(\lambda <0\). Therefore \(-\lambda \) is positive and \(\sqrt{-\lambda }\) is also positive. Let \(\sqrt{-\lambda }=\mu ,\) where \(\mu \) is some positive number. The solution (3) can now be written as\begin{equation} X\left ( x\right ) =c_{1}e^{\mu x}+c_{2}e^{-\mu x}\tag{3A} \end{equation} This can be rewritten in terms of the hyperbolic trig functions (to make it easier to manipulate) as\begin{equation} X\left ( x\right ) =c_{1}\cosh \left ( \mu x\right ) +c_{2}\sinh \left ( \mu x\right ) \tag{3B} \end{equation} Where the constants \(c_{i}\) in (3A) are different from the constants in (3B), but kept the same for simplicity of notation so as not to introduce new constants. Applying left boundary conditions to (3B) results in\[ 0=c_{1}\] The solution (3B) now reduces to\[ X\left ( x\right ) =c_{2}\sinh \left ( \mu x\right ) \] Applying right side boundary conditions to the above results in\[ 0=c_{2}\sinh \left ( \mu \right ) \] But \(\sinh \left ( \mu \right ) \neq 0\) since it was assumed \(\mu \) is not zero and \(\sinh \) is only zero when its argument is zero. The only possibility then is \(c_{2}=0,\) which leads to trivial solution. Therefore \(\lambda <0\) is not an eigenvalue.
Case 2. Assuming \(\lambda =0\). The ODE becomes \(X^{\prime \prime }=0\), which has the solution \[ X\left ( x\right ) =c_{1}x+c_{2}\] Applying left side B.C. gives\[ 0=c_{2}\] The solution now reduces to \[ X\left ( x\right ) =c_{1}x \] Applying right side B.C. gives\[ 0=c_{1}\] Leading to the trivial solution. Therefore \(\lambda =0\) is not an eigenvalue.
Case 3 Assuming \(\lambda >0\). In this case equation \(\sqrt{-\lambda }\) is complex and equation (3) can be expressed in terms of trig functions using Euler relation which results in\begin{equation} X\left ( x\right ) =c_{1}\cos \left ( \sqrt{\lambda }x\right ) +c_{2}\sin \left ( \sqrt{\lambda }x\right ) \tag{4} \end{equation} Applying left side B.C. gives\[ 0=c_{1}\] Solution (4) now reduces to\begin{equation} X\left ( x\right ) =c_{2}\sin \left ( \sqrt{\lambda }x\right ) \tag{5} \end{equation} Applying right side B.C. gives\[ 0=c_{2}\sin \left ( \sqrt{\lambda }\right ) \] Non-trivial solution implies \(\sin \left ( \sqrt{\lambda }\right ) =0\) or \(\sqrt{\lambda }=n\pi \) for \(n=1,2,3,\cdots \). Therefore the eigenvalues are\[ \lambda _{n}=\left ( n\pi \right ) ^{2}\qquad n=1,2,3,\cdots \] And the corresponding eigenfunctions from (5) are\begin{equation} X_{n}\left ( x\right ) =c_{n}\sin \left ( \sqrt{\lambda _{n}}x\right ) \tag{6} \end{equation} Now that the eigenvalues are known, the solution to the time ODE (1) can be found.\[ T^{\prime }+\lambda _{n}T=0 \] This has the solution (using an integrating factor method)\begin{equation} T_{n}\left ( t\right ) =e^{-\lambda _{n}t}\tag{7} \end{equation} The constant of integration is not needed for (7) since it will be absorbed with the constant of integration coming from solution of the spatial ODE (6) when these solutions are multiplied with each others below. Therefore the fundamental solution is\[ u_{n}\left ( x,t\right ) =T_{n}\left ( t\right ) X_{n}\left ( x\right ) \] Linear combination of fundamental solutions is also a solution (since this is a linear PDE). Therefore the general solution is given by\begin{align} u\left ( x,t\right ) & =\sum _{n=1}^{\infty }u_{n}\nonumber \\ & =\sum _{n=1}^{\infty }T_{n}\left ( t\right ) X_{n}\left ( x\right ) \nonumber \\ & =\sum _{n=1}^{\infty }c_{n}e^{-\lambda _{n}t}\sin \left ( \sqrt{\lambda _{n}}x\right ) \tag{8} \end{align}
Initial conditions is now used to determine \(c_{n}\), . At \(t=0\), \(u\left ( x,0\right ) =f\left ( x\right ) \) and the above becomes\[ f\left ( x\right ) =\sum _{n=1}^{\infty }c_{n}\sin \left ( \sqrt{\lambda _{n}}x\right ) \] Multiplying both sides of the above equation by eigenfunction \(\sin \left ( \sqrt{\lambda _{m}}x\right ) \) and integrating over the domain of \(f\left ( x\right ) \) gives\[ \int _{0}^{1}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{m}}x\right ) dx=\int _{0}^{1}\sum _{n=1}^{\infty }c_{n}\sin \left ( \sqrt{\lambda _{n}}x\right ) \sin \left ( \sqrt{\lambda _{m}}x\right ) dx \] Interchanging the order of summation and integration gives\[ \int _{0}^{1}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{m}}x\right ) dx=\sum _{n=1}^{\infty }c_{n}\int _{0}^{1}\sin \left ( \sqrt{\lambda _{n}}x\right ) \sin \left ( \sqrt{\lambda _{m}}x\right ) dx \] By the orthogonality of the sine functions, all terms in the right side vanish except when \(n=m\), leading to\begin{align*} \int _{0}^{1}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{m}}x\right ) dx & =c_{m}\int _{0}^{1}\sin ^{2}\left ( \sqrt{\lambda _{m}}x\right ) dx\\ & =c_{m}\frac{1}{2} \end{align*}
Therefore (replacing \(m\) back to \(n\) now, since it is arbitrary)
\[ c_{n}=2\int _{0}^{1}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) dx\qquad n=1,2,3,\cdots \] But \(\sqrt{\lambda _{n}}=n\pi \), hence\[ c_{n}=2\int _{0}^{1}f\left ( x\right ) \sin \left ( n\pi x\right ) dx\qquad n=1,2,3,\cdots \] Since \(f\left ( x\right ) \) is the same as in problem 2, the above shows that \(c_{n}\) is the same as \(b_{n}\) found in problem 2 above. This means \(c_{n}\) is the sine Fourier series coefficients of \(f\left ( x\right ) \) which was found in problem 2. Using that result obtained earlier \[ c_{n}=b_{n}=\left \{ \begin{array} [c]{ccc}\frac{8}{\left ( n\pi \right ) ^{3}} & & n=1,3,5,\cdots \\ 0 & & \text{otherwise}\end{array} \right . \] Using the above in (8), the general solution is therefore\begin{align*} u\left ( x,t\right ) & =\frac{8}{\pi ^{3}}\sum _{n=1,3,5,\cdots }^{\infty }\frac{1}{n^{3}}e^{-\lambda _{n}t}\sin \left ( \sqrt{\lambda _{n}}x\right ) \\ & =\frac{8}{\pi ^{3}}\sum _{n=1,3,5,\cdots }^{\infty }\frac{1}{n^{3}}e^{-n^{2}\pi ^{2}t}\sin \left ( n\pi x\right ) \end{align*}
The Following is plot of the solution for increasing values of time starting from \(t=0\), using 10 terms in the sum. At about \(t=0.3\) seconds, the temperature reduces to almost zero.
To approximate \(u\left ( \frac{1}{2},1\right ) \) to \(10\) decimal places, first the solution is written at \(x=\frac{1}{2}\) and \(t=1\). From above, the solution is\[ u\left ( \frac{1}{2},1\right ) =\frac{8}{\pi ^{3}}\sum _{n=1,3,5,\cdots }^{\infty }\frac{1}{n^{3}}e^{-n^{2}\pi ^{2}}\sin \left ( n\frac{\pi }{2}\right ) \] Due to the fast convergence, only one term was needed. Result for \(n=1\) and \(n=3\) are\begin{align*} u_{1}\left ( \frac{1}{2},1\right ) & =\frac{8}{\pi ^{3}}\left ( e^{-\pi ^{2}}\sin \left ( \frac{\pi }{2}\right ) \right ) =0.000013345216966776341\\ u_{3}\left ( \frac{1}{2},1\right ) & =\frac{8}{\pi ^{3}}\left ( e^{-\pi ^{2}}\sin \left ( \frac{\pi }{2}\right ) +\frac{1}{27}e^{-9\pi ^{2}}\sin \left ( 3\frac{\pi }{2}\right ) \right ) =0.000013345216966776341 \end{align*}
The above shows that the solution \(u_{1}\left ( \frac{1}{2},1\right ) \) did not change beyond the first 10 decimal points when adding one more term in the series. Therefore, only one term is needed. Therefore, the final result (rounded to 10 decimal points) is\[ \fbox{$u\left ( \frac{1}{2},1\right ) =0.0000133452$}\]
Problem Solve \(u_{t}+u=u_{xx}\) with initial conditions \(u\left ( x,0\right ) =f\left ( x\right ) \) and boundary conditions \(u\left ( 0,t\right ) =u\left ( L,t\right ) =0\).
solution
Using separation of variables, let \(u\left ( x,t\right ) =X\left ( x\right ) T\left ( t\right ) \). Substituting this back into the PDE gives\begin{align*} T^{\prime }X+TX & =X^{\prime \prime }T\\ \frac{T^{\prime }}{T}+1 & =\frac{X^{\prime \prime }}{X}=-\lambda \end{align*}
Where the separation constant is some real value \(-\lambda \). This gives the following two ODE’s to solve\begin{align} T^{\prime }+(1+\lambda )T & =0\tag{1}\\ X^{\prime \prime }+\lambda X & =0\tag{2} \end{align}
Starting with the spatial ODE in order to obtain the eigenvalues. The boundary conditions on the spatial ODE become\begin{align*} X\left ( 0\right ) & =0\\ X\left ( 1\right ) & =0 \end{align*}
The above boundary value ODE was solved in problem 3. The eigenvalues were found to be\[ \lambda _{n}=\left ( \frac{n\pi }{L}\right ) ^{2}\qquad n=1,2,3,\cdots \] And the corresponding eigenfunctions are\[ X_{n}\left ( x\right ) =c_{n}\sin \left ( \sqrt{\lambda _{n}}x\right ) \] The solution to the time ODE (1) using integrating factor method is\[ T\left ( t\right ) =e^{-\left ( 1+\lambda _{n}\right ) t}\] Therefore, as before, the general solution is obtained by linear combination of the fundamental solutions giving\begin{equation} u\left ( x,t\right ) =\sum _{n=1}^{\infty }c_{n}e^{-\left ( 1+\lambda _{n}\right ) t}\sin \left ( \sqrt{\lambda _{n}}x\right ) \tag{3} \end{equation} Initial conditions are used to determine \(c_{n}\). At \(t=0\), \(u\left ( x,0\right ) =f\left ( x\right ) \) and the above becomes\[ f\left ( x\right ) =\sum _{n=1}^{\infty }c_{n}\sin \left ( \sqrt{\lambda _{n}}x\right ) \] Multiplying both sides by \(\sin \left ( \sqrt{\lambda _{m}}x\right ) \) and integrating over the domain of \(f\left ( x\right ) \) gives\[ \int _{0}^{L}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{m}}x\right ) dx=\int _{0}^{L}\sum _{n=1}^{\infty }c_{n}\sin \left ( \sqrt{\lambda _{n}}x\right ) \sin \left ( \sqrt{\lambda _{m}}x\right ) dx \] Interchanging the order of summation and integrating gives\[ \int _{0}^{L}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{m}}x\right ) dx=\sum _{n=1}^{\infty }c_{n}\int _{0}^{L}\sin \left ( \sqrt{\lambda _{n}}x\right ) \sin \left ( \sqrt{\lambda _{m}}x\right ) dx \] By orthogonality of sine functions, all terms in the right side vanish except when \(n=m\), leading to\begin{align*} \int _{0}^{L}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{m}}x\right ) dx & =c_{m}\int _{0}^{L}\sin ^{2}\left ( \sqrt{\lambda _{m}}x\right ) dx\\ & =c_{m}\frac{L}{2} \end{align*}
Therefore\begin{equation} c_{n}=\frac{2}{L}\int _{0}^{L}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) dx\qquad n=1,2,3,\cdots \tag{4} \end{equation} But \(\sqrt{\lambda _{n}}=\frac{n\pi }{L}\), hence\[ c_{n}=\frac{2}{L}\int _{0}^{L}f\left ( x\right ) \sin \left ( \frac{n\pi }{L}x\right ) dx\qquad n=1,2,3,\cdots \] The above shows that \(c_{n}\) is the Fourier sine series of \(f\left ( x\right ) \). Since \(f\left ( x\right ) \) is not given, explicit solution for \(c_{n}\) can not be found. Therefore the final solution is\begin{align*} u\left ( x,t\right ) & =\sum _{n=1}^{\infty }c_{n}e^{-\left ( 1+\lambda _{n}\right ) t}\sin \left ( \sqrt{\lambda _{n}}x\right ) \\ & =\sum _{n=1}^{\infty }\left ( \frac{2}{L}\int _{0}^{L}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) dx\right ) e^{-\left ( 1+\lambda _{n}\right ) t}\sin \left ( \sqrt{\lambda _{n}}x\right ) \end{align*}
With \(\lambda _{n}=\left ( \frac{n\pi }{L}\right ) ^{2}\).