Quadratic Forms

Manipulate[ContourPlot3D[a x^2 + b  y^2 + c z^2   + d x y + e x z + f y z ==1,{x,-3,3},{y,-3,3}, {z,-3,3}], {a,-3,3},{b,-3,3},{c,-3,3}, {d,-3,3},{e,-3,3},{f,-3,3}]

xvec = {x,y,z}

A = {{9,-1,2},{-1,7, -3},{2, -3, 3}}; A // MatrixForm

xvec.A.xvec // Simplify

Eigenvalues[A]

N[Eigenvalues[A]]

DMat = DiagonalMatrix[N[Eigenvalues[A]]]; DMat // MatrixForm

xvec.DMat.xvec // Simplify

ContourPlot3D[xvec.DMat.xvec ==1,{x,-1,1},{y,-1,1},{z,-1,1}]

ContourPlot3D[xvec.A.xvec==1,{x,-1,1},{y,-1,1},{z,-1,1}]

ContourPlot3D[xvec.A.xvec==1,{x,-1,1},{y,-1,1},{z,-1,1}]

{b1,b2,b3} = N[Eigenvectors[A]]

v1 = b1/ Sqrt[b1.b1]

v2 = b2/Sqrt[b2.b2]

v3 = b3/Sqrt[b3.b3]

S = Transpose[{v1,v2,v3}]; S // MatrixForm

{xx,yy,zz} = Transpose[S].xvec

{xx,yy,zz} // MatrixForm

Inverse[S] // MatrixForm

Transpose[S] //  MatrixForm

S. Transpose[S] // MatrixForm

A = {{3,4,5},{4,6, 8},{5,8,11}}; A // MatrixForm

xvec.A.xvec // Simplify

ContourPlot3D[xvec.A.xvec == 1,{x,-3,3},{y,-3,3},{z,-3,3}]

xvec . DiagonalMatrix[N[Eigenvalues[A]]].xvec // Simplify

ContourPlot3D[xvec. DiagonalMatrix[N[Eigenvalues[A]]].xvec  == 1,{x,-3,3},{y,-3,3},{z,-3,3}]