A strange operator

In a previous post on using the Feynman’s trick for Discrete calculus, I used a very strange operator ( \triangledown ). And whose function is the following :

\triangledown n^{\underline{k}} = \frac{n^{\underline{k+1}}}{k+1}

What is this operator? Well, to be quite frank I am not sure of the name, but I used it as an analogy to Integration. i.e

\int x^{n} = \frac{x^{n+1}}{n+1} + C

What are the properties of this operator ? Let’s use the known fact that n^{\underline{k+1}} = (n-k) n^{\underline{k}}

\triangledown n^{\underline{k}} = \frac{n^{\underline{k+1}}}{k+1}

\triangledown n^{\underline{k}} = \frac{(n-k) n^{\underline{k}}}{k+1}

And applying the operator twice yields:

\triangledown^2 n^{\underline{k}} = \frac{n^{\underline{k+2}}}{(k+1)(k+2)}

\triangledown^2 n^{\underline{k}} = \frac{(n-k-1) n^{\underline{k+1}}}{(k+1)(k+2)}

\triangledown^2 n^{\underline{k}} = \frac{(n-k-1)(n-k) n^{\underline{k}}}{(k+1)(k+2)}

We can clearly see a pattern emerging from this already, applying the operator once more :

\triangledown^3 n^{\underline{k}} = \frac{(n-k-2)(n-k-1)(n-k) n^{\underline{k}}}{(k+1)(k+2)(k+3)}


Or in general, the operator that has the characteristic prescribed in the previous post is the following:

\triangledown^m n^{\underline{k}} = \frac{n^{\underline{k+m}}}{(k+m)^{\underline{m}}} n^{\underline{k}}

If you guys are aware of the name of this operator, do ping me !

The generalized product rule ( Leibniz Formula )

If f and g are n-times differentiable functions, then :

(fg)^{'} = fg^{'} + gf^{'}

Now, we would like to find out a generalized expression for the n-th derivative of fg. In order to arrive at that formulation lets calculate a few derivatives to see whether we can find a pattern:

(fg)^{'} = fg^{'} + gf^{'}

(fg)^{''} = \left(fg^{'} + gf^{'}\right)^{'} = fg^{''} + 2 f^{'}g^{'} + gf^{''}

(fg)^{'''} = \left(fg^{''} + 2 f^{'}g^{'} + gf^{''} \right)^{'} = fg^{'''} + 3 f^{''}g^{'} + 3 f^{'}g^{''} + gf^{'''}

(fg)^{''''} = fg^{''''} + 4 f^{'''}g^{'} + 6f^{''}g^{''} + 4 f^{'}g^{'''} + gf^{''''}


You must have noticed a pattern in the above expressions. The coefficients seem are the one in the binomial expansion of (x+y)^n


Therefore we can write the expression for the n-derivative of fg as the following expression:

(fg)^n = \sum\limits_{i=0}^{n} \binom{n}{i} f^{(i)}g^{(n-i)}
where (i) means to differentiate i-times.

This is also known as Leibniz Formula.

** This plays an important role when we start discussing about the Associated Legendre Differential Equation.

Legendre Differential Equation(#4) : A friendly introduction

When you are working with Spherical harmonics, then the Legendre Differential Equation does not appear in its natural form i.e

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

Instead, it appears in this form:

\frac{d^2 y}{d\theta^2} + \frac{cos\theta}{sin\theta} \frac{dy}{d\theta} + l(l+1)y = 0

It seems daunting but the above is the same as the LDE. We can arrive at it by taking x = cos(\theta) and proceeding as follows:

\frac{dy}{dx} = \frac{dy}{d(cos\theta)} = \frac{-1}{sin\theta}\frac{dy}{d \theta}

\frac{d^2 y}{dx^2} = \frac{d}{d(cos\theta)}\left( \frac{-1}{sin\theta}\frac{dy}{d \theta} \right) = \frac{-1}{sin\theta}\frac{d}{d \theta}\left( \frac{-1}{sin\theta}\frac{dy}{d \theta} \right)

Now, applying chain rule, we obtain that

\frac{d^2 y}{dx^2} = \frac{-1}{sin\theta} \left( \frac{-1}{sin\theta} \frac{d^2 y}{d\theta^2} - \frac{cos\theta}{sin^2 \theta} \frac{dy}{d\theta}      \right)

Now simplifying the above expression, we obtain that:

\frac{d^2 y}{dx^2} = \frac{1}{sin^2\theta} \left( \frac{d^2 y}{d\theta^2} + \frac{cos\theta}{sin\theta} \frac{dy}{d\theta} \right)

Plugging in the values of \frac{dy}{dx} and \frac{d^2 y}{dx^2}  into the Legendre Differential Equation,

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

(1-cos^2 \theta)y^{''} -2cos\theta y^{'} + l(l+1)y = 0

\frac{1- cos^2 \theta}{sin^2 \theta} \left( \frac{d^2 y}{d\theta^2} + \frac{cos\theta}{sin\theta}\frac{dy}{d\theta} \right) +\frac{2cos\theta}{sin\theta} \frac{dy}{d\theta} + l(l+1)y = 0

Now if we do some algebra and simplify the trigonometric identities, we will arrive at the following expression for the Legendre Differential Equation:

\frac{d^2 y}{d\theta^2} + \frac{cos\theta}{sin\theta} \frac{dy}{d\theta} + l(l+1)y = 0

If we take the solution for the LDE as f(x) , then the solution to the LDE in the above form is merely f(cos\theta) .

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


\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.

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)


\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}


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. 😀

Taylor Series : an infinite sum giving the value of a function f(x) in the neighbourhood of a point a in terms of the derivatives of the function evaluated at a.

Not all functions can be expressed as a taylor series expansion. The function must be infinitely differentiable at the point of consideration.

The ideal example would be the exponential function. How many ever times you differentiate it, you get the same function back.


The following is the exponential function ex (in blue), and the sum of the first n+1 terms of its Taylor series at 0 (in red).

Notice how the red closely resembles the exponential function as more terms are added.


A similar could be done for the sine,cosine,arcsine,logarithmic, etc.

The tale of how the coefficients came to be in the taylor series expansion was the topic of discussion of today, hope you guys enjoyed it.

Have a great day!