# Help with double integration

Posted 10 years ago
3130 Views
|
2 Replies
|
3 Total Likes
|
 I'm trying to integrate this using double integrals:Integrate [(1)/(sqrt(1-x^2-y^2))*exp((-(a-x)^2-(b-y)^2)*(mu^2/2)), {x,-Infinity, Infinity} ,{y,-Infinity, Infinity}]Mathematica keeps saying that the integration isn't valid becauseĀ Integrate::ilim: "Invalid integration variable or limit(s) in {-\[Infinity],0,2}."Infinity::indet: "Indeterminate expression 0\ exp\ (-\[Infinity])\ Sign[c]^2 encountered."I want to integrate this expression (which is the product of a 2 dimensional Gaussian function and the surface area element of a sphere with respect to x and y). I also want the final expression to be left in terms of a, b, and mu, which are parameters in this case. How do I do this?
2 Replies
Sort By:
Posted 10 years ago
 Since double integration can be broken up to doing integration once w.r.t "x" and then integrate the result again with respect to the second variable "y", there is a direct way to see where the hard spot in this. It comes down to this formintegrand = 1/Sqrt[1 - x^2] Exp[(-(a - x)^2)];This has pole at when a=1. Assuming a!=1 does not help, since integrand is complexAssuming[a != 1, Integrate[1/Sqrt[1 - x^2] Exp[(-(a - x)^2)], {x, 0, Infinity}]]For example1/Sqrt[1 - x^2] Exp[(-(a - x)^2)] /. {a -> 2, x -> 3}//Ngives0. - 0.130065023755722 IBut NIntegrate works (for some numerical value of the parameters)ClearAll[a, x];NIntegrate[1/Sqrt[1 - x^2] Exp[(-(2 - x)^2)], {x, 0, Infinity}](*0.301179596024786 - 1.19177370812431 I*)So in summary the problem is this:integrand = 1/Sqrt[1 - x^2] Exp[(-(a - x)^2)];producing comlplex integrand and also a pole at a=1
Posted 10 years ago
 I am not sure what is causing the error messages, but it is most likely related to a value you previously defined that you are using within Integrate in a way that violates the function's syntax. Please try restarting Mathematica to begin with.The first step is to make sure you are using Mathematica's syntax. In Mathematica, built-in functions are capitalized and wrap their arguments in square brackets. So the integral can be written out as:Integrate[(1)/(Sqrt[1 - x^2 - y^2])*  Exp[(-(a - x)^2 - (b - y)^2)*(mu^2/2)], {x, -Infinity,   Infinity}, {y, -Infinity, Infinity}]This integral appears to be difficult to solve for generic values of a, b, and mu. You can use the Assuming expression to give Mathematica assumptions about the values of those parameters. For example, we could assume that they are Real numbers:Assuming[Element[{a, b, mu}, Reals], Integrate[(1)/(Sqrt[1 - x^2 - y^2])*   Exp[(-(a - x)^2 - (b - y)^2)*(mu^2/2)], {x, -Infinity,    Infinity}, {y, -Infinity, Infinity}] ]Mathematica takes a while with this expression and hasn't produced a solution for me yet. It is possible that it may not find a symbolic solution or that a symbolic solution doesn't exist. If that is the case, then this problem has to be evaluted numerically.