# Writing a polynomial in terms of other polynomials (Hermite, Legendre, Laguerre)

## Homework Statement

The first 3 parts of this 4 part problem were to derive the first 5 Hermite polynomials (thanks vela), The first 5 Legendre polynomials, and the first 5 Laguerre polynomials. Here is the last part:

Write the polynomial $$2x^4-x^3+3x^2+5x+2$$ in terms of each of the sets of orthogonal functions: Legendre polynomials, Hermite polynomials and Laguerre polynomials.

## Homework Equations

Legendre polynomials
$$P_0 = 1$$

$$P_1 = x$$

$$P_2 = \frac{1}{2}(3x^2-1)$$

$$P_3 = \frac{1}{2}(5x^3-3x)$$

$$P_4 = \frac{1}{6}(35x^4-30x^2+3)$$

Hermite polynomials
$$H_0=1$$

$$H_1=2x$$

$$H_2=4x^2-2$$

$$H_3=8x^3-12x$$

$$H_4=16x^4-48x^2+12$$

Laguerre polynomials
$$L_0=1$$

$$L_1=-x+1$$

$$L_2=\frac{1}{2}(x^2-4x+2)$$

$$L_3=\frac{1}{6}(-x^3+9x^2-18x+6)$$

$$L_4=\frac{1}{24}(x^4-16x^3+72x^2-96x+24)$$

## The Attempt at a Solution

I first started with the Laguerre polynomials. I recognized that the 5th Laguerre polynomial was the only one that contained an x^4 term. I then knew that the only way to get an 2x^4 term in the polynomial I am trying to re-write would be to multiply L4 by 48. I then went on to look at the -x^3 term. I realized that since the multiple of L4 (48) couldn't be changed, I would have to multiply L3 by something that would give me the -x^3 term after it was added to the x^3 term in the L4 polynomial. I continued this path until I reached:

$$2x^4-x^3+3x^2+5x+2=48L_4-186L_3+276L_2-191L_1+55L_0$$

I was not entirely sure what the question was asking so I took my first result to my professor. He said that the method used was correct (as long as my algebra was correct) but that it is not the method he had intended us to use. He said that I needed to use the equation:

$$f(x)=\sum_{n=1}a_n\phi_n(x)$$

Where phi is either the Legendre, Hermite or Laguerre polynomials.

I went back through my notes and tutorial and found a way to express the coefficients a_n. However, the method used to find a_n was for periodic functions, namely the example shown was for the orthogonal set of sine and cosine.

I attempted to model a new solution based on the one for cosine and sine. I do not think that my new attempt is correct because while it yields the correct coefficients (at least for the L0 & L1) of the Laguerre polynomials, it seems a more complicated method then my first attempt. Also, I believe that trying to solve for the coefficients in the way I did is just a re-hashing of deriving the original polynomials.

What I did was I took the equation:

$$f(x)=\sum_{n=1}a_n\phi_n(x)$$

and multiplied both sides by phi_m and then integrated both sides. Using orthogonality relationships I came up with:

$$a_n=\int_{0}^{\infty}f(x)\phi_n(x)dx$$

For the Laguerre polynomials (normalized to 1)

Eventually this just boiled down to a similar linear algebra problem that I am supposed to avoid. Does anyone see another way?

vela
Staff Emeritus
Homework Helper
What I did was I took the equation:

$$f(x)=\sum_{n=1}a_n\phi_n(x)$$

and multiplied both sides by phi_m and then integrated both sides. Using orthogonality relationships I came up with:

$$a_n=\int_{0}^{\infty}f(x)\phi_n(x)dx$$

For the Laguerre polynomials (normalized to 1)

Eventually this just boiled down to a similar linear algebra problem that I am supposed to avoid. Does anyone see another way?
That's not the correct inner product for the Laguerre polynomials. You need the weighting function w(x)=e-x in there. Other than that detail, though, your method is correct.

Thanks for the response.

If,

$$a_n=\int_{0}^{\infty}f(x)\phi_n(x)e^{-x}dx$$

For the laguerre polynomials is correct, then does this say:

$$a_4=\int_{0}^{\infty}(2x^4-x^3+3x^2+5x+2)(\frac{1}{24}x^4-\frac{2}{3}x^3+3x^2-4x+1)e^{-x}dx$$

I tried the above equation. I ended up having 9 integrals that looked like:

$$\int_{0}^{\infty}cx^{(m+n)}e^{-x}dx$$

where c is a constant and the quantity (m+n) is the power of x. Based off of previous results, I used the relationship:

$$\int_{0}^{\infty}x^{(m+n)}e^{-x}dx=(m+n)!$$

I input the product of the two polynomials into maple and then applied the above equation for the different values of (m+n) and got back that

$$a_4=\frac{-349}{24}$$

I feel fairly certain that the coefficient of of L4 must be 48.

vela
Staff Emeritus
Homework Helper
I just evaluated that integral in Mathematica, and it was equal to 48.

This is the product of f(x) and L4(x):

$$2-3 x-11 x^2+\frac{2 x^3}{3}+\frac{47 x^4}{4}-\frac{307 x^5}{24}+\frac{163 x^6}{24}-\frac{11 x^7}{8}+\frac{x^8}{12}$$

so you get

$$2(0!)-3(1!)-11(2!)+\frac{2}{3}(3!)+\frac{47}{4}(4!)-\frac{307}{24}(5!)+\frac{163}{24}(6!)-\frac{11}{8}(7!)+\frac{1}{12}(8!) = 48$$

Last edited:
vela
Staff Emeritus
Homework Helper
It occurs to me you can save yourself quite a bit of work if you just calculate the five integrals

$$I_n = \int_0^\infty x^n f(x) e^{-x} dx$$

for n=0, 1, 2, 3, 4. Then, for instance,

$$a_4 = \int_0^\infty L_4(x) f(x) e^{-x} dx = \frac{1}{24}(I_4 - 16 I_3 + 72 I_2 - 96 I_1 + 24 I_0)$$

Wow. Thanks. I must have made a mistake along the line. I haven't found it yet, but I agree with your post. Thank you for doubling checking and taking the time to evaluate the integral. Thanks again, I seem to make a ton of algebraic / input mistakes.

It occurs to me you can save yourself quite a bit of work if you just calculate the five integrals

$$I_n = \int_0^\infty x^n f(x) e^{-x} dx$$

for n=0, 1, 2, 3, 4. Then, for instance,

$$a_4 = \int_-1^\1 L_4(x) f(x) e^{-x} dx = \frac{1}{24}(I_4 - 16 I_3 + 72 I_2 - 96 I_1 + 24 I_0)$$

Hey, Vela. When I did the Hermite polynomial, I used
int ( 2x^4-x^3+3x^2+5x+2) ( 16x^4-48x^2+12) (e^-x^2), -inf, inf to calculate the a4, but I got a different number from linear algebra. (e^-x^2 is the weight function for Hermite polynomial)

vela
Staff Emeritus
Homework Helper
$$\int_{-\infty}^\infty H_n(x)H_n(x)e^{-x^2} dx = n!~2^n \sqrt{\pi}$$