How to integrate a function using the trapezoid rule ?
Info
This question is closed. Reopen it to edit or answer.
Show older comments

Create a MATLAB script to integrate the given function using the numerical scheme called Trapezoid’s Rule. a. f(x)= xe^x + 3x^2 − 2x -1 and find for with h = 0.1, 0.01 and 0.001
Now I know how to do this when it's a definite integral on a certain interval or am given a table of values but how do I go about doing this since it's an indefinite integral ? I know the general formula for the trapezoid rule (given in the image) but again it seems to be only valid with given points. Using trapz function doesn't seam to be helpful here. How do I go about doing this ?
1 Comment
John D'Errico
on 19 Feb 2017
I will only point out that this is not indeed an indefinite integral. Note the existence of limits on the integral. That makes it a definite integral.
Answers (0)
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!