# Legendre Equation & Polynomials

1. Jun 28, 2014

### Zondrina

I came across the Legendre differential equation today and I'm curious about how to solve it. The equation has the form:

$$(1 - x^2)y'' - 2xy' + \nu(\nu +1)y = 0, (1)$$

Where $\nu$ is a constant.

The equation has singularities at $x_1 = \pm 1$ where both $p$ and $q$ are not analytic. The best ordinary point to use would probably be $x_0 = 0$, which yields the radius of convergence $R ≥ |x_0 - x_1| = 1$ for the series solution:

$y = \sum_{n=0}^{∞} a_nx^n, |x - x_0| < R$.

Taking derivatives and simplifying $(1)$, I found the recurrence relation to be:

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

From which I have noticed some interesting properties.

If $\nu = 0$, then all of terms involving $n$ even are zero. The terms involving $n$ odd can be deduced from: $a_{n+2} = \frac{n}{n+2}$. When $n = 1, 3, 5 ...$ it can be observed that $a_{2n+1} = \frac{1}{n+2}$.

The series solution can then be written as:

$y = \sum_{n=0}^{∞} a_nx^n = \sum_{n=1}^{∞} a_{2n} x^{2n} + \sum_{n=1}^{∞} a_{2n+1} x^{2n+1} = a_0 + \sum_{n=1}^{∞} \frac{1}{n+2} x^{2n+1}$.

If $\nu = 2m$ or $\nu = 2m +1$ for some $m ≥ 1$, then some other interesting things seem to happen. If $\nu$ is even, all of the even $n$ terms of the recurrence relation are zero after a certain point and there is only an odd sum plus a few even terms. If $\nu$ is odd, all of the odd $n$ terms of the recurrence relation are zero after a certain point and there is only an even sum plus a few odd terms.

Does this sound alright? Finding solutions for $\nu > 0$ has proven slightly difficult to formalize.

2. Jun 28, 2014

### micromass

Staff Emeritus
Except $a_0$

Shouldn't this be
$$a_{n+2} = \frac{n}{n+2}a_n$$

I don't see why you dropped the $a_n$ here.

Anyway, for the case $\nu = 0$, you basically have two kinds of series solutions:

1) The solutions coming from an arbitrary $a_0$. As you correctly found, these solutions will have the form $y(x) = a_0$. This will give rise to the Legendre polynomial.

2) The series solutions of the form $\sum a_n x^n$ where all the $n$ in the sum are odd. So it would be better to write this as $x \sum a_{2n +1} (x^2)^n$. As you found, these will satisfy the recurrence relation $a_{n+2}= \frac{n}{n+2}a_n$. What is the convergence radius of this power series? Apply the ratio test. This will give rise to the Legendre function of the second kind. You should try to prove that this solution is a multiple of $\log\left(\frac{1+x}{1-x}\right)$.

Something similar can be done for $\nu>0$, but let's do the case $\nu = 0$ first.

3. Jun 29, 2014

### Zondrina

Indeed, I figure by convention it was assumed that it is known that at least $a_0$ and $a_1$ are arbitrary, defined explicitly by initial conditions (otherwise they really only help define the recurrence relation); Just clarifying this.

Yes sorry for the typo, I should have hit that preview button.

Yes, expressing the assumed solution as the sum of two series, one including the even terms and one including the odd ones:

$y = \sum_{n=0}^{∞} a_nx^n = \sum_{k=0}^{∞} a_{2k} x^{2k} + \sum_{k=0}^{∞} a_{2k+1} x^{2k+1} = a_0 + a_1[ x + \sum_{k=1}^{∞} \frac{(1 \cdot 3 \cdot ... \cdot 2k+1)}{(3 \cdot 5 \cdot ... \cdot 2k+3)} x^{2k+1}]$.

I see that the two series represent the Legendre polynomials themselves for the value of $\nu$; and any linear combination of these two series also represent a solution to the second order equation. That is:

$y = c_1y_1 + c_2y_2$ is a general solution.

