I am using Integrate
function to do the following double integral
Integrate[3.1 x^2.1 Exp[-y^2/2]/(2 π)^0.5, {y, -1, 3}, {x, 0, y + 35}]
The result is 1204.63.
When I check with the following integral
N[Integrate[Integrate[3.1 x^2.1, {x, 0, y + 35}, Assumptions :> y ∈ Reals]*
Exp[-y^2/2]/(2 π)^0.5, {y, -1, 3}]]
The result is 52774.4, which also agrees with what I got in Matlab. I thought the first one is a nice and clean way to do double integral than the second one, but it seems that the result is not what I want if the function w.r.t. x (x^2.1
in this case) does not have integer power.
I would be very thankful if anyone can answer my question.
NIntegrate[3.1 x^2.1 Exp[-y^2/2]/(2 \[Pi])^0.5, {y, -1, 3}, {x, 0, y + 35}]
is perhaps a nice compromise.Integrate
is primarily for exact computation. It tries with inexact input, but in this case fails. Note that, with exact input,N@Integrate[31/10 x^(21/10) Exp[-y^2/2]/(2 \[Pi])^(1/2), {y, -1, 3}, {x, 0, y + 35}]
also gives the right answer. $\endgroup$Integrate
. It's not clear whether you want an explanation or other workarounds or what. $\endgroup$Integrate
toNIntegrate
. It seems that the machine precision values in your expression make it impossible to get the correct answer symbolically when posed in this way. $\endgroup$