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

Miscellaneous · Q13: ∫ex(1+ex)(2+ex) dx\int\frac{e^x}{(1+e^x)(2+e^x)}\,dx

Miscellaneous ExerciseSubstitution t = eˣ, then partial fractions · Miscellaneous Exercise on Chapter 7
The question

Integrate the functions in Exercises 1 to 23.

13. ex(1+ex)(2+ex)\dfrac{e^x}{(1+e^x)(2+e^x)}

Exam answer

Let I=∫ex dx(1+ex)(2+ex)I = \displaystyle\int\frac{e^x\,dx}{(1 + e^x)(2 + e^x)}⁠.

Put ex=te^x = t⁠. Then ex dx=dte^x\,dx = dt⁠.

I=∫dt(1+t)(2+t)I = \int\frac{dt}{(1 + t)(2 + t)}

Let

1(1+t)(2+t)=A1+t+B2+t\frac{1}{(1 + t)(2 + t)} = \frac{A}{1 + t} + \frac{B}{2 + t} ⇒ 1=A(2+t)+B(1+t)\Rightarrow\ 1 = A(2 + t) + B(1 + t)

Putting t=−1t = -1⁠: A=1A = 1⁠. Putting t=−2t = -2⁠: −B=1-B = 1⁠, so B=−1B = -1⁠.

∴ I=∫(11+t−12+t)dt=log⁡∣1+t∣−log⁡∣2+t∣+C=log⁡∣1+t2+t∣+C\begin{aligned} \therefore\ I &= \int\left(\frac{1}{1 + t} - \frac{1}{2 + t}\right)dt \\ &= \log|1 + t| - \log|2 + t| + C \\ &= \log\left|\frac{1 + t}{2 + t}\right| + C \end{aligned}

∴ I=log⁡(1+ex2+ex)+C\therefore\ I = \log\left(\dfrac{1 + e^x}{2 + e^x}\right) + C⁠.

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

The one idea this problem is built on

Two methods in a row. The numerator exe^x is the derivative of exe^x⁠, which is the only way xx appears in the denominator, so the substitution t=ext = e^x gives ∫dt(1+t)(2+t)\int\frac{dt}{(1+t)(2+t)}⁠. That is a proper rational function over two different linear factors, so partial fractions finish the job.

Given, to find, and the plan
Given
f(x)=ex(1+ex)(2+ex)f(x) = \dfrac{e^x}{(1+e^x)(2+e^x)}⁠. Since ex>0e^x > 0⁠, both factors of the denominator are positive, so ff is defined for every real xx⁠.
To find
∫ex(1+ex)(2+ex) dx\displaystyle\int\frac{e^x}{(1+e^x)(2+e^x)}\,dx⁠.
Plan
(1) Substitute t=ext = e^x⁠. (2) Split into partial fractions. (3) Integrate. (4) Return to xx⁠. (5) Differentiate back.

Basics you need

1Substitution with exe^x

t=ext = e^x gives dt=ex dxdt = e^x\,dx (standard formula (xi) read backwards: ddxex=ex\frac{d}{dx}e^x = e^x⁠). Basics: substitution

2Table 7.2, row 1

px+q(x−a)(x−b)=Ax−a+Bx−b\frac{px + q}{(x-a)(x-b)} = \frac{A}{x-a} + \frac{B}{x-b} for a≠ba \ne b⁠. Lesson: partial fractions

3Laws of logarithms

log⁡p−log⁡q=log⁡pq\log p - \log q = \log\frac pq for p,q>0p, q > 0⁠. Basics: logarithms

