## Beautiful Proofs(#3): Area under a sine curve !

So, I read this post on the the area of the sine curve some time ago and in the bottom was this equally amazing comment :

$\sum sin(\theta)d\theta =$  Diameter of the circle/ The distance covered along the x axis starting from $0$ and ending up at $\pi$.

And therefore by the same logic, it is extremely intuitive to see why:

$\int\limits_{0}^{2\pi} sin/cos(x) dx = 0$

Because if a dude starts at $0$ and ends at $0/ 2\pi/ 4\pi \hdots$, the effective distance that he covers is 0.

If you still have trouble understanding, follow the blue point in the above gif and hopefully things become clearer.

## Why is the area under one hump of a sine curve exactly 2?

I was talking with a student recently who told me that he always found the fact that $latex int_0^{pi} sin x , dx = 2$ amazing. “How is it that the area under one hump of the sine curve comes out exactly 2?” He asked me if there is an easy way to see that, or is it something you just have to discover by doing the computation.

View original post 162 more words

## Solving the Laplacian in Spherical Coordinates (#1)

In this post, let’s derive a general solution for the Laplacian in Spherical Coordinates. In future posts, we shall look at the application of this equation in the context of Fluids and Quantum Mechanics.

$x = rsin\theta cos\phi$
$y = rsin\theta cos\phi$
$z = rcos\theta$

where

$0 \leq r < \infty$
$0 \leq \theta \leq \pi$
$0 \leq \phi < 2\pi$

The Laplacian in Spherical coordinates in its ultimate glory is written as follows:

$\nabla ^{2}f ={\frac {1}{r^{2}}}{\frac {\partial }{\partial r}}\left(r^{2}{\frac {\partial f}{\partial r}}\right)+{\frac {1}{r^{2}\sin \theta }}{\frac {\partial }{\partial \theta }}\left(\sin \theta {\frac {\partial f}{\partial \theta }}\right)+{\frac {1}{r^{2}\sin ^{2}\theta }}{\frac {\partial ^{2}f}{\partial \phi ^{2}}} = 0$

To solve it we use the method of separation of variables.

$f = R(r)\Theta(\theta)\Phi(\phi)$

Plugging in the value of $f$ into the Laplacian, we get that :

$\frac{\Theta \Phi}{r^2} \frac{d}{dr} \left( r^2\frac{dR}{dr} \right) + \frac{R \Phi}{r^2 sin \theta} \frac{d}{d \theta} \left( sin \theta \frac{d\Theta}{d\theta} \right) + \frac{\Theta R}{r^2 sin^2 \theta} \frac{d^2 \Phi}{d\phi^2} = 0$

Dividing throughout by $R\Theta\Phi$ and multiplying throughout by $r^2$, further simplifies into:

$\underbrace{ \frac{1}{R} \frac{d}{dr} \left( r^2\frac{dR}{dr} \right)}_{h(r)} + \underbrace{\frac{1}{\Theta sin \theta} \frac{d}{d \theta} \left( sin \theta \frac{d\Theta}{d\theta} \right) + \frac{1}{\Phi sin^2 \theta} \frac{d^2 \Phi}{d\phi^2}}_{g(\theta,\phi)} = 0$

It can be observed that the first expression in the differential equation is merely a function of $r$ and the remaining a function of $\theta$ and $\phi$ only. Therefore, we equate the first expression to be $\lambda = l(l+1)$ and the second to be $-\lambda = -l(l+1)$. The reason for choosing the peculiar value of $l(l+1)$ is explained in another post.

$\underbrace{ \frac{1}{R} \frac{d}{dr} \left( r^2\frac{dR}{dr} \right)}_{l(l+1)} + \underbrace{\frac{1}{\Theta sin \theta} \frac{d}{d \theta} \left( sin \theta \frac{d\Theta}{d\theta} \right) + \frac{1}{\Phi sin^2 \theta} \frac{d^2 \Phi}{d\phi^2}}_{-l(l+1)} = 0$ (1)