The solution $y_2 = a_1[x + \sum_{k=1}^{∞} \frac{(1 \cdot 3 \cdot ... \cdot 2k+1)}{(3 \cdot 5 \cdot ... \cdot 2k+3)} x^{2k+1}]$ might be an elementary function, but the manipulation required to find a closed form function is tedious.

The radius of convergence of the assumed solution is at least as great as the magnitude of the distance between the ordinary point $x_0$ and the closest singular point $x_1$. The ratio test is another way to do this.

Not quite sure what you meant by a multiple of $log(\frac{1+x}{1−x})$.

4. Jun 29, 2014

### micromass

Staff Emeritus
It will be worthwhile to find the series expansion of

$$\log\left(\frac{1+x}{1-x}\right) = \log(1+x) - log(1-x)$$

Can you do thise? The idea is to find the series of $\frac{1}{1+x}$ and $\frac{1}{1-x}$ and then integrating those.

If you do this, then you will find the closed form of $y_2$.

5. Jun 29, 2014

### Zondrina

I thought that is what you had intended, but I couldn't quite see how to do it last night. I got to this:

$f(x) = log(1+x) - log(1-x)$
$f'(x) = \frac{1}{1+x} + \frac{1}{1-x} = \sum_{n=0}^{∞} (-1)^n x^n + \sum_{n=0}^{∞} x^n = \sum_{n=0}^{∞} ((-1)^n + 1) x^n$

Integrating I obtained:

$f(x) = \sum_{n=0}^{∞} ((-1)^n + 1) \int x^n dx = \sum_{n=0}^{∞} \frac{((-1)^n + 1)}{n+1} x^{n+1} + C$

Where $C = 0$ at $x=0$.

Now when $n$ is zero or even, $((-1)^n + 1) = 2$ and when it is odd, $((-1)^n + 1) = 0$. So we can re-write the series as:

$\sum_{n=0}^{∞} \frac{2}{2n+1} x^{2n+1} = 2(x + \sum_{n=1}^{∞} \frac{1}{2n+1} x^{2n+1})$

6. Jun 29, 2014

### micromass

Staff Emeritus
OK, you got the following series solution:

I don't think this is quite right. For example, we should have
$$a_3= \frac{1}{3}a_1$$
while you have
$$a_3 = \frac{1}{5}$$
Can you check it again, you should get something like
$$y_2 = a_1[x + \sum_{k=1}^{∞} \frac{(1 \cdot 3 \cdot ... \cdot 2k-1)}{(3 \cdot 5 \cdot ... \cdot 2k+1)} x^{2k+1}]$$

Anyway, do you see a relation between your solution $y_2$ and the serious expansion of $\log\left(\frac{1+x}{1-x}\right)$?

7. Jun 29, 2014

### Zondrina

Ah yes I was noticing this after my last post. I forgot that since $a_1$ is arbitrary, I could use $2k-1$ instead of $2k+1$, and the bottom is just $2k+1$ for $k ≥ 1$.

$$y_2 = a_1[x + \sum_{k=1}^{∞} \frac{(1 \cdot 3 \cdot ... \cdot 2k-1)}{(3 \cdot 5 \cdot ... \cdot 2k+1)} x^{2k+1}] = a_1[x + \sum_{k=1}^{∞} \frac{1}{2k+1} x^{2k+1}]$$

The series expansion found in my prior post looks exactly like this one with $a_1 = 2$.

8. Jun 29, 2014

### micromass

Staff Emeritus
Right, so we have

$$y_2(x) = \frac{1}{2} \log\left(\frac{1+x}{1-x}\right)$$

So the general solution to the case $\nu = 0$ is
$$y(x) = C_1 + C_2\log\left(\frac{1+x}{1-x}\right)$$

Now, what about $\nu \neq 0$, can you try the same thing? You will again find that there are two independent solutions: one will give you the Legendre polynomials, and the other one will be related to the $\log\left(\frac{1+x}{1-x}\right)$ function.

