0
$\begingroup$

This question already has an answer here:

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?

$\endgroup$

marked as duplicate by AccidentalFourierTransform, Henrik Schumacher, Daniel Lichtblau, m_goldberg, Thies Heidecke Jun 3 at 15:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ But in other words. $\endgroup$ – user64494 Jun 3 at 15:11
  • 2
    $\begingroup$ Most elegant way in this case would be to do this integral analytically. Expand brackets, diagonalize by an orthogonal transformation, complete squares etc. $\endgroup$ – Kagaratsch Jun 3 at 15:13
  • 1
    $\begingroup$ @Kagaratsch Yes, I know how to do it by hand. But that is not the topic of this site. $\endgroup$ – Jannik Pitt Jun 3 at 15:38
2
$\begingroup$

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)

$\endgroup$
  • $\begingroup$ 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 think b can be anything. $\endgroup$ – JimB Jun 3 at 16:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.