The first expression in (1) the Euler-Cauchy equation in $r$.

$\frac{d}{dr} \left( r^2\frac{dR}{dr} \right) = l(l+1)R$

The general solution of this has been in discussed in a previous post and it can be written as:

$R(r) = C_1 r^l + \frac{C_2}{r^{l+1}}$

The second expression in (1) takes the form as follows:

$\frac{sin \theta}{\Theta} \frac{d}{d \theta} \left( sin \theta \frac{d\Theta}{dr} \right)+ l(l+1)sin^2 \theta + \frac{1}{\Phi} \frac{d^2 \Phi}{d\phi^2} = 0$

The following observation can be made similar to the previous analysis

$\underbrace{\frac{sin \theta}{\Theta} \frac{d}{d \theta} \left( sin \theta \frac{d\Theta}{dr} \right)+ l(l+1)sin^2 \theta }_{m^2} + \underbrace{\frac{1}{\Phi} \frac{d^2 \Phi}{d\phi^2}}_{-m^2} = 0$ (2)

The first expression in the above equation (2) is the Associated Legendre Differential equation.

$\frac{sin \theta}{\Theta} \frac{d}{d \theta} \left( sin \theta \frac{d\Theta}{dr} \right)+ l(l+1)sin^2 \theta = m^2$

$sin \theta \frac{d}{d \theta} \left( sin \theta \frac{d\Theta}{dr} \right)+ \Theta \left( l(l+1)sin^2 \theta - m^2 \right) = 0$

The general solution to this differential equation can be given as:
$\Theta(\theta) = C_3 P_l^m(cos\theta) + C_4 Q_l^m(cos\theta)$

The solution to the second term in the equation (2) is a trivial one:

$\frac{d^2 \Phi}{d\phi^2} = m^2 \Phi$
$\Phi(\phi) = C_5 e^{im\phi} + C_6 e^{-im\phi}$

Therefore the general solution to the Laplacian in Spherical coordinates is given by:

$R\Theta\Phi = \left(C_1 r^l + \frac{C_2}{r^{l+1}} \right) \left(C_3 P_l^m(cos\theta) + C_4 Q_l^m(cos\theta \right) \left(C_5 e^{im\phi} + C_6 e^{-im\phi}\right)$

## On the origins of Taylor/Maclaurin Series

Many a times it is not discussed as to How the Taylor/Maclaurin series came to be in its current form. This short snippet is all about it.

Let us assume that some function $f(x)$ can be written as a power series expansion. i.e

$f(x) = a_0 + a_1 x + a_2 x^2 + \hdots$.

We are left with the task of finding out the coefficients of the power series expansion.

Substitution x = 0, we obtain the value of $a_0$.

$a_0 = f(0)$.

Lets differentiate $f(x)$ wrt x.

$\frac{d}{dx} f(x) = a_1 + 2a_2 x + \hdots$

Evaluating at x =0 , we get

$\frac{d}{dx} f(0) = a_1$

And likewise:

$\frac{d^2}{dx^2} f(0) = 2.1.a_2 = 2! \space a_2$

$\frac{d^3}{dx^3} f(0) = 3.2.1.a_3 = 3! \space a_3$

$\vdots$

$\frac{d^n}{dx^n} f(0) = n.n-1...3.2.1.a_n = n! a_n$

That’s it we have found all the coefficient values, the only thing left to do is to plug it back into the power series expression:

$f(x) = f(0) + \frac{d}{dx}f(0) \frac{x}{1!} + \frac{d^2}{dx^2}f(0) \frac{x^2}{2!} + \frac{d^3}{dx^3} f(0) \frac{x^3}{3!} \hdots$.

The above series expanded about the point x = 0 is called as the ‘Maclaurin Series’. The same underlying principle can be extended for expanding about any other point as well i.e ‘Taylor Series’.

## 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$

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)$