### 15.6.2 Transforming a matrix into a quadratic form

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

a2q([[0,1],[1,0]],[x,y])

2 x y |  |  |  |  |  |  |  |  |  |

a2q([[1,2],[2,4]],[x,y])

x2+4 x y+4 y2 |  |  |  |  |  |  |  |  |  |