# 11.1: Modelling the Eye

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

# Separation of variables in three dimensions

We have up to now concentrated on 2D problems, but a lot of physics is three dimensional, and often we have spherical symmetry – that means symmetry for rotation over any angle. In these cases we use spherical coordinates, as indicated in figure [fig:spherical].

## Modelling the eye

*The temperature on the outside of a simple model of the eye*

Let me model the temperature in a simple model of the eye, where the eye is a sphere, and the eyelids are circular. In that case we can put the \(z\)-axis straight through the middle of the eye, and we can assume that the temperature does only depend on \(r,\theta\) and *not* on \(\phi\). We assume that the part of the eye in contact with air is at a temperature of \(20^{\circ}\) C, and the part in contact with the body is at \(36^{\circ}\) C. If we look for the steady state temperature it is described by Laplace’s equation,

\[{ \nabla}^{2} u(r,\theta) =0.\]

Expressing the Laplacian \({ \nabla}^{2}\) in spherical coordinates (see chapter [chap:curvilinear]) we find

\[\frac{1}{r^{2}}\dfrac{\partial}{\partial r}{~}\left(r^{2}\dfrac{\partial}{\partial r} u \right) +\frac{1}{r^{2}\sin\theta} \dfrac{\partial}{\partial \theta}{~}\left(\sin\theta\dfrac{\partial}{\partial \theta} u\right) =0.\]

Once again we solve the equation by separation of variables,

\[u(r,\theta) = R(r) T (\theta).\]

After this substitution we realize that

