# Help Understanding Spectral Method for solving Differential Equations

I've posted a more detailed version of this question here : SE-ComputationalSci

but I'm really struggling with a simpler and related question. Lets say one wants to solve (I made this equation up, right now)

$F''(x) - F'(x) + x^2 F(x) = \lambda F(x)$, and you are given the boundary conditions $F(0)=F(X) =0$. The domain of $x$ is $(0,X)$.

Now, if I want to use a spectral method, where I expand my functions in terms of Chebyshev polynomials. I would want to do something like this:

1) Change the domain, introduce $y = 2(x/X) -1$ then I would do

2) Express $F (x) = \Sigma_0^{\infty} f_i T_i(y)- \frac{1}{2}f_0$ , where $T_i$ are my Chebyshev polynomials.

3) Use the orthogonality of the polynomials to get set of algebraic equations to solve for $F(x)$.

My question is what do I do with the $x^2$ term in my original equation. Do I rewrite that in terms of $y$, or do I define a new function $x^2*F(x) = G(x)$ and then try to work out how the expansion coefficients for $G(x)$ would be related to $f_i$?

I may just be missing the whole idea of the spectral method, in the first place. The goal of understanding this better would be to reproduce the spectral method used in Appendix A of this paper: http://arxiv.org/pdf/gr-qc/0210102.pdf

Thanks for any answers, and help.

-

## migrated from physics.stackexchange.comSep 2 '12 at 3:29

This question came from our site for active researchers, academics and students of physics.

I'd go with door #1, i.e. rewrite $x^2$ in terms of $y$, and then in terms of Chebyshev polynomials in $y$:

$$x^2 = \frac{X^2}{4}(y + 1)^2 = \frac{X^2}{4}\biggl[\frac{T_2(y)}{2} + 2T_1(y) + \frac{3}{2}T_0(y)\biggr]$$

When you expand $F(x)$, the term with $x^2$ then becomes

$$x^2 F(x)\to \frac{X^2}{4}\biggl[\frac{T_2(y)}{2} + 2T_1(y) + \frac{3}{2}T_0(y)\biggr]\biggl(\sum_{i=0}^\infty f_i T_i(y) - \frac{1}{2}f_0\biggr)$$

Now the entire term can be written in terms of products of Chebyshev polynomials, and then you can use the identity

$$2T_i(y)T_j(y) = T_{i + j}(y) + T_{\lvert i - j\rvert}(y)$$

(from the paper) to express those products as sums of other Chebyshev polynomials, so the whole term becomes just a sum of Chebyshev polynomials times some numeric coefficients.

-
Thanks,this works out pretty nicely. I was worried about taking this approach b/c I did not seeing it working out this well. I will try and let you know what happens. –  tau1777 Sep 3 '12 at 18:04
Quick question; How did get the expansion of (y+1)^2? Trial and error, software? –  tau1777 Sep 3 '12 at 20:11
I just looked up the definition of the first three Chebyshev polynomials and did a little algebra. –  David Z Sep 3 '12 at 21:48