Class 12 Maths, Worked in Full Past papersGet updates
Chapter 7 · Integrals

Exercise 7.8 · Q20: ∫01(xex+sin⁡πx4)dx\int_0^1\left(x e^x + \sin\frac{\pi x}{4}\right)dx

Exercise 7.8Fundamental theorem of calculus · Section 7.8
The question

Evaluate the definite integral

∫01(x ex+sin⁡πx4)dx.\int_0^1\left(x\,e^x + \sin\frac{\pi x}{4}\right)dx.
Exam answer

Let I=∫01(x ex+sin⁡πx4)dxI = \displaystyle\int_0^1\left(x\,e^x + \sin\frac{\pi x}{4}\right)dx⁠.

Integrating by parts (xx as the first function),

∫x ex dx=x ex−∫1⋅ex dx=x ex−ex\begin{aligned} \int x\,e^x\,dx &= x\,e^x - \int 1\cdot e^x\,dx \\ &= x\,e^x - e^x \end{aligned}

Also ∫sin⁡πx4 dx=−4πcos⁡πx4\displaystyle\int\sin\frac{\pi x}{4}\,dx = -\frac{4}{\pi}\cos\frac{\pi x}{4}⁠.

∴ I=[x ex−ex]01−4π[cos⁡πx4]01=(e−e)−(0−1)−4π(12−1)\begin{aligned} \therefore\ I &= \Big[x\,e^x - e^x\Big]_0^1 \\ &\quad - \frac{4}{\pi}\Big[\cos\frac{\pi x}{4}\Big]_0^1 \\ &= (e - e) - (0 - 1) \\ &\quad - \frac{4}{\pi}\left(\frac{1}{\sqrt2} - 1\right) \end{aligned}

∴ I=1+4π−22π\therefore\ I = 1 + \dfrac{4}{\pi} - \dfrac{2\sqrt2}{\pi}⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Split the integral into two. The product x exx\,e^x needs integration by parts (Section 7.6) with xx as the first function, giving xex−exx e^x - e^x⁠. The term sin⁡πx4\sin\frac{\pi x}{4} has a sine of a constant times xx⁠, giving −4πcos⁡πx4-\frac{4}{\pi}\cos\frac{\pi x}{4}⁠. Then Theorem 2 (Section 7.8.3) gives F(1)−F(0)F(1) - F(0)⁠.

Given, to find, and the plan
Given
The integrand f(x)=x ex+sin⁡πx4f(x) = x\,e^x + \sin\frac{\pi x}{4} on [0,1][0, 1]⁠.
To find
The exact value of the integral, and a decimal.
Plan
(1) Check continuity. (2) Integrate xexx e^x by parts. (3) Integrate sin⁡πx4\sin\frac{\pi x}{4} by substitution. (4) Differentiate FF back. (5) Compute F(1)−F(0)F(1) - F(0)⁠.

Basics you need

1Second fundamental theorem

∫abf(x) dx=F(b)−F(a)\int_a^b f(x)\,dx = F(b) - F(a) when ff is continuous on [a,b][a, b] and F′=fF' = f⁠. Lesson: definite integrals and the fundamental theorem

2Integration by parts

∫f g dx=f∫g dx−∫(f′∫g dx)dx\int f\,g\,dx = f\int g\,dx - \int\left(f'\int g\,dx\right)dx⁠, with ff the first function and gg the second (Section 7.6). Lesson: integration by parts

3Integral of sin⁡kx\sin kx

∫sin⁡kx dx=−cos⁡kxk+C\int\sin kx\,dx = -\frac{\cos kx}{k} + C for a constant k≠0k \ne 0⁠. Basics: substitution (the chain rule backwards)

4Values

e0=1e^0 = 1⁠, cos⁡0=1\cos 0 = 1⁠, cos⁡π4=12=22\cos\frac{\pi}{4} = \frac{1}{\sqrt2} = \frac{\sqrt2}{2}⁠. Basics: trigonometric identities for integrals

Solution

  1. Check continuity on [0,1][0, 1]

    xx⁠, exe^x and sin⁡πx4\sin\frac{\pi x}{4} are continuous for every real xx⁠; so are their product and sum. The integrand is continuous on [0,1][0, 1]⁠.

    Theorem 2 requires continuity on the closed interval. There are no denominators, roots or logs here.
    Sums, products and compositions of continuous functions are continuous (Chapter 5). Lesson: the fundamental theorem
  2. ∫x ex dx\int x\,e^x\,dx by parts

    Take the first function xx (algebraic) and the second function exe^x (exponential). Then ddxx=1\frac{d}{dx}x = 1 and ∫ex dx=ex\int e^x\,dx = e^x⁠, so

    ∫x ex dx=x⋅ex−∫1⋅ex dx=x ex−ex+C.\begin{aligned}\int x\,e^x\,dx &= x\cdot e^x - \int 1\cdot e^x\,dx \\ &= x\,e^x - e^x + C.\end{aligned}
    The rule of thumb (Remark (iii), Section 7.6, often remembered as ILATE: inverse trig, log, algebraic, trig, exponential) takes the power of xx as the first function, because differentiating it makes it simpler (1), while exe^x is easy to integrate. Taking exe^x first would give x22ex−∫x22ex dx\frac{x^2}{2}e^x - \int\frac{x^2}{2}e^x\,dx⁠, which is harder. This is Example 19 of the book.
    Integration by parts, Section 7.6. Lesson: integration by parts
  3. ∫sin⁡πx4 dx\int\sin\frac{\pi x}{4}\,dx by substitution

    Put u=πx4u = \frac{\pi x}{4}⁠, so du=π4dxdu = \frac{\pi}{4}dx and dx=4πdudx = \frac{4}{\pi}du⁠:

    ∫sin⁡πx4 dx=4π∫sin⁡u du=−4πcos⁡u=−4πcos⁡πx4+C.\begin{aligned}\int\sin\frac{\pi x}{4}\,dx &= \frac{4}{\pi}\int\sin u\,du = -\frac{4}{\pi}\cos u \\ &= -\frac{4}{\pi}\cos\frac{\pi x}{4} + C.\end{aligned}

    Together, F(x)=x ex−ex−4πcos⁡πx4F(x) = x\,e^x - e^x - \frac{4}{\pi}\cos\frac{\pi x}{4}⁠.

    ∫sin⁡u du=−cos⁡u\int\sin u\,du = -\cos u⁠. Dividing by the inner constant π4\frac{\pi}{4} means multiplying by 4π\frac{4}{\pi}⁠.
    Standard formula (iii), Section 7.2: ∫sin⁡x dx=−cos⁡x+C\int\sin x\,dx = -\cos x + C⁠. Lesson: integration by substitution
  4. Check: differentiate FF back

    F′(x)=(ex+xex)−ex+4π⋅π4sin⁡πx4=x ex+sin⁡πx4. ✓\begin{aligned}F'(x) &= (e^x + x e^x) - e^x + \frac{4}{\pi}\cdot\frac{\pi}{4}\sin\frac{\pi x}{4} \\ &= x\,e^x + \sin\frac{\pi x}{4}.\ \checkmark\end{aligned}
    Product rule on xexx e^x gives ex+xexe^x + x e^x⁠; the −ex-e^x cancels the extra exe^x⁠. The chain rule on cos⁡πx4\cos\frac{\pi x}{4} gives −π4sin⁡πx4-\frac{\pi}{4}\sin\frac{\pi x}{4}⁠, and the two minus signs make a plus.
    Property (I), Section 7.2.1. Basics: integration undoes differentiation
  5. Evaluate F(1)−F(0)F(1) - F(0)

    First part: [xex−ex]01=(e−e)−(0−1)=1\big[x e^x - e^x\big]_0^1 = (e - e) - (0 - 1) = 1⁠.

    Second part:

    [−4πcos⁡πx4]01=−4πcos⁡π4+4πcos⁡0=−4π⋅22+4π=4π−22π.\begin{aligned}\Big[-\tfrac{4}{\pi}\cos\tfrac{\pi x}{4}\Big]_0^1 &= -\frac{4}{\pi}\cos\frac{\pi}{4} + \frac{4}{\pi}\cos 0 \\ &= -\frac{4}{\pi}\cdot\frac{\sqrt2}{2} + \frac{4}{\pi} \\ &= \frac{4}{\pi} - \frac{2\sqrt2}{\pi}.\end{aligned}

    Adding:

    I=1+4π−22π≈1.3729232.I = 1 + \frac{4}{\pi} - \frac{2\sqrt2}{\pi} \approx 1.3729232.
    0.5 1 1 2 3 x y y = x·eˣ + sin(πx/4) area ≈ 1.373 x·eˣ sin(πx/4)
    The shaded region under y=x ex+sin⁡πx4y = x\,e^x + \sin\frac{\pi x}{4} from 0 to 1 has area about 1.373. The dashed curves are the two terms separately: xexx e^x contributes area 1 and sin⁡πx4\sin\frac{\pi x}{4} contributes about 0.373.
    At the lower limit xex−ex=0−1=−1x e^x - e^x = 0 - 1 = -1⁠, not 0, so the first part is 0−(−1)=10 - (-1) = 1⁠. In decimals: 4π≈1.2732395\frac{4}{\pi} \approx 1.2732395 and 22π≈0.9003163\frac{2\sqrt2}{\pi} \approx 0.9003163⁠, so the second part is about 0.3729232.
    cos⁡π4=22\cos\frac{\pi}{4} = \frac{\sqrt2}{2} and 4π⋅22=22π\frac{4}{\pi}\cdot\frac{\sqrt2}{2} = \frac{2\sqrt2}{\pi}⁠. Basics: trigonometric values
Result ∫01(xex+sin⁡πx4)dx=1+4π−22π\int_0^1\left(x e^x + \sin\frac{\pi x}{4}\right)dx = 1 + \frac{4}{\pi} - \frac{2\sqrt2}{\pi}

≈1.3729232\approx 1.3729232⁠. (Textbook answer: 1+4π−22π1 + \frac{4}{\pi} - \frac{2\sqrt2}{\pi}⁠.)

Check it with numbers

A numerical integration of xex+sin⁡πx4x e^x + \sin\frac{\pi x}{4} over [0,1][0, 1] gives about 1.3729232, the same as the exact value to 7 decimal places.

Separately: ∫01xex dx\int_0^1 x e^x\,dx is numerically about 1.0000000 and ∫01sin⁡πx4 dx\int_0^1\sin\frac{\pi x}{4}\,dx is numerically about 0.3729232.

Common mistakes
  1. Taking F(0)=0F(0) = 0 for xex−exx e^x - e^x⁠. At 0 it is −1-1⁠.
  2. Writing ∫sin⁡πx4dx=−π4cos⁡πx4\int\sin\frac{\pi x}{4}dx = -\frac{\pi}{4}\cos\frac{\pi x}{4}⁠. You divide by the inner constant, so the factor is 4π\frac{4}{\pi}⁠.
  3. Choosing exe^x as the first function. The new integral ∫x22exdx\int\frac{x^2}{2}e^x dx is harder than the original.
What to take away
  1. ∫xex dx=(x−1)ex+C\int x e^x\,dx = (x - 1)e^x + C⁠: a result worth remembering.
  2. For a power of xx times exe^x⁠, sin⁡x\sin x or cos⁡x\cos x⁠, take the power of xx as the first function.
  3. ∫sin⁡kx dx=−1kcos⁡kx+C\int\sin kx\,dx = -\frac1k\cos kx + C⁠: divide by the inner constant.

Every fact used, and where it comes from

FactUsed inSource
∫abf=F(b)−F(a)\int_a^b f = F(b) - F(a) for continuous ffSteps 1, 5Theorem 2, Section 7.8.3 (Lesson)
Integration by parts; choice of first functionStep 2Section 7.6, Remark (iii); Example 19 (Lesson)
∫ex dx=ex+C\int e^x\,dx = e^x + CStep 2Standard formula (xi), Section 7.2
∫sin⁡x dx=−cos⁡x+C\int\sin x\,dx = -\cos x + CStep 3Standard formula (iii), Section 7.2
Substitution u=πx4u = \frac{\pi x}{4}Step 3Section 7.3.1 (Lesson)
Product rule and chain ruleStep 4Chapter 5 (Basics)
cos⁡π4=22\cos\frac{\pi}{4} = \frac{\sqrt2}{2}Step 5Trigonometric values (Basics)
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →