# Transforming a matrix into a quadratic form: a2q

### 5.54.2 Transforming a matrix into a quadratic form: a2q

The a2q command finds the quadratic form corresponding to a symmetric matrix.

- a2q takes two arguments:
  - A, a symmetric matrix of a quadratic form.
  - vars, a vector of variable names whose size is the same as the number of rows of A.
- a2q(A,vars) returns the symbolic expression for the quadratic form.

#### Examples.

- Input:
  a2q([[0,1],[1,0]],[x,y])
  Output:

  2 x y

- Input:
  a2q([[1,2],[2,4]],[x,y])
  Output:

  x2+4 x y+4 y2