What would be the most kosher way to evaluate an integral like this in Mathematica: $$\int_\mathbb{R^3} \exp\left((x-b)^tA(x-b)\right)dx \ ?$$ Here $A$ is a real symmetric matrix and $b$ some vector in $\mathbb{R^3}$. Should I write everything out in components and integrate the expression $$ \int_{\mathbb{R}}\int_{\mathbb{R}}\int_{\mathbb{R}}\exp \left( \sum_{i=1}^n\sum_{j=1}^n (x_i-b_i)^tA_{i,j}(x_j-b_j)) \right) dx_1dx_2dx_3 \ , $$ or is there a more elegant way to do this by staying in the "vector notation" without writing the sums?
Asked
Active
Viewed 154 times
0
-
But in other words. – user64494 Jun 03 '19 at 15:11
-
2Most elegant way in this case would be to do this integral analytically. Expand brackets, diagonalize by an orthogonal transformation, complete squares etc. – Kagaratsch Jun 03 '19 at 15:13
-
1@Kagaratsch Yes, I know how to do it by hand. But that is not the topic of this site. – Jun 03 '19 at 15:38
1 Answers
1
If you give the integral an explicit matrix, then Integrate can solve it:
A = {{-5,-5,7/2},{0,-10,7/2},{0,0,-3}};
Integrate[Exp[(x-b).A.(x-b)], x ∈ FullRegion[3], Assumptions->b ∈ Vectors[3]]
2 Sqrt[2/805] π^(3/2)
Carl Woll
- 130,679
- 6
- 243
- 355
-
The OP mentioned symmetric matrices and in that case there is a symbolic result. For example:
n = 3; A = Table[a[Min[i, j], Max[i, j]], {i, n}, {j, n}]; Integrate[Exp[x.A.x], x \[Element] FullRegion[n]]as I thinkbcan be anything. – JimB Jun 03 '19 at 16:41