For total control over integration, sweep over the ellipse along the eigendirections. To get the integral right, it is essential to use unit-length eigenvectors. This code shows a discrete version of the sweep, to help you visualize it:
m = {{2, 1}, {1, 3}}; (* Matrix *)
c = {3, 5}; (* Center *)
ev = Sqrt[Eigenvalues[m]]; (* Semi-axes *)
evec = Eigenvectors[m]; (* Principal directions, unnormalized *)
evec = DiagonalMatrix[1/Norm[#] & /@ evec].evec; (* Unit eigenvectors *)
With[{k = 20},
ListPlot[Flatten[
Table[c + {s, t}.evec,
{s, -ev[[1]], ev[[1]], ev[[1]]/k},
{t, -ev[[2]] Sqrt[1 - s^2 / ev[[1]]^2], ev[[2]] Sqrt[1 - s^2 / ev[[1]]^2],
ev[[2]]/k }
], 1],
AspectRatio -> Sqrt[ev[[1]] / ev[[2]]], AxesOrigin -> {1.5, 3},
PlotStyle -> Gray,
Epilog -> {PointSize[0.02], Point[c], Thick, Darker[Red],
Arrow[{c, c + {ev[[1]], 0}.evec}], Darker[Blue],
Arrow[{c, c + {0, ev[[2]]}.evec}]}]
]
This draws the first axis in red and the second in blue, each to the tip of the ellipse, on top of the dots created by the double-sweep across the eigendirections:

Integration is done in a similar fashion. Here's the area of the ellipse:
cnst = NIntegrate[1, {s, -ev[[1]], ev[[1]]},
{t, -ev[[2]] Sqrt[1 - s^2/ev[[1]]^2], ev[[2]] Sqrt[1 - s^2/ev[[1]]^2]}]
It returns 7.02481, equal to $\sqrt{5}\pi$, as it should (the determinant of m
is $5$).
As a further check we can recover the ellipse parameters from its first two moments. E.g.,
Clear[f];
f[x_, {p_, q_}] := x[[1]]^p x[[2]]^q; (* For the (p,q) moment *)
ParallelTable[
NIntegrate[
f[c + {s, t}.evec, pq],
{s, -ev[[1]], ev[[1]]},
{t, -ev[[2]] Sqrt[1 - s^2 / ev[[1]]^2], ev[[2]] Sqrt[1 - s^2 / ev[[1]]^2] }
] / cnst,
{pq, {{1, 0}, {0, 1}}}]
This returns the center, {3., 5.}
, as it should.
ParallelTable[
4 NIntegrate[
f[{s, t}.evec, pq],
{s, -ev[[1]], ev[[1]]},
{t, -ev[[2]] Sqrt[1 - s^2 / ev[[1]]^2], ev[[2]] Sqrt[1 - s^2 / ev[[1]]^2] }
] / cnst,
{pq, {{2, 0}, {1, 1}, {0, 2}}}]
These three central second moments (scaled up by 4) ought to return the coefficients of the matrix m
. Indeed, the result is {2., 1., 3.}
, exactly as expected. The visualization and these checks should give you confidence that this technique is correct.