Trapezoidal Rule , number of segments

  • B
  • Thread starter omar yahia
  • Start date
In summary, the trapezoidal rule can be used to calculate the area under a curve using a number of segments that is not an integer.
  • #1
omar yahia
9
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
  • #2
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 omar yahia
  • #3
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 :)
 
  • #4
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?
 

Related to Trapezoidal Rule , number of segments

1. What is the Trapezoidal Rule?

The Trapezoidal Rule is a numerical method used to estimate the area under a curve by dividing it into trapezoids and calculating their individual areas. It is commonly used in mathematical and scientific fields to approximate the integral of a function.

2. How does the Trapezoidal Rule work?

The Trapezoidal Rule works by approximating the curve with a series of trapezoids, calculating the area of each trapezoid, and then summing up all the individual areas to estimate the total area under the curve. The more trapezoids used, the more accurate the estimation will be.

3. What is the importance of the number of segments in the Trapezoidal Rule?

The number of segments used in the Trapezoidal Rule is important because it directly affects the accuracy of the estimated area under the curve. As the number of segments increases, the estimated area becomes closer to the actual area.

4. How do you determine the number of segments to use in the Trapezoidal Rule?

The number of segments to use in the Trapezoidal Rule depends on the desired level of accuracy. Generally, a larger number of segments will result in a more accurate estimation, but it also requires more computational resources. It is important to find a balance between accuracy and computational efficiency when determining the number of segments to use.

5. Can the Trapezoidal Rule be used to approximate the area under any curve?

The Trapezoidal Rule can be used to approximate the area under any continuous curve. However, the accuracy of the estimation may vary depending on the shape of the curve and the number of segments used. In some cases, other numerical methods may be more suitable for calculating the area under a particular curve.

Similar threads

Replies
4
Views
1K
Replies
4
Views
2K
  • Calculus
Replies
12
Views
2K
Replies
16
Views
3K
Replies
1
Views
1K
Replies
1
Views
1K
Back
Top