To find the value of the integral
I=∫−π/2π/2(x2+lnπ−xπ+x)cosxdx
we can split the integrand into two separate terms:
I=∫−π/2π/2x2cosxdx+∫−π/2π/2ln(π−xπ+x)cosxdx
Let us define:
I1=∫−π/2π/2x2cosxdx
I2=∫−π/2π/2ln(π−xπ+x)cosxdx
Step 1: Evaluate I2
Let f(x)=ln(π−xπ+x)cosx. Evaluating f(−x):
f(−x)=ln(π+xπ−x)cos(−x)=ln(π−xπ+x)−1cosx=−ln(π−xπ+x)cosx=−f(x)
Since f(x) is an odd function and the limits of integration are symmetric about zero, the value of the integral is zero:
I2=0
Step 2: Evaluate I1
Let g(x)=x2cosx. Evaluating g(−x):
g(−x)=(−x)2cos(−x)=x2cosx=g(x)
Since g(x) is an even function, we can rewrite I1 as:
I1=2∫0π/2x2cosxdx
Using integration by parts (∫udv=uv−∫vdu):
Let u=x2⟹du=2xdx and dv=cosxdx⟹v=sinx.
∫x2cosxdx=x2sinx−2∫xsinxdx
Applying integration by parts again to ∫xsinxdx:
Let u=x⟹du=dx and dv=sinxdx⟹v=−cosx.
∫xsinxdx=−xcosx−∫(−cosx)dx=−xcosx+sinx
Substituting this back into the expression for the indefinite integral:
∫x2cosxdx=x2sinx−2(−xcosx+sinx)=x2sinx+2xcosx−2sinx
Now, applying the limits from 0 to 2π:
∫0π/2x2cosxdx=[x2sinx+2xcosx−2sinx]0π/2
Evaluating at the upper limit x=2π:
(2π)2sin(2π)+2(2π)cos(2π)−2sin(2π)=4π2(1)+π(0)−2(1)=4π2−2
Evaluating at the lower limit x=0:
02sin(0)+2(0)cos(0)−2sin(0)=0
Thus,
I1=2(4π2−2)=2π2−4
Step 3: Calculate the total integral I
I=I1+I2=(2π2−4)+0=2π2−4
Hence, the correct option is B.