# Trap Rule for sin(x)

Use the trapezoidal rule with $N=6$ to approximate the arc length of the curve $f(x) = \sin(x)$ from $x=0$ to $x=\pi$.

So I found that $\Delta x = \frac{\pi}{6}$ which means that my interval points are $0,\frac{\pi}{3}, \frac{\pi}{2}, \frac{2\pi}{3}, \frac{5\pi}{6}$ and $\pi$.

Is that right?

And then after that I just use the trap rule forumula computing the value of $\sin$ of all my interval points.

Is my thinking correct?

The formula for step size is given by:

$$\displaystyle h = \frac{b-a}{N} = \frac{\pi - 0}{6} = \frac{\pi}{6}$$

We are also given that $x_0 = 0$.

• So i have to keep it with a denominator of 6? – user71317 May 16 '13 at 15:44
• @user71317, yes, the steps are $0, \pi/6, 2\pi/6 ... 6\pi/6$ Recall, you will go from $x_0 ... x_6$. – Amzoti May 16 '13 at 15:49
• Amzoti: arc length $\neq$ area below; see other answer! – Sharkos May 16 '13 at 16:33
• @Sharkos: Oops - thx! Updated – Amzoti May 16 '13 at 16:40
• $\large +1 \quad \ddot\smile^{\ddot\smile}\overset{\therefore}{\therefore \because\therefore}$ – Namaste May 17 '13 at 0:29

Well your going after arc length here so you either wanna switch sin(x) to sqrt(1 + cos(x)^2)

Since dLength^2 = dx^2 + dy^2

Or:

You can keep in mind it is the length of the top sides of your trapezoids, Not their area, that you want to sum up.

Besides that you should be good to go.

• Oh and your step size is wrong... You need to divide the length of the interval (pi - 0) by 6 (the N value) to get a step of pi/6 and now your end points are 0, pi/6, 2pi/6.... All the way to pi – frogeyedpeas May 16 '13 at 15:25
• how come i would have to switch the sin(x)? – user71317 May 16 '13 at 15:44
• Well basically the thing is that just plain old Integration computes area. You don't want area. You want arclength. – frogeyedpeas May 17 '13 at 4:21
• You have 2 options with not necessarily equal outcomes. You can switch the sin for a function whose area is equal to sin's arclength... Which I named above. Or you can use the top length of the trapezoids, in my opinion easier – frogeyedpeas May 17 '13 at 4:23
• would the top length of the trapezoids just be the intervals that i found? – user71317 May 17 '13 at 5:39