\[\frac{[r^{2} R']'}{R} = -\frac{[\sin\theta T']'}{T\sin\theta} = \lambda.\]

The equation for \(R\) will be shown to be easy to solve (later). The one for \(T\) is of much more interest. Since for 3D problems the angular dependence is more complicated, whereas in 2D the angular functions were just sines and cosines.

The equation for \(T\) is

\[[\sin\theta T']'+\lambda T\sin\theta=0.\]

This equation is called Legendre’s equation, or actually it carries that name after changing variables to \(x= \cos\theta\). Since \(\theta\) runs from \(0\) to \(\pi\), we find \(\sin \theta >0\), and we have

\[\sin\theta = \sqrt{1-x^{2}}.\]

After this substitution we are making the change of variables we find the equation (\(y(x)=T(\theta)=T(\arccos x)\), and we now differentiate w.r.t. \(x\), \(d/d\theta = - \sqrt{1-x^{2}}d/dx\))

\[\frac{d}{dx}\left[(1-x^{2})\frac{dy}{dx}\right] + \lambda y = 0.\]

This equation is easily seen to be self-adjoint. It is not very hard to show that \(x=0\) is a regular (not singular) point – but the equation is singular at \(x=\pm 1\). Near \(x=0\) we can solve it by straightforward substitution of a Taylor series,

\[y(x) = \sum_{j=0} a_{j} x^{j}.\]

We find the equation

\[\sum_{j=0}^{\infty}j(j-1) a_{j} x^{j-2} -\sum_{j=0}^{\infty}j(j-1) a_{j} x^{j} -2\sum_{j=0}^{\infty}j a_{j} x^{j} + \lambda \sum_{j=0}^{\infty} a_{j} x^{j} = 0\]

After introducing the new variable \(i=j-2\), we have

\[\sum_{j=0}^{\infty}(i+1)(i+1) a_{i+2} x^{i} -\sum_{j=0}^{\infty}[j(j+1)-\lambda] a_{j} x^{j}=0.\]

Collecting the terms of the order \(x^{k}\), we find the recurrence relation \[a_{k+2} = \frac{k(k+1)-\lambda}{(k+1)(k+2)} a_{k}.\]

If \(\lambda=n(n+1)\) this series terminates – actually those are the only acceptable solutions, any one where \(\lambda\) takes a different value actually diverges at \(x=+1\) or \(x=-1\), not acceptable for a physical quantity – it can’t just diverge at the north or south pole (\(x=\cos\theta=\pm 1\) are the north and south pole of a sphere).

We thus have, for \(n\) even,

\[y_{n} = a_{0}+a_{2}x^{2}+\ldots+a_{n}x^{n}.\]

For odd \(n\) we find odd polynomials,

\[y_{n} = a_{1}x+a_{3}x^{3}+\ldots+a_{n}x^{n}.\]

One conventionally defines \[a_{n} = \frac{(2n)!}{n!^{2} 2^{n}}.\]

With this definition we obtain

\[\begin{array}{lllllll} P_{0}& =& 1, &~~~&P_{1} & =& x,\\ P_{2}&=& \frac{3}{2}x^{2}-\frac{1}{2},&&P_{3}&=&\dfrac{1}{2}(5x^3-3x),\\ P_4 &=& \frac{1}{8}(35x^{4}-30x^{2}+3) ,&& P_5 &=& \frac{1}{8}(63x^{5}-70x^{3}+15x) . \end{array}\]

A graph of these polynomials can be found in figure [fig:Pn].

*The first few Legendre polynomials \(P_n(x)\).*

## Properties of Legendre polynomials

### Generating function

Let \(F(x,t)\) be a function of the two variables \(x\) and \(t\) that can be expressed as a Taylor’s series in \(t\), \(\sum_{n} c_n(x) t^{n}\). The function \(F\) is then called a generating function of the functions \(c_{n}\).

Exercise \(\PageIndex{1}\)

Show that \(F(x,t) = \frac{1}{1-xt}\) is a generating function of the polynomials \(x^{n}\).

**Answer**-
Look at

\[\frac{1}{1-xt} = \sum_{n=0}^{\infty} x^{n}t^{n}\;\;(|xt|<1).\]

Exercise \(\PageIndex{2}\)

Show that \(F(x,t) = \exp\left(\frac{tx-t}{2t}\right)\) is the generating function for the Bessel functions,

\[F(x,t) = \exp(\frac{tx-t}{2t}) = \sum_{n=0}^{\infty} J_{n}(x)t^{n}.\]

**Answer**-
TBA

Exercise \(\PageIndex{4}\)

(The case of most interest here) \[F(x,t) =\frac{1}{\sqrt{1-2xt+t^{2}}} = \sum_{n=0}^{\infty} P_{n}(x) t^{n}.\]

**Answer**-
TBA

### Rodrigues’ Formula

\[P_{n}(x) = \frac{1}{2^{n} n!} \frac{d^{n}}{dx^{n}} (x^2-1)^n.\]

### A table of properties

- \(P_{n}(x)\) is even or odd if \(n\) is even or odd.
- \(P_{n}(1)=1\).
- \(P_{n}(-1)=(-1)^{n}\).
- \((2n+1) P_{n}(x) = P'_{n+1}(x)-P'_{n-1}(x)\).
- \((2n+1)x P_n(x) = (n+1) P_{n+1}(x) + n P_{n-1}(x)\).
- \(\int_{-1}^{x} P_n(x') dx'= \frac{1}{2n+1} \left[P_{n+1}(x)-P_{n-1}(x)\right]\).

Let us prove some of these relations, first Rodrigues’ formula. We start from the simple formula

\[(x^{2}-1) \frac{d}{dx} (x^{2}-1)^{n} - 2 n x (x^{2}-1)^{n}=0,\] which is easily proven by explicit differentiation. This is then differentiated \(n+1\) times,

\[\begin{aligned} { \frac{d^{n+1}}{dx^{n+1}}\left[ (x^{2}-1) \frac{d}{dx} (x^{2}-1)^{n} - 2 n x (x^{2}-1)^{n}\right]} \nonumber\\ &=& n(n+1) \frac{d^{n}}{dx^{n}}(x^2-1)^n + 2(n+1) x \frac{d^{n+1}}{dx^{n+1}} (x^2-1)^n+(x^2-1) \frac{d^{n+2}}{dx^{n+2}} (x^2-1)^n \nonumber\\ &&-2n(n+1) \frac{d^{n}}{dx^{n}}(x^2-1)^n - 2n x \frac{d^{n+1}}{dx^{n+1}} (x^2-1)^n \nonumber\\ &=&-n(n+1) \frac{d^{n}}{dx^{n}}(x^2-1)^n + 2 x \frac{d^{n+1}}{dx^{n+1}} (x^2-1)^n+(x^2-1) \frac{d^{n+2}}{dx^{n+2}} (x^2-1)^n \nonumber\\ &=& -\left[\frac{d}{dx}(1-x^2)\frac{d}{dx}\left\{\frac{d^{n}}{dx^{n}}(x^2-1)^n \right\} +n(n+1)\left\{\frac{d^{n}}{dx^{n}}(x^2-1)^n\right\}\right] =0.\end{aligned}\]

We have thus proven that \(\frac{d^n}{dx^n}(x^2-1)^n\) satisfies Legendre’s equation. The normalization follows from the evaluation of the highest coefficient, \[\frac{d^n}{dx^n} x^{2n} = \frac{2n!}{n!} x^n,\] and thus we need to multiply the derivative with \(\frac{1}{2^n n!}\) to get the properly normalized \(P_n\).

Let’s use the generating function to prove some of the other properties: 2.: \[F(1,t) = \frac{1}{1-t} = \sum_n t^n\] has all coefficients one, so \(P_n(1)=1\). Similarly for 3.: \[F(-1,t) = \frac{1}{1+t} = \sum_n (-1)^nt^n .\] Property 5. can be found by differentiating the generating function with respect to \(t\):

\[\begin{aligned} \frac{d}{dt} \frac{1}{\sqrt{1-2tx +t^2}} &=& \frac{d}{dt} \sum_{n=0}^{\infty} t^n P_n(x)\nonumber\\ \frac{x-t}{(1-2tx+t^{2})^1.5} &=& \sum_{n=0} n t^{n-1} P_{n}(x)\nonumber\\ \frac{x-t}{1-2xt +t^{2}} \sum_{n=0}^{\infty} t^n P_n(x)&=& \sum_{n=0} n t^{n-1} P_{n}(x)\nonumber\\ \sum_{n=0}^{\infty} t^n x P_n(x)- \sum_{n=0}^{\infty} t^{n+1} P_n(x) &=& \sum_{n=0}^{\infty} nt^{n-1} P_n(x) - 2\sum_{n=0}^{\infty} nt^n xP_n(x) +\sum_{n=0}^{\infty} nt^{n+1} P_n(x)\nonumber\\ \sum_{n=0}^{\infty} t^n(2n+1)x P_n(x) &=& \sum_{n=0}^{\infty} (n+1)t^n P_{n+1}(x) + \sum_{n=0}^{\infty} n t^{n} P_{n-1}(x)\end{aligned}\]

Equating terms with identical powers of \(t\) we find \[(2n+1)x P_n(x) = (n+1) P_{n+1}(x) + n P_{n-1}(x).\]

Proofs for the other properties can be found using similar methods.

## Fourier-Legendre series

Since Legendre’s equation is self-adjoint, we can show that \(P_n(x)\) forms an orthogonal set of functions. To decompose functions as series in Legendre polynomials we shall need the integrals

\[\int_{-1}^1 P_n^2(x) dx = \frac{2n+1}{2},\]

which can be determined using the relation 5. twice to obtain a recurrence relation

\[\begin{aligned} \int_{-1}^1 P_n^2(x) dx &=& \int_{-1}^1 P_n(x) \frac{(2n-1)x P_{n-1}(x)-(n-1)P_{n-2}(x)}{n} dx \nonumber\\ &=&\frac{(2n-1)}{n}\int_{-1}^1 x P_n(x) P_{n-1}(x) dx \nonumber\\ &=&\frac{(2n-1)}{n}\int_{-1}^1 \frac{(n+1)P_{n+1}(x) + n P_{n-1}(x)}{2n+1} P_{n-1}(x) dx \nonumber\\ &=&\frac{(2n-1)}{2n+1}\int_{-1}^1 P_{n-1}^2(x) dx,\end{aligned}\]

and the use of a very simple integral to fix this number for \(n=0\),

\[\int_{-1}^1 P_0^2(x) dx = 2.\]

So we can now develop any function on \([-1,1]\) in a Fourier-Legendre series

\[\begin{aligned} f(x) & = & \sum_n A_n P_n(x) \nonumber\\ A_n & = & \frac{2n+1}{2} \int_{-1}^1 f(x) P_n(x) dx\end{aligned}\]

Find the Fourier-Legendre series for

\[f(x) = \left\{ \begin{array}{ll} 0, & -1 < x < 0\\ 1, & 0 < x <1 \end{array} \right. .\]

We find \[\begin{aligned} A_0 &=& \dfrac{1}{2} \int_0^1 P_0(x) dx = \dfrac{1}{2},\\ A_1 &=& \frac{3}{2} \int_0^1 P_1(x) dx= \frac{1}{4}, \\ A_2 &=& \frac{5}{2} \int_0^1 P_2(x) dx= 0, \\ A_3 &=& \frac{7}{2} \int_0^1 P_3(x) dx= -\frac{7}{16} .\end{aligned}\]

All other coefficients for even \(n\) are zero, for odd \(n\) they can be evaluated explicitly.

## Modelling the eye–revisited

Let me return to my model of the eye. With the functions \(P_n(\cos\theta)\) as the solution to the angular equation, we find that the solutions to the radial equation are

\[R=Ar^n + Br^{-n-1}.\]

The singular part is not acceptable, so once again we find that the solution takes the form

\[u(r,\theta) = \sum_{n=0}^\infty A_n r^n P_n(\cos\theta)\] We now need to impose the boundary condition that the temperature is \(20^\circ\) C in an opening angle of \(45^\circ\), and \(36^\circ\) elsewhere. This leads to the equation

\[\begin{aligned} \sum_{n=0}^\infty A_n c^n P_n(\cos\theta) = \left\{ \begin{array}{ll} 20 & 0<\theta<\pi/4\\ 36 & \pi/4 < \theta < \pi \end{array}\right.\end{aligned}\] This leads to the integral, after once again changing to \(x=\cos\theta\),

\[A_n = \frac{2n+1}{2} \left[\int_{-1}^1 36 P_n(x) dx -\int_{\frac{1}{2}\sqrt{2}}^1 16 P_n(x) dx\right].\] These integrals can easily be evaluated, and a sketch for the temperature can be found in figure [fig:eyeT].

A cross-section of the temperature in the eye. We have summed over the first 40 Legendre polynomials.

Notice that we need to integrate over \(x=\cos\theta\) to obtain the coefficients \(A_n\). The integration over \(\theta\) in spherical coordinates is \(\int_0^\pi \sin \theta d\theta = \int_{-1}^1 1 dx\), and so automatically implies that \(\cos\theta\) is the right variable to use, as also follows from the orthogonality of \(P_n(x)\).