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

Exercise 7.7 · Q3: ∫x2+4x+6 dx\int\sqrt{x^2 + 4x + 6}\,dx

Exercise 7.7Integrals of some more types · Section 7.6.2
The question

Integrate the function

x2+4x+6.\sqrt{x^2 + 4x + 6}.
Exam answer

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

x2+4x+6=(x+2)2+2=(x+2)2+(2)2\begin{aligned} x^2 + 4x + 6 &= (x + 2)^2 + 2 \\ &= (x + 2)^2 + \left(\sqrt2\right)^2 \end{aligned}

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

I=∫y2+(2)2 dyI = \int\sqrt{y^2 + \left(\sqrt2\right)^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+2+22log⁡∣y+y2+2∣+C\begin{aligned} I &= \frac{y}{2}\sqrt{y^2 + 2} \\ &\quad + \frac22\log\left|y + \sqrt{y^2 + 2}\right| + C \end{aligned}

∴ I=x+22x2+4x+6\therefore\ I = \dfrac{x + 2}{2}\sqrt{x^2 + 4x + 6} +log⁡∣x+2+x2+4x+6∣+ \log\left|x + 2 + \sqrt{x^2 + 4x + 6}\right| +C+ C⁠.

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

The one idea this problem is built on

Completing the square turns any quadratic under a root into one of three standard shapes. Here x2+4x+6=(x+2)2+2x^2 + 4x + 6 = (x + 2)^2 + 2⁠, a square plus a positive number, so after y=x+2y = x + 2 it is y2+a2\sqrt{y^2 + a^2} with a2=2a^2 = 2⁠, and formula 7.6.2 (ii) gives the answer:

∫y2+a2 dy=y2y2+a2+a22log⁡∣y+y2+a2∣+C.\begin{aligned} \int\sqrt{y^2 + a^2}\,dy &= \frac{y}{2}\sqrt{y^2 + a^2} \\ &\quad + \frac{a^2}{2}\log\left|y + \sqrt{y^2 + a^2}\right| + C. \end{aligned}
Given, to find, and the plan
Given
The integrand x2+4x+6\sqrt{x^2 + 4x + 6}⁠.
To find
∫x2+4x+6 dx\int\sqrt{x^2 + 4x + 6}\,dx⁠, and where the answer is valid.
Plan
(1) Complete the square. (2) Note the domain. (3) Put y=x+2y = x + 2⁠. (4) See where formula 7.6.2 (ii) comes from. (5) Apply it with a2=2a^2 = 2 and return to xx⁠. (6) Differentiate back.

Basics you need

1Completing the square

x2+bx+c=(x+b2)2+(c−b24)x^2 + bx + c = \left(x + \frac{b}{2}\right)^2 + \left(c - \frac{b^2}{4}\right)⁠: add and subtract the square of half the coefficient of xx⁠. Basics: completing the square

2Integration by parts

∫f1f2 dx=f1∫f2 dx\int f_1 f_2\,dx = f_1\int f_2\,dx −∫(f1′∫f2 dx)dx- \int\left(f_1'\int f_2\,dx\right)dx⁠. Lesson: integration by parts

3Formula 7.4 (6)

∫dyy2+a2=log⁡∣y+y2+a2∣+C\int\frac{dy}{\sqrt{y^2 + a^2}} = \log\left|y + \sqrt{y^2 + a^2}\right| + C⁠. Lesson: integrals of particular functions

4Derivative of log⁡∣u∣\log|u|

ddxlog⁡∣u∣=u′u\frac{d}{dx}\log|u| = \frac{u'}{u} wherever u≠0u \ne 0 (standard formula (xii), Section 7.2, with the chain rule). Basics: logarithms and 1/x

Solution

  1. Complete the square

    Half the coefficient of xx is 42=2\frac42 = 2⁠, and 22=42^2 = 4⁠. Add and subtract 4:

    x2+4x+6=(x2+4x+4)+6−4=(x+2)2+2.\begin{aligned} x^2 + 4x + 6 &= (x^2 + 4x + 4) + 6 - 4 \\ &= (x + 2)^2 + 2. \end{aligned}
    (x+2)2=x2+4x+4(x + 2)^2 = x^2 + 4x + 4⁠, so the first three terms form a perfect square and the leftover is 6−4=26 - 4 = 2⁠. The sign of the leftover decides the formula: positive leftover with +y2+y^2 means 7.6.2 (ii). This is the method of Section 7.4 (7) and Example 23.
    Completing the square. Basics: completing the square
  2. The domain: every real xx

    Since (x+2)2≥0(x + 2)^2 \ge 0⁠, we get x2+4x+6=(x+2)2+2≥2>0x^2 + 4x + 6 = (x + 2)^2 + 2 \ge 2 > 0 for every real xx⁠. So the integrand is defined (and positive) for all xx⁠.

    A square root needs a non-negative inside. Completing the square shows this at a glance: the smallest value of the quadratic is 2, at x=−2x = -2⁠.
  3. Put y=x+2y = x + 2

    Then dy=dxdy = dx and

    ∫x2+4x+6 dx=∫y2+(2)2 dy.\int\sqrt{x^2 + 4x + 6}\,dx = \int\sqrt{y^2 + \left(\sqrt2\right)^2}\,dy.
    A shift y=x+2y = x + 2 has dydx=1\frac{dy}{dx} = 1⁠, so dxdx becomes dydy with no extra factor. Now the root has the shape y2+a2\sqrt{y^2 + a^2} with a=2a = \sqrt2⁠.
    Integration by substitution, Section 7.3.1. Basics: substitution
  4. Where formula 7.6.2 (ii) comes from

    Let a>0a > 0 and I=∫y2+a2⋅1 dyI = \int\sqrt{y^2 + a^2}\cdot 1\,dy⁠. By parts with first function y2+a2\sqrt{y^2 + a^2} and second function 1:

    I=yy2+a2−∫y⋅yy2+a2 dy=yy2+a2−∫(y2+a2)−a2y2+a2 dy=yy2+a2−I+a2∫dyy2+a2.\begin{aligned} I &= y\sqrt{y^2 + a^2} - \int y\cdot\frac{y}{\sqrt{y^2 + a^2}}\,dy \\ &= y\sqrt{y^2 + a^2} - \int\frac{(y^2 + a^2) - a^2}{\sqrt{y^2 + a^2}}\,dy \\ &= y\sqrt{y^2 + a^2} - I + a^2\int\frac{dy}{\sqrt{y^2 + a^2}}. \end{aligned}

    By 7.4 (6) the last integral is log⁡∣y+y2+a2∣\log\left|y + \sqrt{y^2 + a^2}\right|⁠. So 2I=yy2+a22I = y\sqrt{y^2 + a^2} +a2log⁡∣y+y2+a2∣+ a^2\log\left|y + \sqrt{y^2 + a^2}\right|⁠, and

    I=y2y2+a2+a22log⁡∣y+y2+a2∣+C.\begin{aligned} I &= \frac{y}{2}\sqrt{y^2 + a^2} \\ &\quad + \frac{a^2}{2}\log\left|y + \sqrt{y^2 + a^2}\right| + C. \end{aligned}
    The derivative of y2+a2\sqrt{y^2 + a^2} is yy2+a2\frac{y}{\sqrt{y^2 + a^2}}⁠. Writing y2=(y2+a2)−a2y^2 = (y^2 + a^2) - a^2 makes the original integral II reappear, and we solve for it. The textbook does exactly this for formula (i) in Section 7.6.2 and says (ii) follows "similarly".
    Integration by parts, Section 7.6; formula 7.4 (6). Lesson: integration by parts
  5. Apply it with a2=2a^2 = 2 and return to xx

    With a2=2a^2 = 2⁠, a22=1\frac{a^2}{2} = 1⁠:

    ∫y2+2 dy=y2y2+2+log⁡∣y+y2+2∣+C.\begin{aligned} \int\sqrt{y^2 + 2}\,dy &= \frac{y}{2}\sqrt{y^2 + 2} \\ &\quad + \log\left|y + \sqrt{y^2 + 2}\right| + C. \end{aligned}

    Now y=x+2y = x + 2 and y2+2=x2+4x+6y^2 + 2 = x^2 + 4x + 6⁠, so

    ∫x2+4x+6 dx=x+22x2+4x+6+log⁡∣x+2+x2+4x+6∣+C.\begin{aligned} \int\sqrt{x^2 + 4x + 6}\,dx &= \frac{x + 2}{2}\sqrt{x^2 + 4x + 6} \\ &\quad + \log\left|x + 2 + \sqrt{x^2 + 4x + 6}\right| + C. \end{aligned}
    Undo the substitution everywhere: y2+2y^2 + 2 is the completed square from Step 1, which is x2+4x+6x^2 + 4x + 6 again. Note that x+2+x2+4x+6x + 2 + \sqrt{x^2 + 4x + 6} is always positive (the root (x+2)2+2\sqrt{(x + 2)^2 + 2} is bigger than ∣x+2∣|x + 2|⁠), so the modulus could be dropped here; the textbook keeps it, and it does no harm.
    Formula 7.6.2 (ii). Lesson: integration by parts
  6. Check: differentiate the answer

    Write y=x+2y = x + 2 and r=y2+2r = \sqrt{y^2 + 2}⁠, so dydx=1\frac{dy}{dx} = 1 and drdx=yr\frac{dr}{dx} = \frac{y}{r}⁠. Then

    ddx[y2 r]=r2+y22r,ddxlog⁡∣y+r∣=1+yry+r=1r.\begin{aligned} \frac{d}{dx}\left[\frac{y}{2}\,r\right] &= \frac{r}{2} + \frac{y^2}{2r}, \\ \frac{d}{dx}\log|y + r| &= \frac{1 + \frac{y}{r}}{y + r} = \frac{1}{r}. \end{aligned}

    Adding, over the common denominator 2r2r⁠:

    r2+y2+22r=2(y2+2)2r=r2r=r=x2+4x+6. ✓\begin{aligned} \frac{r^2 + y^2 + 2}{2r} &= \frac{2(y^2 + 2)}{2r} = \frac{r^2}{r} \\ &= r = \sqrt{x^2 + 4x + 6}.\ \checkmark \end{aligned}
    1+yr=r+yr1 + \frac{y}{r} = \frac{r + y}{r}⁠, and dividing by y+ry + r leaves 1r\frac1r⁠. Then r2=r22r\frac{r}{2} = \frac{r^2}{2r} with r2=y2+2r^2 = y^2 + 2⁠, so the numerator is 2(y2+2)=2r22(y^2 + 2) = 2r^2⁠. This works for every real xx⁠.
    Product rule; chain rule; standard formula (xii), Section 7.2. Basics: logarithms and 1/x
Result ∫x2+4x+6 dx=x+22x2+4x+6+log⁡∣x+2+x2+4x+6∣+C,\begin{aligned} \int\sqrt{x^2 + 4x + 6}\,dx &= \frac{x + 2}{2}\sqrt{x^2 + 4x + 6} \\ &\quad + \log\left|x + 2 + \sqrt{x^2 + 4x + 6}\right| + C, \end{aligned}

valid for every real xx⁠. (Textbook answer: (x+2)2x2+4x+6\frac{(x + 2)}{2}\sqrt{x^2 + 4x + 6} +log⁡∣x+2+x2+4x+6∣+C+ \log\left|x + 2 + \sqrt{x^2 + 4x + 6}\right| + C⁠, the same.)

Check it with numbers

By Section 7.8, ∫abf(x) dx=F(b)−F(a)\int_a^b f(x)\,dx = F(b) - F(a) for our answer FF⁠, on any interval where the integrand is continuous. The middle column is a computer's sum of very many thin strips, found without our answer.

IntervalSum of thin stripsF(b)−F(a)F(b) - F(a)
[−3,0][-3, 0]5.12020995.12020995.12020995.1202099
[1,2][1, 2]3.77647993.77647993.77647993.7764799
Common mistakes
  1. Wrong leftover. 6−4=26 - 4 = 2⁠, not 6+46 + 4⁠: we add 4 to make the square, so we must subtract 4 again.
  2. Using a2/2=2a^2/2 = 2 instead of 1. Here a2=2a^2 = 2⁠, so the log has coefficient 22=1\frac{2}{2} = 1⁠.
  3. Leaving yy in the answer. Replace yy by x+2x + 2 in all three places.
What to take away
  1. Complete the square first; the sign pattern (y2+a2y^2 + a^2⁠, y2−a2y^2 - a^2 or a2−y2a^2 - y^2⁠) picks the formula.
  2. ∫y2+a2 dy\int\sqrt{y^2 + a^2}\,dy equals y2y2+a2\frac{y}{2}\sqrt{y^2 + a^2} plus a22log⁡∣y+y2+a2∣\frac{a^2}{2}\log\left|y + \sqrt{y^2 + a^2}\right|⁠, plus CC⁠.

Every fact used, and where it comes from

FactUsed inSource
Completing the squareSteps 1, 2Section 7.4 (7); Example 23 (Basics: completing the square)
Substitution y=x+2y = x + 2Step 3Section 7.3.1
Integration by partsStep 4Section 7.6
∫dyy2+a2=log⁡∣y+y2+a2∣+C\int\frac{dy}{\sqrt{y^2 + a^2}} = \log\left|y + \sqrt{y^2 + a^2}\right| + CStep 4Formula 7.4 (6)
∫y2+a2 dy\int\sqrt{y^2 + a^2}\,dy formulaSteps 4, 5Formula 7.6.2 (ii), Section 7.6.2
ddxlog⁡∣u∣=u′u\frac{d}{dx}\log|u| = \frac{u'}{u}Step 6Standard formula (xii), Section 7.2
∫abf(x) dx=F(b)−F(a)\int_a^b f(x)\,dx = F(b) - F(a)Numerical checkSection 7.8 (Lesson: definite integrals)
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 →