Solution

  1. Substitute t=ext = e^x

    Then dt=ex dxdt = e^x\,dx⁠, and

    ∫ex dx(1+ex)(2+ex)=∫dt(1+t)(2+t),t>0.\int\frac{e^x\,dx}{(1+e^x)(2+e^x)} = \int\frac{dt}{(1+t)(2+t)}, \quad t > 0.
    The whole numerator ex dxe^x\,dx is exactly dtdt⁠, and xx appears in the rest only through exe^x⁠, so after substituting no xx is left. Partial fractions on the original would not apply, because the integrand is not a rational function of xx⁠; the substitution makes it one.
    Substitution, Section 7.3.1 (Basic 1).
  2. Split into partial fractions

    1(1+t)(2+t)=A1+t+B2+t.\frac{1}{(1+t)(2+t)} = \frac{A}{1+t} + \frac{B}{2+t}.

    Multiply by (1+t)(2+t)(1+t)(2+t)⁠:

    1=A(2+t)+B(1+t).1 = A(2+t) + B(1+t).

    t=−1t = -1⁠: 1=A1 = A⁠, so A=1A = 1⁠. t=−2t = -2⁠: 1=−B1 = -B⁠, so B=−1B = -1⁠. Hence

    1(1+t)(2+t)=11+t−12+t.\frac{1}{(1+t)(2+t)} = \frac{1}{1+t} - \frac{1}{2+t}.
    The fraction is proper (degree 0 over degree 2) with two different linear factors, which is row 1 of Table 7.2. The identity 1=A(2+t)+B(1+t)1 = A(2+t) + B(1+t) is a polynomial identity, so we may put t=−1t = -1 and t=−2t = -2 even though t=ext = e^x is never negative. Check: 11+t−12+t\frac{1}{1+t} - \frac{1}{2+t} =(2+t)−(1+t)(1+t)(2+t)= \frac{(2+t) - (1+t)}{(1+t)(2+t)} =1(1+t)(2+t)= \frac{1}{(1+t)(2+t)}⁠. ✓
    Table 7.2, row 1, Section 7.5 (Basic 2).
  3. Integrate

    ∫(11+t−12+t)dt=log⁡(1+t)−log⁡(2+t)+C=log⁡1+t2+t+C.\begin{aligned} \int\Big(\frac{1}{1+t} - \frac{1}{2+t}\Big)dt &= \log(1+t) - \log(2+t) + C \\ &= \log\frac{1+t}{2+t} + C. \end{aligned}
    Standard formula (xii) with 1+t1 + t and 2+t2 + t in place of tt⁠. Both are positive (as t>0t > 0⁠), so no absolute values are needed, and the difference of logarithms is the logarithm of the quotient.
    Standard formula (xii), Section 7.2; laws of logarithms (Basic 3).
  4. Return to xx

    ∫ex dx(1+ex)(2+ex)=log⁡(1+ex2+ex)+C.\int\frac{e^x\,dx}{(1+e^x)(2+e^x)} = \log\Big(\frac{1+e^x}{2+e^x}\Big) + C.
    Replace tt by exe^x⁠. This is exactly the textbook's answer, valid for every real xx⁠.
  5. Check: differentiate the answer

    ddx[log⁡(1+ex)−log⁡(2+ex)]=ex1+ex−ex2+ex=ex[(2+ex)−(1+ex)](1+ex)(2+ex)=ex(1+ex)(2+ex). ✓\begin{aligned} &\frac{d}{dx}\big[\log(1+e^x) - \log(2+e^x)\big] \\ &= \frac{e^x}{1+e^x} - \frac{e^x}{2+e^x} \\ &= \frac{e^x\big[(2+e^x) - (1+e^x)\big]}{(1+e^x)(2+e^x)} \\ &= \frac{e^x}{(1+e^x)(2+e^x)}. \ \checkmark \end{aligned}
    Each logarithm differentiates to (derivative of the inside) over (the inside), by the chain rule. The bracket simplifies to 1, giving back the integrand for every xx⁠.
Result

For every real xx⁠:

∫ex(1+ex)(2+ex) dx=log⁡(1+ex2+ex)+C.\int\frac{e^x}{(1+e^x)(2+e^x)}\,dx = \log\Big(\frac{1+e^x}{2+e^x}\Big) + C.

(Textbook answer: log⁡(1+ex2+ex)+C\log\big(\frac{1+e^x}{2+e^x}\big) + C⁠, the same.)

Check it with numbers

Integrate from 0 to log⁡2\log 2 (so tt runs from 1 to 2):

log⁡34−log⁡23=log⁡98≈0.1177830.\log\frac34 - \log\frac23 = \log\frac98 \approx 0.1177830.

Numerical integration over the same interval also gives 0.11778300.1177830⁠.

Common mistakes
  1. Splitting in xx directly, as if ex(1+ex)(2+ex)\frac{e^x}{(1+e^x)(2+e^x)} were a rational function of xx⁠. Substitute first.
  2. Sign of BB: at t=−2t = -2⁠, B(1+t)=−BB(1 + t) = -B⁠, so B=−1B = -1⁠.
  3. Writing the answer as log⁡2+ex1+ex\log\frac{2+e^x}{1+e^x}: that is the negative of the correct answer.
What to take away
  1. A function of exe^x multiplied by exe^x⁠: put t=ext = e^x⁠.
  2. Substitution often produces a rational function; then use partial fractions.

Every fact used, and where it comes from

FactUsed inSource
ddxex=ex\frac{d}{dx}e^x = e^x⁠; substitution t=ext = e^xStep 1Standard formula (xi), Section 7.2; Section 7.3.1
Form Ax−a+Bx−b\frac{A}{x-a} + \frac{B}{x-b}Step 2Table 7.2, row 1, Section 7.5
∫dxx=log⁡∣x∣+C\int\frac{dx}{x} = \log|x| + CStep 3Standard formula (xii), Section 7.2
log⁡p−log⁡q=log⁡pq\log p - \log q = \log\frac pqStep 3Algebra (Basics)
Chain ruleStep 5Chapter 5
All decimalsCheckRecomputed in the site's verification script
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 →