double integral in R

Let me start with the code and then step through to explain it. InnerFunc = function(x) { x + 0.805 } InnerIntegral = function(y) { sapply(y, function(z) { integrate(InnerFunc, 15, z)$value }) } integrate(InnerIntegral , 15, 50) 16826.4 with absolute error < 1.9e-10 The first line is very easy. We just need the function f(x) … Read more