Solution:
Key idea: We split the fraction as 1−ex+12. For ∫ex+1dx we multiply the numerator and the denominator by e−x, so that the numerator becomes minus the derivative of the denominator.
Step 1 — Split the fraction.
We write the numerator as (ex+1)−2.
ex+1ex−1=ex+1(ex+1)−2
ex+1(ex+1)−2=1−ex+12
Step 2 — Rewrite ex+11.
We multiply the numerator and the denominator by e−x.
ex+11=1+e−xe−x
Step 3 — Integrate 1+e−xe−x by substitution.
We put the new denominator equal to t.
t=1+e−x
Differentiating both sides gives the new differential.
dt=−e−xdx
So this part becomes −∫tdt. No modulus is needed because 1+e−x>0.
∫1+e−xe−xdx=−∫tdt
−∫tdt=−log(1+e−x)
Step 4 — Combine the parts.
We integrate 1 to get x and multiply the result of Step 3 by −2.
∫ex+1ex−1dx=x−2[−log(1+e−x)]+C
x−2[−log(1+e−x)]+C=x+2log(1+e−x)+C
Note: Since log(1+e−x)=log(ex+1)−x, the same answer can be written as 2log(ex+1)−x+C.
Therefore, ∫ex+1ex−1dx=x+2log(1+e−x)+C.