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

Example 23: ∫x2+2x+5 dx\int\sqrt{x^2+2x+5}\,dx

ExamplesIntegrals of some more types · Section 7.6.2
The question

Find ∫x2+2x+5  dx\displaystyle\int \sqrt{x^2 + 2x + 5}\; dx⁠.

Exam answer

Let I=∫x2+2x+5 dxI = \displaystyle\int\sqrt{x^2 + 2x + 5}\,dx⁠.

x2+2x+5=(x+1)2+22x^2 + 2x + 5 = (x + 1)^2 + 2^2

Put x+1=yx + 1 = y⁠. Then dx=dydx = dy⁠.

I=∫y2+22 dyI = \int\sqrt{y^2 + 2^2}\,dy

Using ∫y2+a2 dy=y2y2+a2\displaystyle\int\sqrt{y^2 + a^2}\,dy = \frac{y}{2}\sqrt{y^2 + a^2} +a22log⁡∣y+y2+a2∣+C+ \frac{a^2}{2}\log\left|y + \sqrt{y^2 + a^2}\right| + C⁠,

I=y2y2+4+2log⁡∣y+y2+4∣+C\begin{aligned} I &= \frac{y}{2}\sqrt{y^2 + 4} \\ &\quad + 2\log\left|y + \sqrt{y^2 + 4}\right| + C \end{aligned}

∴ I=x+12x2+2x+5\therefore\ I = \dfrac{x + 1}{2}\sqrt{x^2 + 2x + 5} +2log⁡∣x+1+x2+2x+5∣+ 2\log\left|x + 1 + \sqrt{x^2 + 2x + 5}\right| +C+ C⁠.

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

The one idea this problem is built on

The book has ready-made answers for exactly three square-root integrals: ∫x2−a2 dx\int\sqrt{x^2 - a^2}\,dx⁠, ∫x2+a2 dx\int\sqrt{x^2 + a^2}\,dx and ∫a2−x2 dx\int\sqrt{a^2 - x^2}\,dx (Section 7.6.2). A general quadratic under the root is turned into one of these by completing the square: x2+2x+5=(x+1)2+22x^2 + 2x + 5 = (x+1)^2 + 2^2⁠. After the shift y=x+1y = x + 1 the integral is ∫y2+22 dy\int\sqrt{y^2 + 2^2}\,dy⁠, which is formula (ii) with a=2a = 2⁠.

Given, to find, and the plan
Given
The integrand x2+2x+5\sqrt{x^2 + 2x + 5}⁠. It is defined for every real xx⁠, because (Step 1) x2+2x+5=(x+1)2+4≥4>0x^2 + 2x + 5 = (x+1)^2 + 4 \ge 4 > 0⁠.
To find
All antiderivatives ∫x2+2x+5 dx\int\sqrt{x^2 + 2x + 5}\,dx⁠, that is, one antiderivative plus an arbitrary constant C.
Plan
Complete the square; substitute y=x+1y = x + 1⁠; use formula 7.6.2 (ii) with a=2a = 2⁠; return to xx⁠; differentiate the answer to confirm it gives back the integrand.

Basics you need

1Completing the square

For any number bb⁠, x2+bx=(x+b2)2−b24x^2 + bx = \left(x + \frac{b}{2}\right)^2 - \frac{b^2}{4}⁠. Expanding the bracket gives x2+bx+b24x^2 + bx + \frac{b^2}{4}⁠, so subtracting b24\frac{b^2}{4} puts us back where we started. This removes the middle term bxbx⁠. Basics: completing the square

2A shift is the simplest substitution

If y=x+ky = x + k for a constant kk⁠, then dydx=1\frac{dy}{dx} = 1⁠, so dy=dxdy = dx and ∫g(x+k) dx=∫g(y) dy\int g(x + k)\,dx = \int g(y)\,dy⁠. Nothing gets stretched, so no extra factor appears. Basics: substitution

3The standard formula 7.6.2 (ii)

∫x2+a2 dx=12xx2+a2+a22log⁡∣x+x2+a2∣+C.\int\sqrt{x^2 + a^2}\,dx = \frac{1}{2}x\sqrt{x^2 + a^2} + \frac{a^2}{2}\log\left|x + \sqrt{x^2 + a^2}\right| + C. The book obtains it by integrating by parts with 1 as the second function (Section 7.6.2). Step 5 below re-proves it for our case by differentiating. Lesson: integration by parts

4Two derivatives for the check

ddxlog⁡∣u∣=1u⋅dudx\frac{d}{dx}\log|u| = \frac{1}{u}\cdot\frac{du}{dx} and ddxu=12u⋅dudx\frac{d}{dx}\sqrt{u} = \frac{1}{2\sqrt{u}}\cdot\frac{du}{dx} (chain rule). Basics: logarithms and 1/x

