# Reducing a quadratic form: gauss

### 5.54.3 Reducing a quadratic form: gauss

The gauss command uses Gauss’s algorithm to write a quadratic form as a sum or difference of squares.

- gauss takes two arguments:
  - q, a symbolic expression representing a quadratic form.
  - vars, a vector of variable names.
- gauss(q,vars) returns q written as sum or difference of squares.

#### Example.

Input:

gauss(2*x*y,[x,y])

Output:

⎛ ⎝ | x+y | ⎞ ⎠ | 2

2

−

⎛ ⎝ | −x+y | ⎞ ⎠ | 2

2