numerical double integration symbolically and numerically

2 views (last 30 days)
Hi,
I am trying to evaluate a double integral Int1 Int2 f(x,t) dt dx. I want to evaluate the t-integral symbolically and the x-integral numerically.
Any suggestion how to implement.
thanks

Answers (2)

Roger Stafford
Roger Stafford on 9 Aug 2014
Edited: Roger Stafford on 9 Aug 2014
The part of what you propose, R yan, that is not certain of success is whether matlab can succeed in finding a symbolic expression for the inner integral, int(f(x,t),t). That is anything but certain. Many functions cause 'int' to fail to find an explicit solution.
If it does find an explicit solution, that solution will depend only on x provided you have given limits of integration to the variable t, so it should be possible to do numerical integration with it provided there are no problems of singularities or divergence.
However, matlab does have functions that can compute double integrals numerically, in case your inner integration fails symbolically.

Star Strider
Star Strider on 9 Aug 2014
It depends on the function and would only work if you can eliminate t in the symbolic integration, so that the resulting function is only a function of x, and a relatively uncomplicated one at that.
Then use matlabFunction to create an anonymous function from that result as a function of x and do the numerical integration with integral.
It’s possible, but no promises that it will be successful.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!