# From 0-2 \sin(x^{2}) dx using trapezoidal rule with n=4 as well

From 0-2 $$\displaystyle{\sin{{\left({x}^{{{2}}}\right)}}}{\left.{d}{x}\right.}$$ using trapezoidal rule with n=4 as well as midpoint rule with n=4

• Questions are typically answered in as fast as 30 minutes

### Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Glenn Cooper

Step 1
Trapezoidal rule
$$\displaystyle={\int_{{{0}}}^{{{2}}}}{{\sin}^{{{2}}}{\left({x}\right)}}\ldots\ldots{\left({1}\right)}$$
As we know that accoding to trapezoidal rule
$$\displaystyle{\int_{{{a}}}^{{{b}}}}{f}{\left({x}\right)}{\left.{d}{x}\right.}\approx{\frac{{\triangle{x}}}{{{2}}}}{\left({f{{\left({x}_{{{0}}}\right)}}}+{2}{f{{\left({x}_{{{1}}}\right)}}}+{2}{f}{\left({x}_{{{2}}}\right)}+\ldots+{2}{f{{\left({x}_{{{n}-{1}}}\right)}}}+{f{{\left({x}_{{{n}}}\right)}}}\ldots{\left({2}\right)}\right.}$$
This is the standard equation for the trapezoidal method in which
$$\displaystyle\triangle{x}={\frac{{{b}-{a}}}{{{n}}}}$$
Now comparing equation (2) with equation (1) we get that
a=0,b=2,n=4
$$\begin{cases}\triangle x=\frac{2-0}{4}=\frac{1}{2}\\ & \end{cases}$$
Now we will divide (0,2) interval into n=4 subinterval of length $$\displaystyle\triangle{x}={\frac{{{1}}}{{{2}}}}$$
end points of the function $\begin{cases}0\\ 0+\frac{1}{2}=\frac{1}{2} & \\ \frac{1}{2}+\frac{1}{2}=1 & \\ 1+\frac{1}{2}=\frac{3}{2} & \\ \frac{3}{2}+\frac{1}{2}=2 & \end{cases}$
Therefore the end points of the function are $$\displaystyle{a}={0},{\frac{{{1}}}{{{2}}}},{1},{\frac{{{3}}}{{{2}}}},{2}$$
U sing these end points we analysis the function
$$\displaystyle{f}{\left({x}_{{{0}}}\right)}={f{{\left({a}\right)}}}={f}{\left({0}\right)}={0}$$
$$\displaystyle{2}{f}{\left({x}_{{{1}}}\right)}={2}{f{{\left({\frac{{{1}}}{{{2}}}}\right)}}}={2}{{\sin}^{{{2}}}{\left({\frac{{{1}}}{{{2}}}}\right)}}={0.459698}$$
$$\displaystyle{2}{f}{\left({x}_{{{2}}}\right)}={2}{f{{\left({1}\right)}}}={2}{{\sin}^{{{2}}}{\left({1}\right)}}={1.416147}$$
$$\displaystyle{2}{f}{\left({x}_{{{3}}}\right)}={2}{f{{\left({\frac{{{3}}}{{{2}}}}\right)}}}={2}{{\sin}^{{{2}}}{\left({\frac{{{3}}}{{{2}}}}\right)}}={1.9899925}$$
$$\displaystyle{f}{\left({x}_{{{4}}}\right)}={f{{\left({b}\right)}}}={f}{\left({2}\right)}={{\sin}^{{{2}}}{\left({2}\right)}}={0.0826819}$$
Substitute these value in equation (2) we get that
$$\displaystyle={\frac{{{1}}}{{{4}}}}{\left[{0}+{0.459698}+{1.416147}+{1.9899925}+{0.0826819}\right]}$$
$$\displaystyle={1.173165646}\approx{1.1737}$$
Step 2
By midpoint rule
$$\displaystyle={\int_{{{0}}}^{{{2}}}}{{\sin}^{{{2}}}{\left({x}\right)}}\ldots.{\left({1}\right)}$$
According to mid point rule we know that
$$\displaystyle{\int_{{{a}}}^{{{b}}}}{f}{\left({x}\right)}{\left.{d}{x}\right.}\approx\triangle{x}{\left({f}{\left({\frac{{{x}_{{{0}}}+{x}_{{{1}}}}}{{{2}}}}\right)}+{f}{\left({\frac{{{x}_{{{1}}}+{x}_{{{2}}}}}{{{2}}}}\right)}+{f}{\left({\frac{{{x}_{{{2}}}+{x}_{{{3}}}}}{{{2}}}}\right)}+\ldots.+{f}{\left({\frac{{{x}_{{{n}-{1}}}+{x}_{{{n}}}}}{{{2}}}}\right)}\right)}$$
$$\displaystyle\triangle{x}={\frac{{{1}}}{{{2}}}}$$
End points are $$\displaystyle={0},{\frac{{{1}}}{{{2}}}},{1},{\frac{{{3}}}{{{2}}}},{2}$$
Now calculate for these values
$$\displaystyle{f}{\left({\frac{{{x}_{{{0}}}+{x}_{{{1}}}}}{{{2}}}}\right)}={f}{\left({\frac{{{0}+{\frac{{{1}}}{{{2}}}}}}{{{2}}}}\right)}={f}{\left({\frac{{{1}}}{{{4}}}}\right)}={{\sin}^{{{2}}}{\left({\frac{{{1}}}{{{4}}}}\right)}}={0.0612088}$$
similarly calculate for other
$$\displaystyle{f}{\left({\frac{{{x}_{{{1}}}+{x}_{{{2}}}}}{{{2}}}}\right)}={0.464642}$$
$$\displaystyle{f}{\left({\frac{{{x}_{{{2}}}+{x}_{{{3}}}}}{{{2}}}}\right)}={0.900579}$$
$$\displaystyle{f}{\left({\frac{{{x}_{{{3}}}+{x}_{{{4}}}}}{{{2}}}}\right)}={0.968229}$$
Substitute all these value in equation (2) we get that
$$\displaystyle={\frac{{{1}}}{{{2}}}}{\left[{0.0612088}+{0.464642}+{0.900579}+{0.968229}\right]}$$
=1.18764201