Example of using a differential equation to find basis

Solve the eigenvalue problem $$ \begin{align*} \begin{cases} y'' - 2y' + \lambda y = 0, &0<x<1, \\ y(0) = 0, \\ y'(1) = 0. \end{cases} \end{align*} $$

The integrating factor $I(x) = \exp\int (-2)/1 \d x = e^{-2x}$. Multiplying $I(x)$, we can identify the Sturm-Liouville operator $$ \begin{align*} e^{-2x}(y'' - 2y' + \lambda y) = \dd{x}(e^{-2x}y') + \lambda e^{-2x}y \end{align*} $$ with $p = -e^{2x}, q=0, w=e^{-2x}$. Now that we have found the weight function, we know what inner product to use.

Now we solve the original equation. Taking $y = e^{\alpha x}$, we get $$ \begin{align*} \alpha^2 - 2\alpha + \lambda = 0 \iff \alpha = 1\pm \sqrt{1-\lambda}. \end{align*} $$ The general solution is $$ \begin{align*} y = e^x\left(A e^{x\sqrt{1-\lambda}} + Be^{-x\sqrt{1-\lambda}}\right). \end{align*} $$

Applying the boundary conditions, $$ \begin{align*} 0 &= y(0) = A + B \implies y = Ae^x \sinh(x\sqrt{1-\lambda}) \end{align*} $$ and $$ \begin{align*} 0 &= y'(1) = Ae\left(\sqrt{1-\lambda}\cosh \sqrt{1-\lambda} + \sinh \sqrt{1-\lambda}\right). \tag{*} \end{align*} $$ To have non-trivial solutions ($y\not\equiv 0$), take $A\neq 0$. If $\lambda = 1$, then $y=e^x(A+B) = 0$ which is trivial. If $\lambda<1$, (*) implies $A = 0$ which gives a trivial solution. Therefore we take $\lambda>1$ and let $$ \begin{align*} \lambda = 1 + \mu^2, \quad \mu>0. \end{align*} $$

Substituting into $(*)$ $$ \begin{align*} 0 = \mu \cos \mu + \sin\mu \iff \tan \mu = -\mu. \end{align*} $$

Graphically, we see that as $n\to \infty$, we have $\mu_n \sim (n-\frac{1}{2})\pi$. The eigenfunctions and eigenvalues are $$ \begin{align*} y_n(x) = e^x \sin(\mu_n x), \quad \lambda_n = 1+\mu_n^2, \quad n=1,2,3,\ldots. \end{align*} $$

We expect the eigenfunctions to be orthogonal. Let's see... for $n\neq m$, $$ \begin{align*} &\langle y_n, y_m\rangle_w \\ ={}& \int_{0}^{1} e^x \sin(\mu_n x) e^x \sin(\mu_m x) \underbrace{e^{-2x}}_{w(x)} \d x \\ ={}& \frac{1}{2}\int_{0}^{1} \cos (\mu_n - \mu_m)x -\cos(\mu_n + \mu_m)x \d x \\ ={}& \frac{1}{2} \left(\frac{\sin(\mu_n - \mu_m)}{\mu_n - \mu_m} - \frac{\sin(\mu_n + \mu_m)}{\mu_n + \mu_m}\right) \\ ={}& \frac{1}{2(\mu_n - \mu_m)(\mu_n + \mu_m)} \Big((\mu_n +\mu_m)(\sin\mu_n \cos \mu_m - \cos \mu_n \sin\mu_m) \\ &- (\mu_n - \mu_m)(\sin \mu_n \cos \mu_m + \cos\mu_n \sin \mu_m)\Big) \\ ={}& \frac{1}{\mu_n^2 - \mu_m^2} \Big(-\mu_n \cos \mu_n \sin \mu_m + \mu_m \sin \mu_n \cos \mu_m\Big) \\ ={}& \frac{1}{(\mu_n^2 - \mu_m^2)\sin\mu_n \sin \mu_m}\left(\underbrace{-\frac{\mu_n}{\tan\mu_n}}_{1} + \underbrace{\frac{\mu_m}{\tan \mu_m}}_{-1}\right) \\ ={}& 0. \end{align*} $$