Respuesta :
Split up the integration interval into 4 subintervals:
[tex]\left[0,\dfrac\pi8\right],\left[\dfrac\pi8,\dfrac\pi4\right],\left[\dfrac\pi4,\dfrac{3\pi}8\right],\left[\dfrac{3\pi}8,\dfrac\pi2\right][/tex]
The left and right endpoints of the [tex]i[/tex]-th subinterval, respectively, are
[tex]\ell_i=\dfrac{i-1}4\left(\dfrac\pi2-0\right)=\dfrac{(i-1)\pi}8[/tex]
[tex]r_i=\dfrac i4\left(\dfrac\pi2-0\right)=\dfrac{i\pi}8[/tex]
for [tex]1\le i\le4[/tex], and the respective midpoints are
[tex]m_i=\dfrac{\ell_i+r_i}2=\dfrac{(2i-1)\pi}8[/tex]
- Trapezoidal rule
We approximate the (signed) area under the curve over each subinterval by
[tex]T_i=\dfrac{f(\ell_i)+f(r_i)}2(\ell_i-r_i)[/tex]
so that
[tex]\displaystyle\int_0^{\pi/2}\frac3{1+\cos x}\,\mathrm dx\approx\sum_{i=1}^4T_i\approx\boxed{3.038078}[/tex]
- Midpoint rule
We approximate the area for each subinterval by
[tex]M_i=f(m_i)(\ell_i-r_i)[/tex]
so that
[tex]\displaystyle\int_0^{\pi/2}\frac3{1+\cos x}\,\mathrm dx\approx\sum_{i=1}^4M_i\approx\boxed{2.981137}[/tex]
- Simpson's rule
We first interpolate the integrand over each subinterval by a quadratic polynomial [tex]p_i(x)[/tex], where
[tex]p_i(x)=f(\ell_i)\dfrac{(x-m_i)(x-r_i)}{(\ell_i-m_i)(\ell_i-r_i)}+f(m)\dfrac{(x-\ell_i)(x-r_i)}{(m_i-\ell_i)(m_i-r_i)}+f(r_i)\dfrac{(x-\ell_i)(x-m_i)}{(r_i-\ell_i)(r_i-m_i)}[/tex]
so that
[tex]\displaystyle\int_0^{\pi/2}\frac3{1+\cos x}\,\mathrm dx\approx\sum_{i=1}^4\int_{\ell_i}^{r_i}p_i(x)\,\mathrm dx[/tex]
It so happens that the integral of [tex]p_i(x)[/tex] reduces nicely to the form you're probably more familiar with,
[tex]S_i=\displaystyle\int_{\ell_i}^{r_i}p_i(x)\,\mathrm dx=\frac{r_i-\ell_i}6(f(\ell_i)+4f(m_i)+f(r_i))[/tex]
Then the integral is approximately
[tex]\displaystyle\int_0^{\pi/2}\frac3{1+\cos x}\,\mathrm dx\approx\sum_{i=1}^4S_i\approx\boxed{3.000117}[/tex]
Compare these to the actual value of the integral, 3. I've included plots of the approximations below.


