# Is there a relation between the Legendre generator function and Spherical Harmonics for a Potential?

Recently I had to solve a simple problem in which I had a sphere of radius $R$ with a constant potential (but with different sign), on both of the hemispheres, and I was asked to get the electrostatic potential for every point in the space. And I had to do it with both hemispheres along the $z$-axis, and then solve the same problem but with the hemispheres along the $y$-axis. So I solved both of the problems, first with the potential with Legendre generator function and azimuthal symmetry, and the second with the expression of the potential with spherical harmonics. But the last question was to find the matrix rotation in order to show that both solutions are the same?. And this is what I don't understand, is there a relation between the Legendre generator function and Spherical Harmonics for rotations?

First solution of the potential, taking the general solution with azimuthal symmetry: $$\phi (r,\theta)=\sum^{\infty}_{l=0}\left(A_{l}r^{l}+\dfrac{B_{l}}{r^{l+1}}\right)P_{l}(\cos\theta)$$ with boundary conditions: $$a)\phi(R,\theta)=\phi_{o};\text{ if }\theta \in [0,\pi /2) \\ \phi(R,\theta)=-\phi_{o};\text{ if } \theta \in [\pi /2, \pi]\\ b)r\rightarrow \infty; \phi(r)=0\\ c)r=0; \phi(r);\text{ finite }$$ getting the potential for inside and outside the sphere. $$\phi (r,\theta)_{inside}=\sum^{\infty}_{l=0}(A_{l}r^{l})P_{l}(\cos\theta)\\ \Rightarrow A_{l}=\phi_{0}\left[\int_{0}^{1}P_{l}(x)dx\right]\left(\dfrac{2l+1}{R^{l}}\right); \forall l=1,3,5,... \\\phi (r,\theta)_{outside}=\sum^{\infty}_{l=0}\dfrac{B_{l}}{r^{l+1}}P_{l}(\cos\theta)\\ \Rightarrow B_{l}=\phi_{0}[\int_{0}^{1}P_{l}(x)dx](2l+1)R^{l+1}; \forall l=1,3,5,...$$

Then the second solution, with the sphere rotated 90 degrees around the $YZ$ plane; $$\phi (r,\theta,\varphi)=\sum^{\infty}_{l=0}\sum^{l}_{m=-l}(A_{l,m}r^{l}+\dfrac{B_{l,m}}{r^{l+1}})Y_{l,m}(\theta,\varphi)$$ with boundary conditions: $$a)\phi(R,\theta)=\phi_{o}; if \varphi \in [0,\pi)\\ \phi(R,\theta)=-\phi_{o}; if \varphi \in [\pi, 2\pi]\\ b)r\rightarrow \infty; \phi(r)=0\\ c)r=0; \phi(r);finite$$ getting the potential for inside and outside the sphere. $$\phi (r,\theta,\varphi)_{inside}=\sum^{\infty}_{l=0}\sum^{l}_{m=-l}(A_{l,m}r^{l})Y_{l,m}(\theta,\varphi)\\ \Rightarrow A_{l,m}=R^{-l}\dfrac{4\phi_{o}}{im}\sqrt{\dfrac{2l+1}{4\pi}\dfrac{(l-m)!}{(l+m)!}}\left[\int_{-1}^{1} P_{l}^{m}(x)d(x)\right];\forall l\in\mathbb{N},\forall m=1,3,5,...\\ \phi (r,\theta,\varphi)_{outside}=\sum^{\infty}_{l=0}\sum^{l}_{m=-l}(\dfrac{B_{l,m}}{r^{l+1}})Y_{l,m}(\theta,\varphi)\\ \Rightarrow B_{l,m}=R^{l+1}\dfrac{4\phi_{o}}{im}\sqrt{\dfrac{2l+1}{4\pi}\dfrac{(l-m)!}{(l+m)!}}\left[\int_{-1}^{1} P_{l}^{m}(x)d(x) \right];\forall l\in\mathbb{N},\forall m=1,3,5,...$$

• So you need a rotation of $\pi/2$ about the x-axis then. Am I understanding correctly? – user154997 Sep 14 '17 at 8:04
• @LucJ.Bourhis Well, indeed is a rotation of $\pi/2$ but i believe is of the y-axis and z-axis, with the x-axis fixed – Mounice Sep 14 '17 at 13:20
• Yes, that's what I meant. It is still a bit fuzzy what you exactly did though. Could you elaborate with a bit of the math? – user154997 Sep 14 '17 at 13:31
• @LucJ.Bourhis Is this enough mathematical elaboration or do you want more details? How do I show that both solutions are the same? – Mounice Sep 14 '17 at 14:16

