# Eigenvalues: eigenvals

### 5.48.1 Eigenvalues: eigenvals

The eigenvals command finds eigenvalues of a matrix.

- eigenvals takes one argument:
  A, a square matrix.
- eigenvals(A) returns the sequence of the eigenvalues of A, including multiplicities. (If A is an n× n matrix, then the sequence will have n values.)

Remark: Xcas may not be able to find the exact roots of the characteristic polynomial in some cases. In that case, eigenvals(A) will return approximate eigenvalues of A if the coefficients are numeric or a subset of the eigenvalues if the coefficients are symbolic.

#### Examples.

- Input:
  eigenvals([[4,1,-2],[1,2,-1],[2,1,0]])
  Output:

  2,2,2

- Input:
  eigenvals([[4,1,0],[1,2,-1],[2,1,0]])
  Output:

  rootof | ⎛ ⎝ | ⎡ ⎣ | ⎡ ⎣ | 1,0,−20,0,100 | ⎤ ⎦ | , | ⎡ ⎣ | 1,0,−24,0,144,0,−148 | ⎤ ⎦ | ⎤ ⎦ | ⎞ ⎠

  18

  ,

  rootof | ⎛ ⎝ | ⎡ ⎣ | ⎡ ⎣ | −1,0,20,18,8 | ⎤ ⎦ | , | ⎡ ⎣ | 1,0,−24,0,144,0,−148 | ⎤ ⎦ | ⎤ ⎦ | ⎞ ⎠

  36

  ,

  rootof | ⎛ ⎝ | ⎡ ⎣ | ⎡ ⎣ | −1,0,20,−18,8 | ⎤ ⎦ | , | ⎡ ⎣ | 1,0,−24,0,144,0,−148 | ⎤ ⎦ | ⎤ ⎦ | ⎞ ⎠

  36

  Input:
  evalf(eigenvals([[4,1,0],[1,2,-1],[2,1,0]]))
  Output:

  1.46081112719,4.21431974338,0.324869129433