a = {{1, 2, 3}, {2, -1, 3}, {-2, 4, 1}}

MatrixForm[a]

Eigenvectors[a]
Eigenvalues[a]

a . Eigenvectors[a][[1]] // Simplify
Eigenvalues[a][[1]] Eigenvectors[a][[1]] // 
      Simplify

a . Eigenvectors[a][[2]] // Simplify
Eigenvalues[a][[2]] Eigenvectors[a][[2]] // 
      Simplify

a . Eigenvectors[a][[3]] // Simplify
Eigenvalues[a][[3]] Eigenvectors[a][[3]] // 
      Simplify

(b = {{1, 0}, {0, 1}}) // MatrixForm
Eigenvectors[b]
Eigenvalues[b]

(b = {{2, 0}, {0, -1}}) // 
      MatrixForm
Eigenvectors[b]
Eigenvalues[b]

(b = {{0, 1}, {1, 0}}) // MatrixForm
Eigenvectors[b]
Eigenvalues[b]

(p = Transpose[Eigenvectors[b]]) // MatrixForm

(c = Inverse[p] . b . p) // MatrixForm

Det[b]
Det[c]

stopa[b_] := Sum[b[[i, i]], {i, Length[b]}]

stopa[b]
stopa[c]

(a = {{1, 2, 3}, {2, -1, 3}, {-2, 4, 1}}) // 
      MatrixForm
Eigenvectors[a]
Eigenvalues[a]

(p = Transpose[Eigenvectors[a]]) // MatrixForm

(c = Inverse[p] . a . p) // MatrixForm

(c // Simplify) // MatrixForm

Det[a]
Det[c]

stopa[a]
stopa[c]

stopa[a]
stopa[c] // Simplify

m = Minors[a, 2]

(* 
      sucet hlavnych minorov druheho stupna *) 
Sum[m[[i, i]], {i, Length[m]}]

invariant1 = Det[a]
invariant2 = (-1) 
        Sum[Minors[a, 2][[i, i]], {i, 
            Length[a]}]
invariant3 = stopa[a]

charpolynom[a_] := Det[a -  x IdentityMatrix[Length[a]]]

charpolynom[a]

(invariant1*
            MatrixPower[a, 0] + invariant2*MatrixPower[a, 1] + 
          invariant3*MatrixPower[a, 2] + (-1)^Length[a]*
            MatrixPower[a, 3]) // MatrixForm

<< LinearAlgebra`Orthogonalization`

p // 
      MatrixForm

    (portog = GramSchmidt[p] // Simplify) // MatrixForm

Do[Print[p[[i]] . p[[j]] // Simplify], {i, Length[p]}, {j, 
        Length[p]}]

Do[Print[(portog[[i]] . portog[[j]]) // Simplify], {i, 
        Length[p]}, {j, Length[p]}]

Table[
        p[[i]] . p[[j]] // Simplify, {i, Length[p]}, {j, Length[p]}] // 
      MatrixForm
Table[
        portog[[i]] . portog[[j]] // Simplify, {i, Length[p]}, {j, 
          Length[p]}] // MatrixForm

(a = {{4, 2, 1}, {2, 4, 2}, {1, 2, 4}}) // 
      MatrixForm
p = Eigenvectors[a]
Eigenvalues[a]

Table[
        p[[i]] . p[[j]] // Simplify, {i, Length[p]}, {j, Length[p]}] // 
      MatrixForm

f[x_, y_] := 3 x^2 + 2 y^2
a = -2; b = 3; c = -1; d = 4;
pohlad = {2.5, 1.5, 0.8};
ns = 10;
graf = 
      Plot3D[f[x, y], {x, a, b}, {y, c, d}, ViewPoint -> pohlad, 
        ImageSize -> {400, 400}, PlotPoints -> ns + 1]

xstep = (b - a)/ns
ystep = (d - c)/ns

x = b; y = d;
Show[graf, Graphics3D[{PointSize[0.02], Point[{x, y, 0}]}], 
      Graphics3D[{PointSize[0.02], Point[{x, y, f[x, y]}]}], 
      Graphics3D[{RGBColor[1, 0, 0], 
          Line[{{x, y, 0}, {x, y, f[x, y]}}]}]]

x = b - xstep/2; y = d - ystep/2;
Show[graf, Graphics3D[{PointSize[0.02], Point[{x, y, 0}]}], 
      Graphics3D[{PointSize[0.02], Point[{x, y, f[x, y]}]}], 
      Graphics3D[{RGBColor[1, 0, 0], 
          Line[{{x, y, 0}, {x, y, f[x, y]}}]}]]

Show[graf, 
      Table[{Graphics3D[{PointSize[0.02], Point[{x, y, 0}]}], 
          Graphics3D[{PointSize[0.02], Point[{x, y, f[x, y]}]}], 
          Graphics3D[{RGBColor[1, 0, 0], 
              Line[{{x, y, 0}, {x, y, f[x, y]}}]}]}, {x, a + xstep/2, b, 
          xstep}, {y, c + ystep/2, d, ystep}]]

ns = 10;
xstep = (b - a)/ns;
ystep = (d - c)/ns;
Sum[
        f[x, y]*xstep*ystep, {x, a + xstep/2, b, xstep}, {y, c + ystep/2, d, 
          ystep}] // N

Do[
xstep = (b - a)/
          ns; 
ystep = (d - c)/
          ns; 
objem = 
        Sum[f[x, y]*xstep*ystep, {x, a + xstep/2, b, xstep}, {y, c + ystep/2, 
              d, ystep}] // N; 
Print[objem], {ns, 1, 10, 
        1}]

Do[
xstep = (b - a)/
          ns; 
ystep = (d - c)/
          ns; 
objem = 
        Sum[f[x, y]*xstep*ystep, {x, a + xstep/2, b, xstep}, {y, c + ystep/2, 
              d, ystep}] // N; 
Print[objem], {ns, 5, 100, 
        5}]

Clear[x, y]
Integrate[f[x, y], {x, a, b}, {y, c, d}] // N