Problem Find the eigenvalues and normalized eigenfunctions of the RSL problem\begin{align} y^{\prime \prime }+\lambda y & =0\tag{1}\\ y\left ( 0\right ) -y^{\prime }\left ( 0\right ) & =0\nonumber \\ y\left ( \pi \right ) -y^{\prime }\left ( \pi \right ) & =0\nonumber \end{align}
solution
The characteristic equation for \(y^{\prime \prime }+\lambda y=0\) is given by \(r^{2}+\lambda =0\). Hence the roots are \[ r=\pm \sqrt{-\lambda }\] There are 3 cases to consider.
case \(\lambda =0\) This implies that \(r=0\) is a double root. The solution becomes\begin{align*} y & =c_{1}+c_{2}x\\ y^{\prime } & =c_{2} \end{align*}
The first boundary conditions \(y\left ( 0\right ) -y^{\prime }\left ( 0\right ) =0\) gives \(c_{1}-c_{2}=0\) or \(c_{1}=c_{2}.\) The above solution now becomes\begin{align*} y & =c_{1}\left ( 1+x\right ) \\ y^{\prime } & =c_{1} \end{align*}
The second boundary conditions \(y\left ( \pi \right ) -y^{\prime }\left ( \pi \right ) =0\) gives \(c_{1}\left ( 1+\pi \right ) -c_{1}=0\) or \(\pi =0\). Which is not possible. Therefore \(\lambda =0\) is not an eigenvalue.
case \(\lambda <0\) Let \(\lambda =-\omega ^{2}\) for some real \(\omega \). Hence the roots now are \(r=\pm \sqrt{\omega ^{2}}=\pm \omega \). Therefore the solution is\[ y=c_{1}e^{\omega x}+c_{2}e^{-\omega x}\] Since the exponents are real, the solution can be written in terms of hyperbolic trigonometric functions as\begin{align*} y & =c_{1}\cosh \omega x+c_{2}\sinh \omega x\\ y^{\prime } & =c_{1}\omega \sinh \omega x+c_{2}\omega \cosh \omega x \end{align*}
The first boundary conditions \(y\left ( 0\right ) -y^{\prime }\left ( 0\right ) =0\) gives \(0=c_{1}-c_{2}\omega \) or \(c_{1}=c_{2}\omega \). Therefore the above solution becomes\begin{align} y & =c_{2}\omega \cosh \omega x+c_{2}\sinh \omega x\tag{2}\\ & =c_{2}\left ( \omega \cosh \omega x+\sinh \omega x\right ) \nonumber \end{align}
Hence\[ y^{\prime }=c_{2}\left ( \omega ^{2}\sinh \omega x+\omega \cosh \omega x\right ) \] The second boundary conditions \(y\left ( \pi \right ) -y^{\prime }\left ( \pi \right ) =0\) gives\begin{align*} 0 & =c_{2}\left ( \omega \cosh \omega \pi +\sinh \omega \pi \right ) -c_{2}\left ( \omega ^{2}\sinh \omega \pi +\omega \cosh \omega \pi \right ) \\ & =c_{2}\left ( \omega \cosh \omega \pi +\sinh \omega \pi -\omega ^{2}\sinh \omega \pi -\omega \cosh \omega \pi \right ) \\ & =c_{2}\left ( \sinh \omega \pi -\omega ^{2}\sinh \omega \pi \right ) \\ & =c_{2}\left ( 1-\omega ^{2}\right ) \sinh \omega \pi \end{align*}
Non-trivial solution implies either \(\left ( 1-\omega ^{2}\right ) =0\) or \(\sinh \omega \pi =0\). But \(\sinh \omega \pi =0\) only when its argument is zero. But \(\omega \neq 0\) in this case. The other option is that \(\left ( 1-\omega ^{2}\right ) =0\). This implies \(\omega ^{2}=1\) or, since \(\lambda =-\omega ^{2}\), that \(\lambda =-1\). Hence \(\lambda =-1\) is an eigenvalue. Therefore the solution from (2) above becomes\begin{align*} y\left ( x\right ) & =c_{2}\cosh x+c_{2}\sinh x\\ & =c_{2}\left ( \cosh x+\sinh x\right ) \end{align*}
But \(e^{x}=\cosh x+\sinh x\), hence the solution can be written as \[ y=c_{2}e^{x}\] The eigenfunction in this case is therefore\[ \Phi _{-1}\left ( x\right ) =e^{x}\] To obtain the normalized eigenfunction, let \(\hat{\Phi }_{-1}\left ( x\right ) =k_{-1}\Phi _{-1}\left ( x\right ) \). The normalization factor \(k_{-1}\) is found by setting \(\int _{0}^{\pi }\left ( r\left ( x\right ) \hat{\Phi }_{-1}\left ( x\right ) \right ) ^{2}dx=1\). But the weight \(r\left ( x\right ) =1\) in this problem from looking at the Sturm Liouville form given. Therefore solving\begin{align*} \int _{0}^{\pi }\hat{\Phi }_{-1}^{2}\left ( x\right ) dx & =1\\ \int _{0}^{\pi }\left ( k_{-1}e^{x}\right ) ^{2}dx & =1\\ k_{-1}^{2}\int _{0}^{\pi }e^{2x}dx & =1\\ k_{-1}^{2}\left ( \frac{e^{2x}}{2}\right ) _{0}^{\pi } & =1\\ \frac{k_{-1}^{2}}{2}\left ( e^{2\pi }-1\right ) & =1 \end{align*}
Therefore\[ k_{-1}=\frac{\sqrt{2}}{\sqrt{e^{2\pi }-1}}\] Hence the normalized eigenfunction is\[ \hat{\Phi }_{-1}\left ( x\right ) =\left ( \frac{\sqrt{2}}{\sqrt{e^{2\pi }-1}}\right ) e^{x}\] case \(\lambda >1\) Since \(\lambda \) is positive, then the roots are \(r=\pm \sqrt{-\lambda }=\pm i\sqrt{\lambda }\). This gives the solution\[ y=c_{1}e^{i\sqrt{\lambda }x}+c_{2}e^{-i\sqrt{\lambda }x}\] Since the exponents are complex, the above solution can be written in terms of the circular trigonometric functions as\begin{align*} y & =c_{1}\cos \left ( \sqrt{\lambda }x\right ) +c_{2}\sin \sqrt{\lambda }x\\ y^{\prime } & =-c_{1}\sqrt{\lambda }\sin \left ( \sqrt{\lambda }x\right ) +c_{2}\sqrt{\lambda }\cos \sqrt{\lambda }x \end{align*}
The first boundary conditions \(y\left ( 0\right ) -y^{\prime }\left ( 0\right ) =0\) gives \(0=c_{1}-c_{2}\sqrt{\lambda }\) or \(c_{1}=c_{2}\sqrt{\lambda }\). The above solution becomes\begin{align} y & =c_{2}\sqrt{\lambda }\cos \left ( \sqrt{\lambda }x\right ) +c_{2}\sin \sqrt{\lambda }x\tag{3}\\ & =c_{2}\left ( \sqrt{\lambda }\cos \left ( \sqrt{\lambda }x\right ) +\sin \sqrt{\lambda }x\right ) \nonumber \end{align}
Therefore\[ y^{\prime }=c_{2}\left ( -\lambda \sin \left ( \sqrt{\lambda }x\right ) +\sqrt{\lambda }\cos \sqrt{\lambda }x\right ) \] Applying second boundary condition \(y\left ( \pi \right ) -y^{\prime }\left ( \pi \right ) =0\) to the above gives\begin{align*} 0 & =c_{2}\left ( \sqrt{\lambda }\cos \left ( \sqrt{\lambda }\pi \right ) +\sin \left ( \sqrt{\lambda }\pi \right ) \right ) -c_{2}\left ( -\lambda \sin \left ( \sqrt{\lambda }\pi \right ) +\sqrt{\lambda }\cos \left ( \sqrt{\lambda }\pi \right ) \right ) \\ & =c_{2}\left ( \sqrt{\lambda }\cos \left ( \sqrt{\lambda }\pi \right ) +\sin \left ( \sqrt{\lambda }\pi \right ) +\lambda \sin \left ( \sqrt{\lambda }\pi \right ) -\sqrt{\lambda }\cos \left ( \sqrt{\lambda }\pi \right ) \right ) \\ & =c_{2}\left ( \sin \left ( \sqrt{\lambda }\pi \right ) +\lambda \sin \left ( \sqrt{\lambda }\pi \right ) \right ) \\ & =c\left ( 1+\lambda \right ) \sin \left ( \sqrt{\lambda }\pi \right ) \end{align*}
For non-trivial solution, either \(1+\lambda =0\) or \(\sin \left ( \sqrt{\lambda }\pi \right ) =0\). But \(1+\lambda =0\) implies \(\lambda =-1\). But it is assumed that \(\lambda \) is positive. The other possibility is that \(\sin \left ( \sqrt{\lambda }\pi \right ) =0\) which implies\[ \sqrt{\lambda }\pi =n\pi \qquad n=1,2,3,\cdots \] Or\[ \lambda _{n}=n^{2}\qquad 1,2,3,\cdots \] The corresponding solution from (3) becomes\[ y_{n}\left ( x\right ) =c_{n}\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \] Therefore the eigenfunctions are\[ \Phi _{n}\left ( x\right ) =n\cos \left ( nx\right ) +\sin \left ( nx\right ) \] To obtain the normalized eigenfunctions, as was done above, \(\int _{0}^{\pi }\left ( r\left ( x\right ) \hat{\Phi }_{n}\left ( x\right ) \right ) ^{2}dx=1\) is solved for\(\ k_{n}\) giving\begin{align} \int _{0}^{\pi }\left ( k_{n}\Phi _{n}\left ( x\right ) \right ) ^{2}dx & =1\nonumber \\ k_{n}^{2}\int _{0}^{\pi }\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) ^{2}dx & =1\nonumber \\ k_{n}^{2}\int _{0}^{\pi }\left ( n^{2}\cos ^{2}\left ( nx\right ) +\sin ^{2}\left ( nx\right ) +2n\cos \left ( nx\right ) \sin \left ( nx\right ) \right ) dx & =1\nonumber \\ n^{2}\int _{0}^{\pi }\cos ^{2}\left ( nx\right ) dx+\int _{0}^{\pi }\sin ^{2}\left ( nx\right ) dx+2n\int _{0}^{\pi }\cos \left ( nx\right ) \sin \left ( nx\right ) dx & =\frac{1}{k_{n}^{2}}\tag{4} \end{align}
But \(\int _{0}^{\pi }\cos ^{2}\left ( nx\right ) dx=\frac{\pi }{2}\) and \(\int _{0}^{\pi }\sin ^{2}\left ( nx\right ) dx=\frac{\pi }{2}\) and for the last integral above \begin{align*} \int _{0}^{\pi }\cos \left ( nx\right ) \sin \left ( nx\right ) dx & =\int _{0}^{\pi }\frac{1}{2}\sin \left ( 2nx\right ) dx\\ & =\frac{1}{2}\left ( \frac{-\cos \left ( 2nx\right ) }{2n}\right ) _{0}^{\pi }\\ & =\frac{-1}{4n}\left ( \cos \left ( 2nx\right ) \right ) _{0}^{\pi }\\ & =\frac{-1}{4n}\left ( \cos \left ( 2n\pi \right ) -1\right ) \end{align*}
But \(\cos \left ( 2n\pi \right ) =1\) because \(n=1,2,3,\cdots \). Therefore the above simplifies to \(\int _{0}^{\pi }\cos \left ( nx\right ) \sin \left ( nx\right ) dx=0\). Using these results in (4) gives\[ k_{n}^{2}\left ( n^{2}\frac{\pi }{2}+\frac{\pi }{2}\right ) =1 \] Or\[ k_{n}=\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\] The normalized eigenfunctions are therefore\[ \hat{\Phi }_{n}\left ( x\right ) =\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \qquad n=1,2,3,\cdots \] In summary
\(\lambda =-1\) is eigenvalue with corresponding normalized eigenfunction \(\hat{\Phi }_{-1}\left ( x\right ) =\left ( \frac{\sqrt{2}}{\sqrt{e^{2\pi }-1}}\right ) e^{x}\)
\(\lambda _{n}=n^{2}\) for \(n=1,2,\cdots \) with corresponding normalized eigenfunctions \(\hat{\Phi }_{n}\left ( x\right ) =\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \).
The normalized eigenfunctions \(\hat{\Phi }_{-1},\hat{\Phi }_{1},\hat{\Phi }_{2},\hat{\Phi }_{3}\) are plotted next to each others below
The normalized eigenfunctions \(\hat{\Phi }_{-1},\hat{\Phi }_{1},\hat{\Phi }_{2},\hat{\Phi }_{3}\) are plotted on the same plot below as well for illustration.
Some observations: The first eigenfunction \(\hat{\Phi }_{-1}\left ( x\right ) \) has no root in \(\left [ 0,\pi \right ] \), the second eigenfunction \(\hat{\Phi }_{1}\) has one root in \(\left [ 0,\pi \right ] \) and the third eigefunction has two roots in \(\left [ 0,\pi \right ] \) and so on. This is what is to be expected. The \(n^{th}\) ordered eigenfunction will have \(\left ( n-1\right ) \) number of roots (or \(x\) axis crossings) inside the domain.
Problem Expand \(f\left ( x\right ) =1\) in a series of eigenfunctions of problem 1
solution
Let \begin{equation} f\left ( x\right ) =b_{-1}\hat{\Phi }_{-1}\left ( x\right ) +\sum _{n=1}^{\infty }b_{n}\hat{\Phi }_{n}\left ( x\right ) \tag{1} \end{equation} The goal is to determine \(b_{-1},b_{1},b_{2},\cdots \). This is done by applying orthogonality. Multiplying both sides of (1) by \(r\left ( x\right ) \hat{\Phi }_{-1}\left ( x\right ) \) and integrating over the domain gives\[ \int _{0}^{\pi }r\left ( x\right ) f\left ( x\right ) \hat{\Phi }_{-1}\left ( x\right ) dx=\int _{0}^{\pi }b_{-1}r\left ( x\right ) \hat{\Phi }_{-1}^{2}\left ( x\right ) dx+\sum _{n=1}^{\infty }b_{n}\int _{0}^{\pi }r\left ( x\right ) \hat{\Phi }_{-1}\left ( x\right ) \hat{\Phi }_{n}\left ( x\right ) dx \] But \(r\left ( x\right ) =1\) and due to orthogonality of eigenfunctions, all terms in the sum are zero. The above simplifies to\[ \int _{0}^{\pi }f\left ( x\right ) \hat{\Phi }_{-1}\left ( x\right ) dx=b_{-1}\int _{0}^{\pi }\hat{\Phi }_{-1}^{2}\left ( x\right ) dx \] But \(f\left ( x\right ) =1\) and \(\int _{0}^{\pi }\hat{\Phi }_{-1}^{2}\left ( x\right ) dx=1\) since normalized eigenfunctions. Hence the above becomes\[ b_{-1}=\int _{0}^{\pi }\hat{\Phi }_{-1}\left ( x\right ) dx \] From problem one, \(\hat{\Phi }_{-1}\left ( x\right ) =\left ( \frac{\sqrt{2}}{\sqrt{e^{2\pi }-1}}\right ) e^{x}\), therefore the above becomes\begin{align*} b_{-1} & =\frac{\sqrt{2}}{\sqrt{e^{2\pi }-1}}\int _{0}^{\pi }e^{x}dx\\ & =\frac{\sqrt{2}}{\sqrt{e^{2\pi }-1}}\left [ e^{x}\right ] _{0}^{\pi }\\ & =\frac{\sqrt{2}\left ( e^{\pi }-1\right ) }{\sqrt{e^{2\pi }-1}} \end{align*}
Going back to equation (1), but now the equation is multiplied by \(r\left ( x\right ) \hat{\Phi }_{m}\left ( x\right ) \) for \(m>0\) and integrated using \(r\left ( x\right ) =1\) and \(f\left ( x\right ) =1\) giving\[ \int _{0}^{\pi }\hat{\Phi }_{m}\left ( x\right ) dx=\int _{0}^{\pi }b_{-1}\hat{\Phi }_{-1}\left ( x\right ) \hat{\Phi }_{m}\left ( x\right ) dx+\sum _{n=1}^{\infty }b_{n}\int _{0}^{\pi }\hat{\Phi }_{n}\left ( x\right ) \hat{\Phi }_{m}\left ( x\right ) dx \] Due to orthogonality of eigenfunctions, the above simplifies to\[ \int _{0}^{\pi }\hat{\Phi }_{m}\left ( x\right ) dx=b_{m}\int _{0}^{\pi }\hat{\Phi }_{m}^{2}\left ( x\right ) dx \] But \(\int _{0}^{\pi }\hat{\Phi }_{m}^{2}\left ( x\right ) dx=1,\) therefore the above becomes\[ b_{n}=\int _{0}^{\pi }\hat{\Phi }_{n}\left ( x\right ) dx \] From problem one, using \(\hat{\Phi }_{n}\left ( x\right ) =\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \) the above becomes\begin{align*} b_{n} & =\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\int _{0}^{\pi }\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) dx\\ & =\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( \int _{0}^{\pi }n\cos \left ( nx\right ) dx+\int _{0}^{\pi }\sin \left ( nx\right ) dx\right ) \\ & =\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( n\left [ \frac{\sin \left ( nx\right ) }{n}\right ] _{0}^{\pi }-\left [ \frac{\cos \left ( nx\right ) }{n}\right ] _{0}^{\pi }\right ) \\ & =\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( \sin \left ( n\pi \right ) -\frac{1}{n}\left [ \cos \left ( n\pi \right ) -1\right ] \right ) \end{align*}
But \(\sin \left ( n\pi \right ) =0\) since \(n\) is integer and \(\cos \left ( n\pi \right ) =\left ( -1\right ) ^{n}\). The above becomes\begin{align*} b_{n} & =\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( -\frac{1}{n}\left [ -1^{n}-1\right ] \right ) \\ & =\frac{\sqrt{2}}{n\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( \left ( -1\right ) ^{n+1}+1\right ) \end{align*}
For \(n=1,3,5,\cdots \) the above simplifies to \[ b_{n}=\frac{2\sqrt{2}}{n\sqrt{\pi \left ( 1+n^{2}\right ) }}\] And for \(n=2,4,6,\cdots \) gives \(b_{n}=0\). Therefore the expansion (1) becomes\begin{align*} f\left ( x\right ) & =\frac{\sqrt{2}\left ( e^{\pi }-1\right ) }{\sqrt{e^{2\pi }-1}}\hat{\Phi }_{-1}\left ( x\right ) +\sum _{n=1,3,5,\cdots }^{\infty }\frac{2\sqrt{2}}{n\sqrt{\pi \left ( 1+n^{2}\right ) }}\hat{\Phi }_{n}\left ( x\right ) \\ 1 & =\frac{\sqrt{2}\left ( e^{\pi }-1\right ) }{\sqrt{e^{2\pi }-1}}\left ( \frac{\sqrt{2}}{\sqrt{e^{2\pi }-1}}\right ) e^{x}+\sum _{n=1,3,5,\cdots }^{\infty }\frac{2\sqrt{2}}{n\sqrt{\pi \left ( 1+n^{2}\right ) }}\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \\ 1 & =\frac{2\left ( e^{\pi }-1\right ) }{e^{2\pi }-1}e^{x}+\frac{4}{\pi }\sum _{n=1,3,5,\cdots }^{\infty }\frac{1}{n\left ( 1+n^{2}\right ) }\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \end{align*}
The above can also be written as\[ 1=\frac{2\left ( e^{\pi }-1\right ) }{e^{2\pi }-1}e^{x}+\frac{4}{\pi }\sum _{n=1}^{\infty }\frac{1}{\left ( 2n-1\right ) \left ( 1+\left ( 2n-1\right ) ^{2}\right ) }\left ( \left ( 2n-1\right ) \cos \left ( \left ( 2n-1\right ) x\right ) +\sin \left ( \left ( 2n-1\right ) x\right ) \right ) \] To verify the above result, it is plotted for increasing number of \(n\) and compared to \(f\left ( x\right ) =1\) to see how well it converges.
Some observations: As more terms are added, the series approximation approaches \(f\left ( x\right ) =1\) more. The convergence is more rapid in the internal of the domain than near the edges. Near the edges at \(x=0\) and \(x=1\) , more terms are needed to get better approximation. More oscillation is seen near the edges. This is due to Gibbs phenomenon. Converges is of the order of \(O\left ( \frac{1}{n^{2}}\right ) \) and the converges is to the mean of \(f\left ( x\right ) \).
Problem Consider the regular SL problem\begin{align} y^{\prime \prime }+\lambda y & =0\tag{1}\\ y\left ( 0\right ) & =0\nonumber \\ 2y\left ( 1\right ) -y^{\prime }\left ( 1\right ) & =0\nonumber \end{align}
Show that the problem has exactly one negative eigenvalue and compute numerically.
solution
The characteristic equation is \(r^{2}+\lambda =0\). Therefore the roots are \(r=\pm \sqrt{-\lambda }\). There are 3 cases to consider. This problem is asking only for the negative eigenvalues. Therefore only the case \(\lambda <0\) is considered.
Let \(\lambda =-\omega ^{2}\) for some real constant. The roots are \(r=\pm \sqrt{\omega ^{2}}=\pm \omega \). The solution becomes\[ y=c_{1}e^{\omega x}+c_{2}e^{-\omega x}\] Since the exponents are real, the solution can be written in terms of hyperbolic trigonometric functions\[ y=c_{1}\cosh \omega x+c_{2}\sinh \omega x \] The first boundary conditions \(y\left ( 0\right ) =0\) gives \(0=c_{1}\). The solution becomes\begin{align} y & =c_{2}\sinh \omega x\tag{2}\\ y^{\prime } & =c_{2}\omega \cosh \omega x\nonumber \end{align}
Applying the second boundary conditions \(2y\left ( 1\right ) -y^{\prime }\left ( \pi \right ) =0\) gives\begin{align*} 0 & =2c_{2}\sinh \omega -c_{2}\omega \cosh \omega \\ & =c_{2}\left ( 2\sinh \omega -\omega \cosh \omega \right ) \end{align*}
Non trivial solution requires that \begin{align*} 2\sinh \omega -\omega \cosh \omega & =0\\ 2\tanh \omega & =\omega \end{align*}
The above equation needs to be solved numerically to find its real roots \(\omega \). One root is \(\omega =0\), but this implies \(\lambda =0\). To find if there are other real roots, the function \(2\tanh \omega \) and \(\omega \) were plotted and where they intersect is located. Root finding was then used to obtain the exact numerical value of the roots. The plot below shows that near \(\omega =\pm 2\) there is an intersection. There are no other roots since the line \(f\left ( \omega \right ) =\omega \) will keep increasing/decreasing and will not intersect \(f\left ( \omega \right ) =2\tanh \omega \) any more after these two roots.
Numerical root finding was used to find the roots near points of intersections. It shows that the exact value of \(\omega =\pm 1.91501\). Since \(\lambda =-\omega ^{2}\), therefore\[ \fbox{$\lambda =-3.66726$}\] Is the only negative eigenvalue.
Problem Solve the inhomogeneous B.V.P.\begin{align} -y^{\prime \prime } & =\mu y+1\tag{1}\\ y\left ( 0\right ) -y^{\prime }\left ( 0\right ) & =0\nonumber \\ y\left ( \pi \right ) -y^{\prime }\left ( \pi \right ) & =0\nonumber \end{align}
for \(\mu =0,\) \(\mu =1\) by methods of section 11.3
\begin{align*} -y^{\prime \prime }-\mu y & =1\\ y^{\prime \prime }+\mu y & =-1 \end{align*}
Using chapter 11.3 method, first the eigenfunctions for the corresponding homogenous ODE \(y^{\prime \prime }+\mu y=0\) are found for the same boundary conditions. In problem one, it was found that \(\lambda =-1\) is eigenvalue with corresponding normalized eigenfunction \(\hat{\Phi }_{-1}\left ( x\right ) =\left ( \frac{\sqrt{2}}{\sqrt{e^{2\pi }-1}}\right ) e^{x}\) and \(\lambda _{n}=n^{2}\) for \(n=1,2,\cdots \) with corresponding normalized eigenfunctions \(\hat{\Phi }_{n}\left ( x\right ) =\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \). Since \(\lambda =0\) is not an eigenvalue of the corresponding homogeneous B.V.P., then there is a solution which is by eigenfunction expansion is given by\begin{equation} y=b_{-1}\hat{\Phi }_{-1}\left ( x\right ) +\sum _{n=1}^{\infty }b_{n}\hat{\Phi }_{n}\left ( x\right ) \tag{1} \end{equation} Substituting this back into the original ODE gives\[ \left ( b_{-1}\hat{\Phi }_{-1}^{\prime \prime }\left ( x\right ) +\sum _{n=1}^{\infty }b_{n}\hat{\Phi }_{n}^{\prime \prime }\left ( x\right ) \right ) +\mu \left ( b_{-1}\hat{\Phi }_{-1}\left ( x\right ) +\sum _{n=1}^{\infty }b_{n}\hat{\Phi }_{n}\left ( x\right ) \right ) =c_{-1}\hat{\Phi }_{-1}\left ( x\right ) +\sum _{n=1}^{\infty }c_{n}\hat{\Phi }_{n}\left ( x\right ) \] Where \(-1=c_{-1}\hat{\Phi }_{-1}\left ( x\right ) +\sum _{n=1}^{\infty }c_{n}\hat{\Phi }_{n}\left ( x\right ) \,\) is the eigenfunction expansion of \(-1\). Since \(\mu =0\), and \(\hat{\Phi }_{n}^{\prime \prime }\left ( x\right ) =-\lambda _{n}\hat{\Phi }_{n}\left ( x\right ) \), the above simplifies to\[ -\lambda _{-1}b_{-1}\hat{\Phi }_{-1}\left ( x\right ) -\sum _{n=1}^{\infty }b_{n}\lambda _{n}\hat{\Phi }_{n}\left ( x\right ) =c_{-1}\hat{\Phi }_{-1}\left ( x\right ) +\sum _{n=1}^{\infty }c_{n}\hat{\Phi }_{n}\left ( x\right ) \] Therefore, equating coefficients gives\begin{align*} -\lambda _{-1}b_{-1} & =c_{-1}\\ -b_{n}\lambda _{n} & =c_{n} \end{align*}
Or\begin{align} b_{-1} & =-\frac{c_{-1}}{\lambda _{-1}}\tag{2}\\ b_{n} & =-\frac{c_{n}}{\lambda _{n}}\nonumber \end{align}
What is left is to find \(c_{-1},c_{n}\). These are found by applying orthogonality since\[ -1=c_{-1}\hat{\Phi }_{-1}\left ( x\right ) +\sum _{n=1}^{\infty }c_{n}\hat{\Phi }_{n}\left ( x\right ) \] This was done in problem 2. The difference is the minus sign. Therefore the result from problem 2 is used but \(c_{-1},c_{n}\) from problem 2 are now multiplied by \(-1\) giving\begin{align*} c_{-1} & =-\frac{\sqrt{2}\left ( e^{\pi }-1\right ) }{\sqrt{e^{2\pi }-1}}\\ c_{n} & =-\frac{2\sqrt{2}}{n\sqrt{\pi \left ( 1+n^{2}\right ) }}\qquad n=1,3,5,\cdots \end{align*}
Now that \(c_{-1},c_{n}\) are found, using equation (2) \(b_{-1},b_{n}\) are can now be found\begin{align*} b_{-1} & =\frac{\frac{\sqrt{2}\left ( e^{\pi }-1\right ) }{\sqrt{e^{2\pi }-1}}}{\left ( -1\right ) }=-\frac{\sqrt{2}\left ( e^{\pi }-1\right ) }{\sqrt{e^{2\pi }-1}}\\ b_{n} & =\frac{\frac{2\sqrt{2}}{n\sqrt{\pi \left ( 1+n^{2}\right ) }}}{n^{2}}=\frac{2\sqrt{2}}{n^{3}\sqrt{\pi \left ( 1+n^{2}\right ) }}\qquad n=1,3,5,\cdots \end{align*}
Hence the solution (1) becomes\begin{align} y & =b_{-1}\hat{\Phi }_{-1}\left ( x\right ) +\sum _{n=1}^{\infty }b_{n}\hat{\Phi }_{n}\left ( x\right ) \nonumber \\ & =-\frac{\sqrt{2}\left ( e^{\pi }-1\right ) }{\sqrt{e^{2\pi }-1}}\hat{\Phi }_{-1}\left ( x\right ) +\sum _{n=1,3,5,\cdots }^{\infty }\frac{2\sqrt{2}}{n^{3}\sqrt{\pi \left ( 1+n^{2}\right ) }}\hat{\Phi }_{n}\left ( x\right ) \nonumber \\ & =-\frac{\sqrt{2}\left ( e^{\pi }-1\right ) }{\sqrt{e^{2\pi }-1}}\left ( \frac{\sqrt{2}}{\sqrt{e^{2\pi }-1}}\right ) e^{x}+\sum _{n=1,3,5,\cdots }^{\infty }\frac{2\sqrt{2}}{n^{3}\sqrt{\pi \left ( 1+n^{2}\right ) }}\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \nonumber \\ & =-\frac{2\left ( e^{\pi }-1\right ) }{e^{2\pi }-1}e^{x}+\frac{4}{\pi }\sum _{n=1,3,5,\cdots }^{\infty }\frac{1}{n^{3}\left ( 1+n^{2}\right ) }\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \tag{2A} \end{align}
The above can also be also be written as\begin{equation} y\left ( x\right ) =-\frac{2\left ( e^{\pi }-1\right ) }{e^{2\pi }-1}e^{x}+\frac{4}{\pi }\sum _{n=1}^{\infty }\frac{1}{\left ( 2n-1\right ) ^{3}\left ( 1+\left ( 2n-1\right ) ^{2}\right ) }\left ( \left ( 2n-1\right ) \cos \left ( \left ( 2n-1\right ) x\right ) +\sin \left ( \left ( 2n-1\right ) x\right ) \right ) \tag{2A} \end{equation} To verify the above solution, it was plotted against the solution of \(y^{\prime \prime }=-1\) found using the direct method to see if they match. The solution using the direct method is found as follows: The homogenous solution is \(y_{h}=c_{1}+c_{2}x\). Let \(y_{p}=kx^{2},y_{p}^{\prime }=2kx,y_{p}^{\prime \prime }=2k\). Substituting these back into \(y^{\prime \prime }=-1\) gives \(2k=-1\) or \(k=-\frac{1}{2}\). Hence \(y_{p}=-\frac{x^{2}}{2}\) and the solution becomes \begin{align*} y & =y_{h}+y_{p}\\ & =c_{1}+c_{2}x-\frac{x^{2}}{2} \end{align*}
Boundary conditions are now applied to determine \(c_{1},c_{2}\). From above, \(y^{\prime }\left ( x\right ) =c_{2}-x\). Applying \(y\left ( 0\right ) -y^{\prime }\left ( 0\right ) =0\) gives\begin{align*} 0 & =c_{1}-c_{2}\\ c_{2} & =c_{1} \end{align*}
Therefore the solution becomes \begin{align*} y\left ( x\right ) & =c_{1}\left ( 1+x\right ) -\frac{x^{2}}{2}\\ y^{\prime }\left ( x\right ) & =c_{1}-x \end{align*}
Applying second BC \(y\left ( \pi \right ) -y^{\prime }\left ( \pi \right ) =0\) gives\begin{align*} 0 & =c_{1}\left ( 1+\pi \right ) -\frac{\pi ^{2}}{2}-c_{1}+\pi \\ 0 & =c_{1}\left ( 1+\pi -1\right ) -\frac{\pi ^{2}}{2}+\pi \\ c_{1} & =\frac{\frac{\pi ^{2}}{2}-\pi }{\pi }\\ & =\frac{\pi }{2}-1 \end{align*}
Therefore, the solution, using direct method is\begin{align} y\left ( x\right ) & =\left ( \frac{\pi }{2}-1\right ) \left ( 1+x\right ) -\frac{x^{2}}{2}\nonumber \\ & =\frac{\pi }{2}+\frac{\pi }{2}x-1-x-\frac{x^{2}}{2}\nonumber \end{align}
Or\begin{equation} \fbox{$y\left ( x\right ) =-\frac{x^2}{2}+x\left ( \frac{\pi }{2}-1\right ) -1+\frac{\pi }{2}$}\tag{3} \end{equation} What the above says, is that if (2A) solution is correct, it will converge to solution (3) as more terms are added. In other words\[ -\frac{x^{2}}{2}+x\left ( \frac{\pi }{2}-1\right ) -1+\frac{\pi }{2}\approx -\frac{2\left ( e^{\pi }-1\right ) }{e^{2\pi }-1}e^{x}+\frac{4}{\pi }\sum _{n=1,3,5,\cdots }^{\infty }\frac{1}{n^{3}\left ( 1+n^{2}\right ) }\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \] To verify this, the solution from both the direct and the series method were plotted next to each other. Using only \(n=10\) in the sum shows that the plots are identical.
Then the difference between these two solution was plotted. A maximum of \(n=50\) is used in the sum. The plot shows the difference is almost zero in the internal region and near the edges of the domain the difference of order \(10^{-7}.\) This is expected due to Gibbs phenomenon. Adding more terms made the difference smaller. The converges is of order \(O\left ( \frac{1}{n^{2}}\right ) \).
Now the same process as in part (a) is repeated for \(\mu =1\)\begin{align*} -y^{\prime \prime }-\mu y & =1\\ y^{\prime \prime }+\mu y & =-1 \end{align*}
Using 11.3 method, first the eigenfunctions for the corresponding homogenous ODE \(y^{\prime \prime }+\mu y=0\) are found for the same boundary conditions. In problem one, it was found that \(\lambda =-1\) is eigenvalue with corresponding normalized eigenfunction \(\hat{\Phi }_{-1}\left ( x\right ) =\left ( \frac{\sqrt{2}}{\sqrt{e^{2\pi }-1}}\right ) e^{x}\) and \(\lambda _{n}=n^{2}\) for \(n=1,2,\cdots \) with corresponding normalized eigenfunctions \(\hat{\Phi }_{n}\left ( x\right ) =\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) \). Therefore \(\lambda =1\) is an eigenvalue that corresponds to \(\mu =1\). In this case, a solution will exist (and will not be unique) only if the forcing function \(-1\) is orthogonal to \(\hat{\Phi }_{1}\left ( x\right ) \). This is verified as follows. Since \(r\left ( x\right ) =1\), and \(n=1\), then\begin{align*} \int _{0}^{\pi }\left ( -1\right ) r\left ( x\right ) \hat{\Phi }_{1}\left ( x\right ) dx & =-\int _{0}^{\pi }\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+n^{2}\right ) }}\left ( n\cos \left ( nx\right ) +\sin \left ( nx\right ) \right ) dx\\ & =-\int _{0}^{\pi }\frac{\sqrt{2}}{\sqrt{\pi \left ( 1+1\right ) }}\left ( \cos \left ( x\right ) +\sin \left ( x\right ) \right ) dx\\ & =\frac{-\sqrt{2}}{\sqrt{2\pi }}\int _{0}^{\pi }\cos \left ( x\right ) +\sin \left ( x\right ) dx\\ & =\frac{-1}{\sqrt{\pi }}\left ( \left ( \sin x\right ) _{0}^{\pi }-\left ( \cos x\right ) _{0}^{\pi }\right ) \\ & =\frac{-1}{\sqrt{\pi }}\left ( 0-\left ( -1-1\right ) \right ) \\ & =\frac{-2}{\sqrt{\pi }} \end{align*}
Which is not zero. This means there is no solution.