Solution

  1. Complete the square under the root

    Here b=2b = 2⁠, so b2=1\frac{b}{2} = 1 and b24=1\frac{b^2}{4} = 1⁠. Split the 5 as 1+41 + 4⁠:

    x2+2x+5=(x2+2x+1)+4=(x+1)2+22.x^2 + 2x + 5 = (x^2 + 2x + 1) + 4 = (x+1)^2 + 2^2.

    So the integral is ∫(x+1)2+22 dx\int\sqrt{(x+1)^2 + 2^2}\,dx⁠. Since a square is never negative, (x+1)2+4≥4(x+1)^2 + 4 \ge 4⁠: the root is defined, and positive, for every real xx⁠.

    None of the three standard formulas has a middle term like 2x2x⁠. Completing the square hides that term inside a single square (x+1)2(x+1)^2⁠, and what is left over, +4+4⁠, is a positive constant, which we write as a2a^2 with a=2a = 2⁠. The sign of the leftover decides the formula: +a2+a^2 here, so formula (ii).
    Check the square by expanding: (x+1)2+4=x2+2x+1+4=x2+2x+5(x+1)^2 + 4 = x^2 + 2x + 1 + 4 = x^2 + 2x + 5⁠. Basics: completing the square
  2. Shift: put y=x+1y = x + 1

    Let y=x+1y = x + 1⁠. Then dydx=1\frac{dy}{dx} = 1⁠, so dy=dxdy = dx⁠, and

    ∫x2+2x+5 dx=∫y2+22 dy.\int\sqrt{x^2 + 2x + 5}\,dx = \int\sqrt{y^2 + 2^2}\,dy.
    The new variable yy absorbs the "+1+1" so that the integrand looks exactly like the standard one. Because the derivative of x+1x + 1 is 1, the differential needs no correction factor: dxdx simply becomes dydy⁠.
    Integration by substitution (Section 7.3.1): if y=g(x)y = g(x) then dy=g′(x) dxdy = g'(x)\,dx⁠. Here g′(x)=1g'(x) = 1⁠. Lesson: integration by substitution
  3. Apply formula 7.6.2 (ii) with a=2a = 2

    With a=2a = 2 we have a2=4a^2 = 4 and a22=2\frac{a^2}{2} = 2⁠. Formula (ii), written in the letter yy⁠, gives

    ∫y2+4 dy=12yy2+4+2log⁡∣y+y2+4∣+C.\int\sqrt{y^2 + 4}\,dy = \frac{1}{2}y\sqrt{y^2 + 4} + 2\log\left|y + \sqrt{y^2 + 4}\right| + C.
    The formula holds for any letter used as the variable, so we may apply it in yy⁠. The only care needed is the coefficient of the log: it is a22=42=2\frac{a^2}{2} = \frac{4}{2} = 2⁠, not a2=4a^2 = 4⁠. It happens to equal aa here, but only because a=2a = 2⁠; in general always compute a22\frac{a^2}{2}⁠.
    Formula 7.6.2 (ii) is the one with +a2+a^2 inside the root and a log in the answer; the one with a2−x2a^2 - x^2 has sin⁡−1\sin^{-1} instead (used in Example 24). Lesson: integration by parts
  4. Return to xx

    Replace yy by x+1x + 1 and y2+4y^2 + 4 by x2+2x+5x^2 + 2x + 5 (Step 1):

    ∫x2+2x+5 dx=12(x+1)x2+2x+5+2log⁡∣x+1+x2+2x+5∣+C.\begin{aligned}\int\sqrt{x^2 + 2x + 5}\,dx = {}&\tfrac{1}{2}(x + 1)\sqrt{x^2 + 2x + 5} \\ &+ 2\log\left|x + 1 + \sqrt{x^2 + 2x + 5}\right| \\ &+ C.\end{aligned}

    Where it is valid. The root is defined for all real xx (Step 1). The quantity inside the log is never zero; it is in fact always positive, because y2+4>y2=∣y∣≥−y\sqrt{y^2 + 4} > \sqrt{y^2} = |y| \ge -y⁠, so y+y2+4>0y + \sqrt{y^2 + 4} > 0⁠. Hence the answer holds for every real xx⁠, and the bars ∣  ∣|\;| could even be dropped.

    The question was asked in xx⁠, so the answer must be in xx⁠. Writing y2+4y^2 + 4 back as x2+2x+5x^2 + 2x + 5 (rather than (x+1)2+4(x+1)^2 + 4⁠) matches the book's printed form.
    log⁡∣u∣\log|u| needs u≠0u \ne 0⁠; a quantity that is always positive satisfies this everywhere. Basics: logarithms and 1/x
  5. Check: differentiate the answer

    Write y=x+1y = x + 1 and R=y2+4R = \sqrt{y^2 + 4}⁠, so that dydx=1\frac{dy}{dx} = 1 and, by the chain rule, dRdx=2y2y2+4=yR\frac{dR}{dx} = \frac{2y}{2\sqrt{y^2+4}} = \frac{y}{R}⁠.

    First term, by the product rule:

    ddx(12yR)=12R+12y⋅yR=R2+y22R.\frac{d}{dx}\left(\tfrac{1}{2}yR\right) = \tfrac{1}{2}R + \tfrac{1}{2}y\cdot\frac{y}{R} = \frac{R^2 + y^2}{2R}.

    Second term, by the chain rule for log⁡\log⁠:

    ddx 2log⁡(y+R)=2(1+yR)y+R=2⋅R+yRy+R=2R.\frac{d}{dx}\,2\log(y + R) = \frac{2\left(1 + \frac{y}{R}\right)}{y + R} = \frac{2\cdot\frac{R + y}{R}}{y + R} = \frac{2}{R}.

    Add them, using R2=y2+4R^2 = y^2 + 4⁠:

    R2+y2+42R=2y2+82R=y2+4R=R.\frac{R^2 + y^2 + 4}{2R} = \frac{2y^2 + 8}{2R} = \frac{y^2 + 4}{R} = R.

    And R=(x+1)2+4=x2+2x+5R = \sqrt{(x+1)^2 + 4} = \sqrt{x^2 + 2x + 5}⁠, the integrand. The constant C differentiates to 0. The answer is confirmed.

    An antiderivative is defined by the property that its derivative is the integrand, so differentiating is the complete check. It also proves formula 7.6.2 (ii) in this case without the integration by parts.
    Integration undoes differentiation: ∫f(x) dx=F(x)+C\int f(x)\,dx = F(x) + C means exactly F′(x)=f(x)F'(x) = f(x)⁠. Basics: integration undoes differentiation