9. Jun 29, 2014

### Zondrina

Indeed, now that $\nu = 0$ has been covered, there are two more cases involving $\nu ≥ 1$. Consider once again the recurrence relation:

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

Suppose $\nu$ is even, that is $\nu = 2m$ for some $m \in \mathbb{N}, m ≥ 1$:

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

Once $n = 2k$ for some $k = m$, all the even terms after this point are zero. Thus:

$a_{2k} = (\frac{2k(2k+1) - 2m(2m+1)}{(2k+1)(2k+2)}) a_{2k-2}$
$= - \frac{1}{k!} ((2k)(2k+1) - 2m(2m+1))*((2k-2)((2k-2)+1) - 2m(2m+1))*...*(2m)(2m+1) a_0$

I feel as if there is an easier way to do this?

10. Jun 29, 2014

### micromass

Staff Emeritus
But what exactly is it that you want to do?

I would write the recurrence relation as

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

I feel that this form is simpler.

11. Jun 29, 2014

### Zondrina

I'm trying to find general solutions for $\nu = 0$ and when $\nu$ is a positive integer, which is either even or odd.

I agree with the simplification. Expanding the numerator and factoring it, then pulling out a $(n-\nu)$ and a negative yields the expression you have given:

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

When $n = 0, 2, 4, 6 ...$, grouping the nice looking terms gives the relation:

$a_{2k} = (-1)^k \frac{[\nu (\nu - 2) (\nu - 4) (\nu - 6) ... (\nu - 2k + 2)][(\nu + 1) (\nu + 3) (\nu + 5) (\nu + 7) ... (\nu + 2k - 1)]}{(2k)!}a_0, k≥1$

When $n = 1, 3, 5, 7 ...$, grouping the nice looking terms gives the relation:

$a_{2k+1} = (-1)^k \frac{[(\nu - 1) (\nu - 3) (\nu - 5) (\nu - 7) ... (\nu - 2k + 1)][(\nu + 2) (\nu + 4) (\nu + 6) (\nu + 8) ... (\nu + 2k)]}{(2k+1)!}a_1, k≥1$

Wait a moment. Don't these provide a solution for ANY $\nu$ including $\nu = 0$? Makes me feel like the separate case was a bit of a waste now. Anyhoo, these yield the general solution I believe:

$y = a_0 + \sum_{k=1}^{∞} a_{2k} x^{2k} + a_1x + \sum_{k=1}^{∞} a_{2k+1} x^{2k+1}$

12. Jun 29, 2014

### micromass

Staff Emeritus
OK, that looks good. Your solution will indeed even holds for any complex number $\nu$. But there will only be a polynomial solution for $\nu$ an integer.

Now, are you happy with that series solution or do you want it in a simpler form?

13. Jun 29, 2014

### Zondrina

For the sake of completeness I would like to clarify some things. We have:

$a_{2k} = (-1)^k \frac{[\nu (\nu - 2) (\nu - 4) (\nu - 6) ... (\nu - 2k + 2)][(\nu + 1) (\nu + 3) (\nu + 5) (\nu + 7) ... (\nu + 2k - 1)]}{(2k)!}a_0, k≥1$

$a_{2k+1} = (-1)^k \frac{[(\nu - 1) (\nu - 3) (\nu - 5) (\nu - 7) ... (\nu - 2k + 1)][(\nu + 2) (\nu + 4) (\nu + 6) (\nu + 8) ... (\nu + 2k)]}{(2k+1)!}a_1, k≥1$

$y = a_0 + \sum_{k=1}^{∞} a_{2k} x^{2k} + a_1x + \sum_{k=1}^{∞} a_{2k+1} x^{2k+1}$

For $\nu = 0$ it was found that $y = c_1(a_0) + c_2(\frac{1}{2} \log(\frac{1+x}{1-x}))$ since all the even terms were zero except $a_0$ and the odd terms were a convergent Taylor function.

