<<VilGebra`

A={{2,-1,-2},{-1,9,-4},{-2,-4,5}};
variables=Table[Subscript[x,i],{i,1,Dimensions[A][[1]]}];
variables.A.Transpose@variables//Expand