Is any way in Matlab to perform definite integral with conditions in the integration domain?
Show older comments
Basic example;
f(x)= x^2+3*x for x<100 f(x)=x^3 for x>100; a=10; b=200;
d=integral(f(x), a, b)
Note: this is a basic example, I know for something like the equation above with the int function in symbolic tool box can be resolve easily doing two independent indefinite integrals and then transforms its results in functions and then evaluate those functions (one function in the interval a the other function in the interval b) to obtain the result. However the equation I’m working is very complex, and when I try to find its indefinite integral with the int function, I'm receiving the following warning error " the explicit integral can't been found". For that reason I’m trying to figure out if the integral function could work having some limitation in the integration domain.
I will appreciate whatever help that can point me out to resolve this issue. Thanks
Accepted Answer
More Answers (1)
Wayne King
on 27 Jan 2014
Edited: Wayne King
on 27 Jan 2014
Using integral()
integral(@(x) x.^2+3*x,10,100)
integral(@(x) x.^3,100,200)
You just integrate your first function from 10 to 100 since it is defined for x<100. x^2+3*x
Integrate the second function from 100 to 200 because it is defined for x>100, x^3
1 Comment
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!