This is not a complete answer, just a suggestion to start, because I don't know how to finish, or even whether this can be a successful route. What I am proposing to do is to rotate the spherical harmonics in your second derivation, hoping then to recover your first derivation.

In your second derivation, I guess you have used real spherical harmonics, although the standard notation of $Y_{lm}$ stands for the complex ones. So just so that I don't confuse myself, I'll write $S_{lm}$ for the real one and $Y_{lm}$ for the complex ones, i.e. the former are those in your formulae. Then I'll write the column vector of all $S_{lm}$ for $-l\le m\le l$ as $S_l$, and similarly the column vector of all $Y_{lm}$ for $-l\le m\le l$ as $Y_l$. Since $S_{lm}$ is a linear combination of $Y_{lm}$ for $-l\le m\le l$, there is a $(2m+1)\times(2m+1)$ matrix $C$ such that

$$S_l = C Y_l. \tag{1}$$

The important result is now that the rotation $Y'_{lm}$ of $Y_{lm}$ is a linear combination of $Y_{l,n}$'s (the same $l$ to be crystal clear). We can therefore talk of a matrix $D_l$ such that

$$Y'_l=D_l Y_l. \tag{2}$$

That matrix $D_l$ is the path toward the solution of your problem. This is a well-known one: it's called the Wigner D-matrix and there are explicit expressions for it. Then combining eqn. (1) and (2), you can get a matrix $\Delta_l$ such that

$$S'_l = \Delta S_l,$$

where $S'_{lm}$ is the rotation of $S_{lm}$. That matrix $\Delta_l$ is what you need eventually. You can find all the details and the formula you would need in [1].

There is no guarantee this will prove to be tractable. I am afraid I have no idea beyond that but I'd be happy to discuss further if you feel like it!

1. Miguel A. Blanco, M. Flórez, and M. Bermejo. Evaluation of the rotation matrices in the basis of real spherical harmonics. J. Mol. Struct. 419, 19-27 (1997), CiteSeerX eprint.
• @PatrickC proposed in an edit to add a reference to "Rotation matrices for real spherical harmonics:general rotations of atomic orbitals in space-fixed axes", Didier Pinchon and Philip E Hoggan 2007 J. Phys. A: Math. Theor. 40 1597". I was aware of that paper but I don't think it would help the OP much as it is geared toward an efficient evaluation of the rotation matrices $\Delta_l$ for large $l$ by combining rotations about the z-axis with swapping of the x- and z-axis: the former have simple matrices and the latter can be computed once and for all by recurrence. The OP needs closed formulae – user154997 Sep 14 '17 at 18:58

Yes, there is a connection between the generator of Legendre functions (of the first kind) and spherical harmonics.

Legendre functions (of the first kind) have the generating function

$$G(\cos\theta, h) = \frac{1}{\sqrt{1-2h\cos\theta + h^2}} = \displaystyle\sum_{\ell=0}^{\infty} h^{\ell}P_{\ell}(\cos\theta)\,,\quad |h| < 1$$

