MATLAB: Is that possible to take numerical integration over a semi-definite integral

integrationnumerical integration

Suppose one is going to calculate an integral over, say, [s, 5]. Although s is regarded a constant for a moment, but later one has to take another integration over s. The function inside the integral is very complicated and so one will have to use numerical techniques. In sum, I need a function of variable s from the second integral, so I can take another integral over it. But, as I know, numerical integration makes sense when the limits are numbers, but here I have a parameter (s).

Best Answer

If a symbolic solution cannot be found for the inner integral, you can use the matlab function ‘integral2’ for your task. If you read the instructions for it at:
https://www.mathworks.com/help/matlab/ref/integral2.html,
you will see that it allows the inner integral limits to be functions of the outer variable rather than fixed numerical values - in your case the lower inner limit is s itself. Hence, even though your integrand is a function only of s’, it should still arrive at a solution for the double integral.
Related Question