# `int_0^(pi/2)cos^4 (x)dx, n = 4` Use the Midpoint Rule with the given value of `n` to approximate the integral. Round the answer to four decimal places.

*print*Print*list*Cite

You need to use the midpoint rule to approximate the interval. First, you need to find `Delta x,` such that:

`Delta x = (b-a)/n`

The problem provides `b=pi/2` , a=0 and n = 4, such that:

`Delta x = (pi/2-0)/4 = pi/8`

Hence, the following 4 intervals of length `pi/8` are: `[0,pi/8], [pi/8,pi/4], [pi/4,(3pi)/8], [(3pi)/8,pi/2].`

Now, you may evaluate the integral such that:

`int_0^pi/2 cos^4 x dx = Delta x(f((0+pi/8)/2) + f((pi/8+pi/4)/2) + f((pi/4+(3pi)/8)/2) + f(((3pi)/8+pi/2)/2))`

`int_0^pi/2 cos^4 x dx = pi/8(f(pi/16) + f(3pi/16) + f(5pi/16) + f(7pi/16))`

`int_0^pi/2 cos^4 x dx = pi/8(cos^4(pi/16) + cos^4 (3pi/16)+ cos^4(5pi/16) + cos^4(7pi/16)))`

`cos(pi/8) = cos((pi/4)/2) => cos^2((pi/4)/2) = (1 + cos(pi/4))/2 => cos^4((pi/4)/2) = ((1 + cos(pi/4))^2)/4`

`cos^4((pi/4)/2) = ((1 + sqrt2/2)^2)/4`

`cos^4((pi/4)/2) = ((2 + sqrt2)^2)/16`

`cos(pi/16) = cos((pi/8)/2) => cos^2((pi/8)/2) = (1 + sqrt((1 + sqrt2/2)/2))/2`

`cos^4(pi/16) =(0.9619)^2 = 0.6637`

`cos(3pi/16) = -cos(pi/16) => cos^4(3pi/16) = cos^4(pi/16) = 0.6637`

`cos(5pi/16) = -cos(pi/16) => cos^4(3pi/16) = cos^4(pi/16) = 0.6637`

`cos(7pi/16) = -cos(3pi/16) = -(-cos(pi/16) ) => cos^4(7pi/16) = cos^4(pi/16) = 0.6637`

`int_0^pi/2 cos^4 x dx = pi/8( 0.6637 + 0.6637 + 0.6637 + 0.6637)`

`int_0^pi/2 cos^4 x dx = 4*pi/8(0.6637)`

`int_0^pi/2 cos^4 x dx = pi/2*(0.6637)`

`int_0^pi/2 cos^4 x dx = 0.3318*pi`

**Hence, approximating the definite integral, using the midpoint rule, yields `int_0^pi/2 cos^4 x dx = 0.3318*pi.` **