where $h$ is a dummy variable (see Mathematical Methods for Physicists," by George B. Arfken and Hans J. Weber ($4^{\rm th}$ edition, page 694, where I have substituted $x = \cos\theta$ and set $t = h$).

The Legendre functions (of the first kind) $P_{\ell}(\cos\theta)$ are polynomials in $\cos\theta$ of degree $\ell\,$ and satisfy the ordinary differential equation

$$\frac{d^2y}{d\theta^2} + 2\cot\theta\frac{dy}{d\theta} + \ell(\ell + 1)y = 0\,.$$

To see the connection to spherical harmonics consider the solution of Laplace's equation

$$\nabla^2U({\bf r}) = 0$$

for the function $U({\bf r}) = U(r, \theta, \varphi)$ using spherical polar coordinates $(r, \theta, \varphi)$ where

$$0 \le r < \infty\,,\hspace{3mm} 0 \le \theta \le \pi\,,\hspace{3mm} 0 \le \varphi < 2\pi\,.$$

If the function $U({\bf r})$ can be written as $U(r\,,\theta\,, \varphi) = R(r) \Theta(\theta)\Phi(\varphi)$, i.e. we assume separation of variables, then (see some books on mathematics for physicists or mathematical methods for physicists, e.g Mathematics for Physicists" by B.R. Martin and G. Shaw,Mathematical Methods for Physics and Engineering," 3rd edition by K.F. Riley et al, Mathematical Methods for Physicists," by George B. Arfken and Hans J. Weber (any edition))

we obtain the ordinary differential equations

$$r^2\frac{d^2R}{dr^2} + 2r\frac{dR}{dr} - \lambda R=0$$

and

$$\left[\frac{\sin\theta}{\Theta}\frac{d}{d\theta}\left(\sin\theta\frac{d\Theta}{d\theta}\right) + \lambda\sin^2\theta\right] + \frac{1}{\Phi}\frac{d^2\Phi}{d\varphi^2}=0$$

where $\lambda = \ell(\ell+1)$.

In the second of these equations we again use separation of variables and set the separation constant to be $m^2$ to obtain

$$\frac{1}{\Phi}\frac{d^2\Phi}{d\varphi^2} = -m^2$$

and

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

which is Legendre's associated differential equation.

The first of the two ordinary differential equations immediately previous has the solution

$$\Phi(\varphi) = A\cos(m\varphi) + B\sin(m\varphi)\,,$$

where $m$ is an integer (required for single valued solutions of $U$), with $A$ and $B$ being constants.

Legendre's associated differential equations has the solution

$$\Theta(\theta) = CP^{m}_{\ell}(\cos\theta) + DQ^{m}_{\ell}(\cos\theta)$$ where $C$ and $D$ are constants and $P^{m}_{\ell}(\cos\theta)$ and $Q^{m}_{\ell}(\cos\theta)$ are the associated Legendre functions of the first and second kind respectively. In physical problems we usually require solutions that are well behaved on the axis of symmetry which we take to be the $z$-axis. Therefore $D=0$ since $Q^{m}_{\ell}(\cos\theta)$ diverges at $\theta =0$ and $\theta=\pi$.

This bring us to the connection with spherical harmonics. The spherical harmonics are given by (see Mathematical Methods for Engineering and Physics" by K.F. Riley(3$^{\rm rd}$ edition))

$$Y^{m}_{\ell}(\theta, \varphi) = (-1)^{m}\left[\frac{2\ell+1}{4\pi}\frac{(\ell - m)!}{(\ell + m)!}\right]^{1/2}P^{m}_{\ell}(\cos\theta)(\cos(m\varphi)+i\sin(m\varphi))\,,$$

where $\ell \ge 0$ and $-\ell \le m \le \ell\,.$

To obtain Legendre polynomials of the first kind $P_{\ell}(\cos\theta)$ we set $m=0$ in the expression for the spherical harmonic functions, i.e.

$$P_{\ell}(\cos\theta) = \left[\frac{4\pi}{2\ell+1}\right]^{1/2}Y^{0}_{\ell}(\theta,\varphi)\,.$$

Given this relationship you could substitute the expression for $P_{\ell}(\cos\theta)$ in terms of $Y^{0}_{\ell}(\theta,\varphi)$ into the power series that defines the generating function $G(\cos\theta, h)$.

Moreover, you could use the following expression (known as Rodrigues formula) (see Mathematical Methods for Physicists" by George B. Arfken and Hans J. Weber, 4$^{\rm th}$ edition, pg. 738, formula 12.144 with the substitution $x=\cos\theta$ and $n=\ell$) $$P^{m}_{\ell}(\cos\theta) = (\sin\theta)^{m}\frac{d^{m}P_{\ell}(\cos\theta)}{d(\cos\theta)^{m}}$$

where

$$P_{\ell}(\cos\theta) = \frac{1}{2^{\ell}\ell!}\frac{d^{\ell}(\cos^2\theta -1)^{\ell}}{d(\cos\theta)^{\ell}}$$

and substitue it into the expression for the spherical harmonics $Y^{m}_{\ell}(\theta,\varphi)$.

Following on from this one could possibly obtain a power series expression for $P_{\ell}(\cos\theta$) in terms of $G(\cos\theta, h)$ and then put this into the formula for the $Y^{m}_{\ell}(\theta,\varphi)$ but this would be difficult.