Trapezoidal Rule , number of segments

  • Context: High School 
  • Thread starter Thread starter omar yahia
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the application of the trapezoidal rule in numerical integration, specifically addressing the use of non-integer segments when calculating the area under a curve. Participants explore the implications of using a non-integer number of segments and how to define points in such cases.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant questions whether it is acceptable to use a non-integer number of segments (n=2.5) in the trapezoidal rule, given a specific step size (h=0.4) and integration limits (1 to 2).
  • Another participant expresses that using a non-integer number of segments is not commonly recommended and suggests possible points for the trapezoidal rule if one were to proceed with n=2.5.
  • There is a suggestion that the original problem may have contained a typo, proposing that a different step size (h=0.04 or h=0.25) might have been intended.
  • A further contribution clarifies that knowing the step size (Δx) allows for the calculation of the area without needing to determine n, and explains the process of applying the trapezoidal rule with defined points.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the appropriateness of using a non-integer number of segments in the trapezoidal rule. While some suggest it is not recommended, others explore how it might be implemented, indicating a lack of agreement on the issue.

Contextual Notes

There are unresolved assumptions regarding the acceptance of non-integer segments in numerical integration and the implications of defining function values outside the specified interval.

omar yahia
Messages
9
Reaction score
0
in the trapezoidal rule
is it ok to use a number of segments that is not integer ?

i ask this because in an exam i had , i was asked to use a step of h=0.4
and the interval was from x=1 to x=2
and you know that ," h " is the step ," n " is the number of segments , "a" and "b" are the limits of the integration , so ,
h=(b-a)/n
0.4=1/n
n=2.5 ??! is this ok ?
when i was dealing with "n"=integer , i was able to say that the number of points are n+1
for example
when n=2 segments ------> i have 3 points , x1 ,x2 ,x3
but now with n=2.5 , what are my points ??
thanks
 
Physics news on Phys.org
I have not heard of anybody doing this before and it is not normally recommended.
I suppose you could try to do it with ##x_1 = 1, x_2 = 1.4, x_3 = 1.8, x_4 = 2.2##, and simply define your function to be zero outside your interval 1<x< 2.
If you wanted to spread out the error, you could even go to ##x_1 = .9, x_2 = 1.3, x_3 = 1.7, x_4 = 2.1##.

Most likely, it was a typo. Maybe h = .04 or h = .25 was what they were thinking.
 
  • Like
Likes   Reactions: omar yahia
RUber said:
I have not heard of anybody doing this before and it is not normally recommended.
I suppose you could try to do it with ##x_1 = 1, x_2 = 1.4, x_3 = 1.8, x_4 = 2.2##, and simply define your function to be zero outside your interval 1<x< 2.
If you wanted to spread out the error, you could even go to ##x_1 = .9, x_2 = 1.3, x_3 = 1.7, x_4 = 2.1##.

Most likely, it was a typo. Maybe h = .04 or h = .25 was what they were thinking.

indeed , it is probably a typo , i think i'll just skip it
i appreciate it that you replied , thank you :)
 
If you have the Δx, or as you put it, the "step" you don't need "n" to calculate the area using the trapezoidal rule.
in short, Δx=(b-a)/n.
The trapezoidal rule is as follows
Δx[½f(x0)+f(x1)+f(x2)+...+f(xn-1)+½f(xn)] ; where 0, 1, 2, n-1, n are subscripts of x (I just don't know how to use LaTeX). Where your first term, (x0) is your "a" value in the interval (a,b). The next term (x1) is a+Δx. The next term (x2) is (x1)+Δx. The next term (x3) is (x2)+Δx.
Essentially, you just keep adding your Δx, or as you put it, "step" until (xn) equals "b" in the interval (a,b).
Now follow the trapezoidal rule and plug all these "x" values into the function, making sure to multiply the first and last terms in the trapezoidal rule by ½.
Don't forget to multiply your summation by Δx (as stated by the rule)

Did this help?
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 24 ·
Replies
24
Views
6K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K