## Legendre Differential Equation(#3): A friendly introduction

This post is just a note on the notation that is used across internet sources and books while referring to the LDE.

$(1-x^2)y^{''} - 2xy^{'} + l(l+1) y = 0$

If one takes $p(x) = 1-x^2$, then it follows that $p^{'}(x) = -2x$. The differential equation can be rewritten as follows:

$p(x)y^{''} + p^{'}(x)y^{'} + l(l+1) y = 0$

Now the first two terms must seem familiar to you from the chain rule. ( $(py)^{'} = py^{'} + yp^{'}$ ). Ergo,

$(py^{'})^{'} + l(l+1)y = 0$

or

$\frac{d}{dx}(p \frac{dy}{dx}) + l(l+1)y = 0$

Now, putting back the value of p :

$\frac{d}{dx}\left((1-x^2) \frac{dy}{dx} \right) + l(l+1)y = 0$

And you will see this form of the LDE also in many places and I thought it was worth mentioning how one ended up in that form.

## Legendre Differential Equation(#2): A friendly introduction

Now there is something about the Legendre differential equation that drove me crazy. What is up with the l(l+1) !!!

$(1-x^2)y^{''} -2xy^{'} + l(l+1)y = 0$

To understand why let’s take this form of the LDE and arrive at the above:

$(1-x^2)y^{''} -2xy^{'} + \lambda y = 0$

$y = \sum\limits_{n=0}^{\infty} a_n x^n$

If we do a power series expansion and following the same steps as the previous post, we end up with the following recursion relation.

$(n+2)(n+1)a_{n+2} = (\lambda -n(n+1))a_n$

or

$a_{n+2} = a_n \frac{\lambda - n(n+1)}{(n+1)(n+2)}$

Here’s the deal: We want a convergent solution for our differential solution. This means that as $n \rightarrow l , a_{n+2} \rightarrow 0$.

Hence we obtain that

$\lambda = l(l+1)$

## Inverse of an Infinite matrix

$\begin{bmatrix} 0 & 1 & 0 & 0 & 0 & 0 & \hdots \\ 0 & 0 & 2 & 0 & 0 & 0 & \hdots \\ 0 & 0 & 0 & 3 & 0 & 0 & \hdots \\ 0 & 0 & 0 & 0 & 4 & 0 & \hdots \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \end{bmatrix}$

What is the inverse of the above matrix ? I would strongly suggest that you think about the above matrix and what its inverse would look like before you read through.

On the face of it, it is indeed startling to even think of an inverse of an infinite dimensional matrix. But the only reason why this matrix seems weird is because I have presented it out of context.

You see, the popular name of the matrix is the Differentiation Matrix and is commonly denoted as $D$.

The differentiation matrix is a beautiful matrix and we will discuss all about it in some other post, but in the this post lets talk about its inverse. The inverse of the differentiation matrix is ( as you might have guessed ) is the Integration Matrix ($I^*$)

$I^* = \begin{bmatrix} 0 & 0 & 0 & 0 & 0 & 0 & \hdots \\ 1 & 0 & 0 & 0 & 0 & 0 & \hdots \\ 0 & \frac{1}{2} & 0 & 0 & 0 & 0 & \hdots \\ 0 & 0 & \frac{1}{3} & 0 & 0 & 0 & \hdots \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \end{bmatrix}$

And it can be easily verified that $DI^* = I$, where $I$ is the Identity matrix.

Lesson learned: Infinite dimensional matrices can have inverses. ðŸ˜€

## Legendre Differential equation (#1) : A friendly introduction

In this series of posts about Legendre differential equation, I would like to de-construct the differential equation down to the very bones. The motivation for this series is to put all that I know about the LDE in one place and also maybe help someone as a result.

The Legendre differential equation is the following:

$(1-x^2)y^{''} -2xy^{'} + l(l+1)y = 0$

where $y^{'} = \frac{dy}{dx}$ and $y^{''} = \frac{d^{2}y}{dx}$

We will find solutions for this differential equation using the power series expansion i.e
$y = \sum\limits_{n=0}^{\infty} a_n x^n$

$y^{'} = \sum\limits_{n=0}^{\infty} na_n x^{n-1}$

$y^{''} = \sum\limits_{n=0}^{\infty} n(n-1)a_n x^{n-2}$

We will plug in these expressions for the derivatives into the differential equation.

$l(l+1)y = l(l+1)\sum\limits_{n=0}^{\infty} a_n x^n$ – (i)

$-2xy^{'} = -2\sum\limits_{n=0}^{\infty} na_n x^{n}$ – (ii)

$(1-x^2)y^{''} = (1-x^2)\sum\limits_{n=0}^{\infty} n(n-1)a_n x^{n-2}$

$= \sum\limits_{n=0}^{\infty} n(n-1)a_n x^{n-2} - \sum\limits_{n=0}^{\infty} n(n-1)a_n x^{n}$ – (iii)

** Note: Begin

$\sum\limits_{n=0}^{\infty} n(n-1)a_n x^{n-2}$

Let’s take $\lambda = n-2$.
As n -> $0$. , $\lambda$ -> $-2$.
As n -> $\infty$, $\lambda$ -> $\infty$.

$\sum\limits_{\lambda = -2}^{\infty} (\lambda+2)(\lambda+1)a_n x^{\lambda}$

$= 0 + 0 + \sum\limits_{\lambda = 0}^{\infty} (\lambda+2)(\lambda+1)a_n x^{\lambda}$

Again performing a change of variables from $\lambda$ to n.

$= \sum\limits_{n= 0}^{\infty} (n+2)(n+1)a_n x^{n}$

** Note: End

(iii) can now be written as follows.

$\sum\limits_{n=0}^{\infty} x^n \left((n+1)(n+2)a_{n+2} - n(n-1)a_n \right)$ – (iv)

(i)+(ii)+(iv).

$\sum\limits_{n=0}^{\infty} x^n \left((n+2)(n+1)a_{n+2} - (l(l+1)-n(n+1))a_n \right)$

x = 0 is a trivial solution and therefore we get the indicial equation:

$(n+2)(n+1)a_{n+2} - (l(l+1)-n(n+1))a_n = 0$

$(n+2)(n+1)a_{n+2} = (l^2 - n^2 + l - n)a_n = 0$

$(n+2)(n+1)a_{n+2} = ((l-n)(l+n)+ l - n)a_n = 0$

$(n+2)(n+1)a_{n+2} = (l-n)(l+n+1)a_n = 0$

We get the following recursion relation on the coefficients of the power series expansion.

$a_{n+2} = a_n \frac{(l+n+1)(l-n)}{(n+1)(n+2)}$

Next post: What do these coefficients mean ?

## On the beauty of Parametric Integration and the Gamma function

Parametric integration is one such technique that once you are made aware of it, you will never for the love of god forget it. Let me demonstrate :

Now this integral might seem familiar to many of you and to evaluate it is rather simple as well.

$\int\limits_0^{\infty} e^{-sx} dx = \frac{1}{s}$

Knowing this you can do lots of crazy stuff. Lets differentiate this expression wrt to the parameter in the integral – s (Hence the name parametric integration ). i.e

$\frac{d}{ds}\int\limits_0^{\infty} e^{-sx} dx = \frac{d}{ds}\left(\frac{1}{s}\right)$

$\int\limits_0^{\infty} x e^{-sx} dx = \frac{1}{s^2}$

Look at that, by simple differentiation we have obtained the expression for another integral. How cool is that! It gets even better.
Lets differentiate it once more:

$\int\limits_0^{\infty} x^2 e^{-sx} dx = \frac{2*1}{s^3}$

$\int\limits_0^{\infty} x^3 e^{-sx} dx = \frac{3*2*1}{s^4}$

$\vdots$

If you keep on differentiating the expression n times, one gets this :

$\int\limits_0^{\infty} x^n e^{-sx} dx = \frac{n!}{s^{n+1}}$

Now substituting the value of s to be 1, we obtain the following integral expression for the factorial. This is known as the gamma function.

$\int\limits_0^{\infty} x^n e^{-x} dx = n! = \Gamma(n+1)$

There are lots of ways to derive the above expression for the gamma function, but parametric integration is in my opinion the most subtle way to arrive at it. ðŸ˜€

## Beautiful proofs (#1) : Divergence of the harmonic series

The harmonic series are as follows:

$\sum\limits_{n=1}^{\infty} \frac{1}{n} = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} + \hdots$

And it has been known since as early as 1350 that this series diverges. Oresme’s proof to it is just so beautiful.

$S_1 = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} + \hdots$

$S_1 = 1 + \left(\frac{1}{2}\right) + \left(\frac{1}{3} + \frac{1}{4}\right) + \left(\frac{1}{5} + \frac{1}{6} + \frac{1}{7} + \frac{1}{8} \right) \hdots$

Now replace ever term in the bracket with the lowest term that is present in it. This will give a lower bound on $S_1$.

$S_1 > 1 + \left(\frac{1}{2}\right) + \left(\frac{1}{4} + \frac{1}{4}\right) + \left(\frac{1}{8} + \frac{1}{8} + \frac{1}{8} + \frac{1}{8} \right) \hdots$

$S_1 > 1 + \left(\frac{1}{2}\right) + \left(\frac{1}{2}\right) + \left(\frac{1}{2}\right) + \left(\frac{1}{2}\right) + \hdots$

Clearly the lower bound of $S_1$ diverges and therefore $S_1$ also diverges. ðŸ˜€
But it interesting to note that of divergence is incredibly small: 10 billion terms in the series only adds up to around 23.6 !

## Euler-Cauchy equation

While trying to solve for the Laplacian in polar coordinates, one encounters the famous Euler-Cauchy differential equation.

$x^{2}{\fracÂ {d^{2}y}{dx^{2}}}+2x{\fracÂ {dy}{dx}}-l(l+1)y=0$

or

${\frac {d^{2}y}{dx^{2}}}+ \frac{2}{x}{\frac {dy}{dx}}- \frac{l(l+1)}{x^2}y=0$

How does one find a solution to this differential equation ? Well, most places that I have read simply dictate that the solutions to this differential equation as $y = x^l, x^{-(l+1)}$ without explaining why only these two are the only solutions. The purpose of this post is to explain why!

We can clearly see that x = 0 is a singular point. Therefore a simple power series solution won’t work. Hence we use the frobenius method to get rid of the singularity i.e

$y= \sum\limits_{n=0}^{\infty} a_{n}x^{n + \lambda}$

Let’s now compute its derivatives wrt x.

$\frac{dy}{dx}= \sum\limits_{n=0}^{\infty} (n+\lambda)a_{n}x^{n +\lambda -1}$

$\frac{d^{2}y}{dx^{2}}= \sum\limits_{n=0}^{\infty} (n + \lambda)(n + \lambda -1)a_{n}x^{n + \lambda -2}$

Putting the values for $y,\frac{dy}{dx}$ and $\frac{d^{2}y}{dx^{2}}$ back into the differential equation, we get the following form.

$x^{2}{\sum\limits_{n=0}^{\infty} (n + \lambda)(n + \lambda -1)a_{n}x^{n-2}}$

$+2x{\sum\limits_{n=0}^{\infty}(n+\lambda)a_{n}x^{n-1}}$

$- l(l+1){\sum\limits_{n=0}^{\infty} a_{n}x^{n}}=0$

Bringing the $x,x^{2}$ terms inside the summation, we obtain the following form:

$\sum\limits_{n=0}^{\infty}x^n \left({(n+\lambda)(n+\lambda -1)a_n + 2(n+\lambda)a_n -l(l+1)a_n}\right)=0$

$\sum\limits_{n=0}^{\infty}a_n x^n \left({(n+\lambda)(n+\lambda +1) -l(l+1)}\right) = 0$

Obviously, the coefficients of the summation cannot be zero and x=0 is a trivial solution. Therefore, we get the indicial equation.

$(n+\lambda)(n+\lambda+1) - l(l+1)= 0$ or

$(n+\lambda)(n+\lambda+1) = l(l+1)$

(i) When n = 0, the indicial equation becomes

$\lambda(\lambda+1) = l(l+1)$

The values of the $\lambda$ that solve for this equation are $l,-(l+1)$

$\lambda = l , -(l+1)$

(ii) When n = 1, the indicial equation becomes

$(\lambda + 1)(\lambda+2) = l(l+1)$

The values of the $\lambda$ that solve for this equation are $(l-1),-(l+2)$

$\lambda = (l-1) , -(l+2)$

$\vdots$

And in general:

$\lambda_n = (l-n), -(l+n+1)$

$\lambda_{n_1} = (l-n)$, $\lambda_{n_2} = -(l+n+1)$

Here is the crux of it all.
Lets now write down the solution for this differential equation in its glory:

$y= \sum\limits_{n=0}^{\infty} \left(a_{n}x^{n + \lambda_{n_1}} + b_n x^{n+ \lambda_{n_{2}}}\right)$

$y= \sum\limits_{n=0}^{\infty} \left(a_{n}x^{n + (l-n)} + b_n x^{n-(l+n+1)}\right)$

$y= \sum\limits_{n=0}^{\infty} \left(a_{n}x^{l} + b_n x^{-(l+1)}\right)$

$y = \left(a_0 + a_1 + a_2 + \hdots \right) x^{l} + \left(b_0 + b_1 + b_2 + \hdots \right) x^{-(l+1)}$

$y = A x^{l} + B x^{-(l+1)}$

where A and B are constants.

This is the general solution to the Euler-Cauchy differential equation. ðŸ˜€