Result

∫x2+2x+5 dx=12(x+1)x2+2x+5+2log⁡∣x+1+x2+2x+5∣+C,\begin{aligned}\int\sqrt{x^2 + 2x + 5}\,dx = {}&\tfrac{1}{2}(x + 1)\sqrt{x^2 + 2x + 5} \\ &+ 2\log\left|x + 1 + \sqrt{x^2 + 2x + 5}\right| + C,\end{aligned} valid for every real xx⁠. This is exactly the book's answer.

Check it with numbers

Call the answer without C F(x)F(x)⁠. Then F(0)=52+2log⁡(1+5)≈3.4667520F(0) = \frac{\sqrt5}{2} + 2\log(1 + \sqrt5) \approx 3.4667520 and F(1)=8+2log⁡(2+8)≈5.9774687F(1) = \sqrt8 + 2\log(2 + \sqrt8) \approx 5.9774687⁠, so F(1)−F(0)≈2.5107167F(1) - F(0) \approx 2.5107167⁠. A direct numerical integration of x2+2x+5\sqrt{x^2 + 2x + 5} from 0 to 1 gives the same 2.5107167. Also, the symmetric difference quotient of FF at x=2x = 2 (step 0.0001 on each side, so F(2.0001)−F(1.9999)0.0002\frac{F(2.0001) - F(1.9999)}{0.0002}⁠) gives 3.6055513, and 13≈3.6055513\sqrt{13} \approx 3.6055513⁠.

Common mistakes
  1. Taking a2=5a^2 = 5⁠. The constant 5 is not the a2a^2 of the formula; only what is left after completing the square is: 5−1=45 - 1 = 4⁠.
  2. Choosing the wrong formula. A leftover +a2+a^2 gives the log formula (ii). The sin⁡−1\sin^{-1} formula belongs to a2−y2\sqrt{a^2 - y^2}⁠.
  3. Forgetting to shift inside the log. The log contains y+y2+4y + \sqrt{y^2+4}⁠, which is x+1+x2+2x+5x + 1 + \sqrt{x^2+2x+5}⁠, not x+x2+2x+5x + \sqrt{x^2+2x+5}⁠.
  4. Using 12x\frac{1}{2}x in front of the root. The factor is 12y=12(x+1)\frac{1}{2}y = \frac{1}{2}(x + 1)⁠.
  5. Dropping "+ C". An indefinite integral is a whole family of antiderivatives.
What to take away
  1. ∫quadratic dx\int\sqrt{\text{quadratic}}\,dx⁠: complete the square, shift, then match one of the three formulas of Section 7.6.2 by the sign pattern under the root.
  2. After a shift y=x+ky = x + k⁠, every xx in the formula becomes x+kx + k⁠, including the one inside the log.
  3. Differentiating the answer is a complete check, and here it takes only a few lines once you name R=y2+4R = \sqrt{y^2 + 4}⁠.

Every fact used, and where it comes from

FactUsed inSource
x2+2x+5=(x+1)2+22x^2 + 2x + 5 = (x+1)^2 + 2^2Step 1Completing the square (Basics)
y=x+1, dy=dxy = x + 1,\ dy = dxStep 2Integration by substitution, Section 7.3.1 (Lesson)
∫x2+a2 dx\int\sqrt{x^2+a^2}\,dx formulaStep 3Section 7.6.2 (ii), proved by parts (Lesson)
y2+4>∣y∣\sqrt{y^2+4} > |y|⁠, so the log's argument is positiveStep 4Square roots are increasing
Product rule, chain rule, ddxlog⁡∣u∣\frac{d}{dx}\log|u|Step 5Chapter 5; standard formula (xii), Section 7.2
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 →