Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Composite Trapezoidal Rule Help

  1. Aug 20, 2008 #1
    Hey guys,

    Im a bit baffled on this one.

    I have been told to perform the following integration:
    [tex]\int y dx[/tex] from -1 to 14. I have been given some values of x and the corresponding values of y.

    I just have one question, the fact that it is y dx is throwing me off. The trapazoidal rule is: I = h* [f(x1)-f(x2)]/2. This is probably really simple and a dumb question, but I assume that f(x1) corresponds to the value of y that I have been given for x1?
  2. jcsd
  3. Aug 20, 2008 #2


    User Avatar
    Science Advisor

    Yes, that is what the standard notation y= f(x) means. Now I notice that you title this "composite" trapezoidal rule. The trapezoidal rule you give is for just two points: one trapezoid. If you are given a number of x and y values, you will want to do a different trapezoid for each pair of points, the "right" side of one trapezoid being the "left" side of the other. If, for example, you had 3 points (x1,y1), (x2,y2),(x3,y3), then the "trapezoid" between x1 and x2 has area (y2- y1)/2(x2-x1) and the "trapezoid" between x2 and x3 has area (y3- y2)/2(x3-x2). The total area, of course, would be the sum of those.
  4. Aug 20, 2008 #3


    User Avatar
    Science Advisor
    Homework Helper

    Hi VooDoo! :smile:

    Yes, y is a function of x, just like any old f, but we don't normally write y(x), so you have to imagine the "(x)" :wink:

    So f(x1) = y(x1) = the value of y at x = x1. :smile:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook