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

Exercise 7.6 · Q18: ∫ex1+sin⁡x1+cos⁡x dx\int e^x\frac{1+\sin x}{1+\cos x}\,dx

Exercise 7.6Integral of the type eˣ[f + f′] · Section 7.6.1
The question

Integrate the functions in Exercises 1 to 22.

18.

ex(1+sin⁡x1+cos⁡x)e^x\left(\frac{1 + \sin x}{1 + \cos x}\right)
Exam answer

Let I=∫ex(1+sin⁡x1+cos⁡x)dxI = \displaystyle\int e^x\left(\frac{1 + \sin x}{1 + \cos x}\right)dx⁠.

Using 1+cos⁡x=2cos⁡2x21 + \cos x = 2\cos^2\frac x2 and sin⁡x=2sin⁡x2cos⁡x2\sin x = 2\sin\frac x2\cos\frac x2⁠,

1+sin⁡x1+cos⁡x=1+2sin⁡x2cos⁡x22cos⁡2x2=12sec⁡2x2+tan⁡x2\begin{aligned} &\frac{1 + \sin x}{1 + \cos x} \\ &= \frac{1 + 2\sin\frac x2\cos\frac x2}{2\cos^2\frac x2} \\ &= \frac12\sec^2\frac x2 + \tan\frac x2 \end{aligned}

Let f(x)=tan⁡x2f(x) = \tan\frac x2⁠. Then f′(x)=12sec⁡2x2f'(x) = \frac12\sec^2\frac x2⁠.

I=∫ex[f(x)+f′(x)]dxI = \int e^x\left[f(x) + f'(x)\right]dx

Using ∫ex[f(x)+f′(x)]dx\displaystyle\int e^x\left[f(x) + f'(x)\right]dx =exf(x)+C= e^xf(x) + C⁠,

∴ I=extan⁡x2+C\therefore\ I = e^x\tan\dfrac x2 + C⁠.

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

The one idea this problem is built on

Rewrite the fraction with half angles. Since 1+cos⁡x=2cos⁡2x21 + \cos x = 2\cos^2\frac x2 and sin⁡x=2sin⁡x2cos⁡x2\sin x = 2\sin\frac x2\cos\frac x2⁠,

1+sin⁡x1+cos⁡x=12sec⁡2x2+tan⁡x2,\frac{1 + \sin x}{1 + \cos x} = \frac12\sec^2\frac x2 + \tan\frac x2,

and 12sec⁡2x2\frac12\sec^2\frac x2 is the derivative of tan⁡x2\tan\frac x2⁠. So the bracket is f+f′f + f' with f=tan⁡x2f = \tan\frac x2⁠, and Section 7.6.1 gives the answer extan⁡x2+Ce^x\tan\frac x2 + C⁠.

Given, to find, and the plan
Given
ex 1+sin⁡x1+cos⁡xe^x\,\frac{1+\sin x}{1+\cos x}⁠, defined where cos⁡x≠−1\cos x \ne -1⁠, that is x≠(2n+1)πx \ne (2n+1)\pi for integers nn⁠.
To find
∫ex 1+sin⁡x1+cos⁡x dx\int e^x\,\frac{1+\sin x}{1+\cos x}\,dx⁠.
Plan
(1) Rewrite the fraction with half-angle identities. (2) Recognise f=tan⁡x2f = \tan\frac x2 and apply the rule. (3) Differentiate back.

Basics you need

1Half-angle identities

1+cos⁡x=2cos⁡2x21 + \cos x = 2\cos^2\frac x2 (from cos⁡2θ=2cos⁡2θ−1\cos 2\theta = 2\cos^2\theta - 1 with θ=x2\theta = \frac x2⁠) and sin⁡x=2sin⁡x2cos⁡x2\sin x = 2\sin\frac x2\cos\frac x2⁠. Basics: trigonometric identities

2The rule ∫ex[f+f′] dx=exf+C\int e^x[f + f']\,dx = e^x f + C

Section 7.6.1. Lesson: integration by parts

3Derivative of tan⁡x2\tan\frac x2

ddxtan⁡x2=12sec⁡2x2\frac{d}{dx}\tan\frac x2 = \frac12\sec^2\frac x2 (chain rule, inner function x2\frac x2⁠). Basics: the chain rule backwards

Solution

  1. Rewrite the fraction with half angles

    Using 1+cos⁡x=2cos⁡2x21 + \cos x = 2\cos^2\frac x2 and sin⁡x=2sin⁡x2cos⁡x2\sin x = 2\sin\frac x2\cos\frac x2⁠:

    1+sin⁡x1+cos⁡x=12cos⁡2x2+2sin⁡x2cos⁡x22cos⁡2x2=12sec⁡2x2+tan⁡x2.\begin{aligned} \frac{1 + \sin x}{1 + \cos x} &= \frac{1}{2\cos^2\frac x2} + \frac{2\sin\frac x2\cos\frac x2}{2\cos^2\frac x2} \\ &= \frac12\sec^2\frac x2 + \tan\frac x2. \end{aligned}
    Split the fraction into 11+cos⁡x+sin⁡x1+cos⁡x\frac{1}{1+\cos x} + \frac{\sin x}{1+\cos x}⁠, then rewrite each part with half angles. In the second part one factor cos⁡x2\cos\frac x2 cancels, which is allowed: cos⁡x2=0\cos\frac x2 = 0 exactly when cos⁡2x2=0\cos^2\frac x2 = 0⁠, that is when 1+cos⁡x=01 + \cos x = 0⁠, and those points are excluded from the domain.
    cos⁡2θ=2cos⁡2θ−1\cos 2\theta = 2\cos^2\theta - 1 and sin⁡2θ=2sin⁡θcos⁡θ\sin 2\theta = 2\sin\theta\cos\theta with θ=x2\theta = \frac x2⁠. Basics: trigonometric identities
  2. Recognise f+f′f + f' and apply the rule

    Take f(x)=tan⁡x2f(x) = \tan\frac x2⁠. By the chain rule,

    f′(x)=sec⁡2x2⋅12=12sec⁡2x2.f'(x) = \sec^2\frac x2\cdot\frac12 = \frac12\sec^2\frac x2.

    So the integrand is ex[f(x)+f′(x)]e^x[f(x) + f'(x)]⁠, and by Section 7.6.1

    ∫ex 1+sin⁡x1+cos⁡x dx=extan⁡x2+C.\int e^x\,\frac{1+\sin x}{1+\cos x}\,dx = e^x\tan\frac x2 + C.
    Of the two terms, 12sec⁡2x2\frac12\sec^2\frac x2 is the derivative of tan⁡x2\tan\frac x2⁠, so f=tan⁡x2f = \tan\frac x2⁠. It is differentiable wherever cos⁡x2≠0\cos\frac x2 \ne 0⁠, which is the same set as the domain of the integrand, so the answer holds on each interval ((2n−1)π,(2n+1)π)\big((2n-1)\pi, (2n+1)\pi\big)⁠.
    ddxtan⁡u=sec⁡2u⋅dudx\frac{d}{dx}\tan u = \sec^2 u\cdot\frac{du}{dx}⁠; ∫ex[f+f′] dx=exf+C\int e^x[f + f']\,dx = e^x f + C⁠. Lesson: integration by parts
  3. Check: differentiate the answer

    ddx[extan⁡x2]=extan⁡x2+ex⋅12sec⁡2x2=ex(tan⁡x2+12cos⁡2x2)=ex 2sin⁡x2cos⁡x2+12cos⁡2x2=ex 1+sin⁡x1+cos⁡x.\begin{aligned} \frac{d}{dx}\left[e^x\tan\frac x2\right] &= e^x\tan\frac x2 + e^x\cdot\frac12\sec^2\frac x2 \\ &= e^x\left(\tan\frac x2 + \frac{1}{2\cos^2\frac x2}\right) \\ &= e^x\,\frac{2\sin\frac x2\cos\frac x2 + 1}{2\cos^2\frac x2} \\ &= e^x\,\frac{1 + \sin x}{1 + \cos x}. \end{aligned}
    Product rule, then put everything over the common bottom 2cos⁡2x22\cos^2\frac x2 and read the half-angle identities of Step 1 backwards: the top is sin⁡x+1\sin x + 1 and the bottom is 1+cos⁡x1 + \cos x⁠.
    Product rule; half-angle identities. Basics: integration undoes differentiation
Result ∫ex(1+sin⁡x1+cos⁡x)dx=extan⁡x2+C,\int e^x\left(\frac{1+\sin x}{1+\cos x}\right)dx = e^x\tan\frac x2 + C,

valid on any interval on which cos⁡x≠−1\cos x \ne -1 (no odd multiple of π\pi inside). (Textbook answer: extan⁡x2+Ce^x\tan\frac x2 + C⁠, the same.)

Check it with numbers

On [0,π2]\left[0, \frac{\pi}{2}\right]⁠, where cos⁡x≠−1\cos x \ne -1⁠:

F(π2)−F(0)=eπ/2tan⁡π4−e0tan⁡0=eπ/2=4.8104773810…\begin{aligned} F\left(\tfrac{\pi}{2}\right) - F(0) &= e^{\pi/2}\tan\frac{\pi}{4} - e^0\tan 0 \\ &= e^{\pi/2} = 4.8104773810\ldots \end{aligned}

Numerical integration of ex 1+sin⁡x1+cos⁡xe^x\,\frac{1+\sin x}{1+\cos x} over [0,π2]\left[0, \frac{\pi}{2}\right] gives 4.8104773810…4.8104773810\ldots⁠, the same.

Common mistakes
  1. Trying to integrate by parts directly with the fraction as it stands; the structure only appears after the half-angle rewrite.
  2. Losing the 12\frac12 from the chain rule: ddxtan⁡x2=12sec⁡2x2\frac{d}{dx}\tan\frac x2 = \frac12\sec^2\frac x2⁠, which matches 12cos⁡2x2\frac{1}{2\cos^2\frac x2} exactly.
  3. Writing 1+cos⁡x=2sin⁡2x21 + \cos x = 2\sin^2\frac x2⁠. That is 1−cos⁡x1 - \cos x⁠.
What to take away
  1. 1+cos⁡x1 + \cos x and 1−cos⁡x1 - \cos x in a bottom call for half angles: 2cos⁡2x22\cos^2\frac x2 and 2sin⁡2x22\sin^2\frac x2⁠.
  2. After rewriting, look for f+f′f + f'⁠; here f=tan⁡x2f = \tan\frac x2⁠.

Every fact used, and where it comes from

FactUsed inSource
1+cos⁡x=2cos⁡2x21 + \cos x = 2\cos^2\frac x2⁠; sin⁡x=2sin⁡x2cos⁡x2\sin x = 2\sin\frac x2\cos\frac x2Steps 1, 3Class XI, Chapter 3 (trigonometric functions of multiple angles)
∫ex[f+f′] dx=exf+C\int e^x[f + f']\,dx = e^x f + CStep 2Section 7.6.1 (Lesson: integration by parts)
ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2 x⁠; chain ruleStep 2Standard formula (iv), Section 7.2; Chapter 5, Section 5.3.1
Product ruleStep 3Chapter 5, Section 5.3
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 →