After solving many issues with the below integral, I still need some help to get to a proper solution. I tried to reduce the complexity as much as possible, thanks for your help.
Lets take this example:
b <- function(t) { # variable upper bound
if (t<0) t
else 0
}
Doubleintegral:
f<-function(g,t){
exp(75*g)*
exp(-35*t-((-t + 0.001283464)^2)/0.0001468898)
}
result <- (integrate(Vectorize(function(t) integrate(function(g) f(g,t), -2.5,b(t))$value), -2, 2, stop.on.error=FALSE)$value)
This gives me:
> (integrate(Vectorize(function(t) integrate(function(g) f(g,t), -2.5,b(t))$value), -2, 2, stop.on.error=FALSE)$value)
[1] 0.0002256195
While Wolfram Alpha gives me only 0.00012.. Link to Wolfram
I checked the function in Wolfram and it is the same as here. Does someone has a solution to solve this problem? thank you very much!