# How do you use the trapezoid rule for int 2 sin x^2 dx from x = 0 to x = 1/2 with n = 4?

Jun 19, 2015

${\int}_{0}^{\frac{1}{2}} 2 \sin {x}^{2} \mathrm{dx} \approx {T}_{4} \approx 0.114489$

#### Explanation:

First of all let's calculate 4 sub-intervals of [0,1/2]:
$\left[0 , \frac{1}{8}\right] , \left[\frac{1}{8} , \frac{1}{4}\right] , \left[\frac{1}{4} , \frac{3}{8}\right] , \left[\frac{3}{8} , \frac{1}{2}\right]$

Now, let's apply the trapezoidal rule to these interval:
${T}_{4} = \left[2 \sin {0}^{2} + 2 \cdot 2 \sin {\left(\frac{1}{8}\right)}^{2} + 2 \cdot 2 \sin {\left(\frac{1}{4}\right)}^{2} + 2 \cdot 2 \sin {\left(\frac{3}{8}\right)}^{2} + 2 \sin {\left(\frac{1}{2}\right)}^{2}\right] \cdot \left(\frac{\frac{1}{2} - 0}{8}\right)$

${T}_{4} = \left[2 \cdot 0 + 4 \sin \left(\frac{1}{64}\right) + 4 \sin \left(\frac{1}{16}\right) + 4 \sin \left(\frac{9}{64}\right) + 2 \sin \left(\frac{1}{4}\right)\right] \cdot \frac{1}{16}$

${T}_{4} \approx \left[0.062497 + 0.249837 + 0.560647 + 0.958851\right] \cdot \frac{1}{16}$

${T}_{4} \approx \left[1.831832\right] \cdot \frac{1}{16} = 0.114489$