If $\nu = 2r$ for some $r \in \mathbb{N}, r ≥ 1$, the even solution $y_1$ becomes a truncated polynomial of degree $\nu$. That is, the infinite series reduces to a finite series where:

$y_1 = a_0[1 + \sum_{k=1}^{\frac{\nu}{2}} \frac{a_{2k}}{a_0} x^{2k}]$

The odd solution $y_2$ remains an infinite series. In fact, it is a convergent Taylor series, which is a multiple of $\log(\frac{1+x}{1-x})$.

If $\nu = 2r + 1$ for some $r \in \mathbb{N}, r ≥ 1$, the odd solution $y_2$ becomes a truncated polynomial of degree $\nu$. That is, the infinite series reduces to a finite series where:

$y_2 = a_1[x + \sum_{k=1}^{\frac{\nu + 1}{2}} \frac{a_{2k+1}}{a_1} x^{2k+1}]$

The even solution $y_1$ remains an infinite series. In fact, it is a convergent Taylor series, which is a multiple of $\log(\frac{1+x}{1-x})$.

Writing the general solutions for the cases $\nu > 0$ in $\log$ form still eludes me. For example, taking the general case where $\nu$ is even:

$y = c_1(a_0[1 + \sum_{k=1}^{\frac{\nu}{2}} \frac{a_{2k}}{a_0} x^{2k}]) + c_2y_2$.

How am I to reduce $y_2$ into a closed $\log$ form? I tried to manipulate $a_{2k+1}$ by multiplying and dividing to introduce factorials.

14. Jun 29, 2014

### micromass

Staff Emeritus
They won't exactly by multiples of $\log\left(\frac{1+x}{1-x}\right)$ in the case $\nu>0$. Well, it depends on what you mean with multiples. If you allow multiplication and addition of polynomials then ok.

For example, for $\nu=1$, then you have

$$Q_1(x) = \frac{x}{2}\log\left(\frac{1+x}{1-x}\right) - 1$$

For $\nu = 2$, you have

$$Q_2(x) = \frac{3x^2 - 1}{4}\log\left(\frac{1+x}{1-x}\right) - \frac{3x}{2}$$

These functions follow the same recurrence relations as the Legendre polynomials, for example, they satisfy

$$(n+1)Q_{n+1}(x) - (2n + 1)Q_n(x) + n Q_{n-1}(x) = 0$$

15. Jun 29, 2014

### Zondrina

So you are insinuating that:

$Q_{n+1} (x) = \frac{(2n+1)Q_n(x) - nQ_{n-1}(x)}{(n+1)}, n = \nu ≥ 2$.

So for example:

$Q_3(x) = \frac{15x^2 - 5}{12} \log(\frac{1+x}{1-x}) - \frac{5x}{2} - \frac{x}{3} \log(\frac{1+x}{1-x}) + \frac{2}{3} = (\frac{15x^2 - 5}{12} - \frac{x}{3}) \log(\frac{1+x}{1-x}) - \frac{5x}{2} + \frac{2}{3}$

16. Jun 29, 2014

### micromass

Staff Emeritus
Sorry, I made a mistake. The recursion should be

$$Q_{n+1} (x) = \frac{(2n+1)xQ_n(x) - nQ_{n-1}(x)}{(n+1)}$$

17. Jun 29, 2014

### Zondrina

Ahh I was wondering why the powers didn't increase :). Now that makes more sense.

Just to clarify, the functions $Q_n$ are the sum of the infinite series solution according to whether $\nu$ is even or odd?

18. Jun 29, 2014

### micromass

Staff Emeritus
Yes. They are called the Legendre functions of the second kind.

19. Jun 29, 2014

### Zondrina

I see. Legendre functions of the first kind are regular (analytic), aka the finite solution in this case. Legendre functions of the second kind are not regular at $\pm 1$, like the function $\log(\frac{1+x}{1-x})$. Hence the infinite Taylor series that expresses the second solution (which can be found by the recurrence relation on $Q_n$) is not regular.

Thank you for all of the help by the way.