# Eigenvalues NaN and inf

Suppose I have a system AX = nBX where A and B are known martrices, X is the coefficient matrix.

I am solving this using Chebyshev polynomials.

BC's are u(-1)=0=u(1)

I am imposing the bc's for the first and last rows of matrices A and B.

e=solve(A,B) e[1]=0 e[-1]=0 x=solve(A,e)

What is wrong with this?

## Answers

The question you seem to be asking: how come a generalized eigenvalue problem has eigenvalues inf and nan?

Your generalized eigenvalue problem is singular and has eigenvalues lambda=alpha/beta such that (alpha=0, beta=0) and (alpha!=0, beta=0). Since eigvals reports the eigenvalues, they are 0/0=nan or x/0=inf, correspondingly.

http://www.netlib.org/lapack/lug/node35.html

If your problem shouldn't have such eigenvalues, then it's likely that there is an error in the construction of the matrices.