Open Book Publishers logo Open Access logo
  • button
  • button
  • button
GO TO...
book cover

Problem 41:  Integrating the modulus function ( ) 2000 Paper I

Show that

11|xex|dx = 10xexdx +01xexdx

and hence evaluate the integral.

Evaluate the following integrals:

04|x3 2x2 x + 2|dx;
ππ|sinx + cosx|dx.


The very first part shows you how to do this sort of integral (with mod signs in the integrand) by splitting up the range of integration at the points where the integrand changes sign. In parts (i) and (ii) you have to use the technique on different examples.

Solution to problem 41

For the first part, note that |xex| = xex if x < 0. Then integrate by parts to evaluate the integrals:

10(xex)dx +01xexdx = xex 10 10exdx + xex 01 01exdx = 2 2e1.

For the next parts, we have to find out where the integrand is positive and where it is negative.

(i) x3 2x2 x + 2 = (x 1)(x + 1)(x 2) (spotting the factors), so the integrand is positive for 0 x < 1, negative for 1 < x < 2 and positive for 2 < x < 4 (a quick sketch will help with this). Splitting the range of integration into these ranges and integrating gives

04x3 2x2 x + 2dx () =01(x3 2x2 x + 2)dx 12(x3 2x2 x + 2)dx +24(x3 2x2 x + 2)dx (3) = 221 6.

(ii) sinx + cosx changes sign when tanx = 1, i.e. when x = 1 4π and x = 3 4π. Splitting the range of integration into these ranges and integrating gives

ππ sinx + cosxdx =π1 4 π (sinx + cosx)dx +π43 4 π(sinx + cosx)dx +3 4 ππ (sinx + cosx)dx = cosx sinxπ1 4 π + cosx + sinx1 4 π3 4 π + + cosx sinx3 4 ππ = 42

Alternatively, start by writing sinx + cosx = 2cos(x 1 4π) which makes the changes of sign easier to spot and the integrals easier to do.


If you give a bit more thought to part (ii), you will see easier ways of doing it. Since the trigonometric functions are periodic with period 2π the integrand is also periodic. Write the integrand in the form 2cos(x 1 4π). Integrating this over any 2π interval gives the same result. Indeed, we may as well integrate 2sinx from 0 to 2π; or from 0 to π and double the answer.

After the first edition of this book appeared, a correspondent e-mailed to suggest that we should integrate () by writing it in the form

04(x3 2x2 x + 2)dx 212(x3 2x2 x + 2)dx.

Yes, that’s quite a good idea; it would have saved a bit of writing and reduced the risk of arithmetical errors.