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

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

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

Integrate the function

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

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

x2+4x+1=(x+2)2−3=(x+2)2−(3)2\begin{aligned} x^2 + 4x + 1 &= (x + 2)^2 - 3 \\ &= (x + 2)^2 - \left(\sqrt3\right)^2 \end{aligned}

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

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

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

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

The one idea this problem is built on

Complete the square: x2+4x+1=(x+2)2−3x^2 + 4x + 1 = (x + 2)^2 - 3⁠, a square minus a positive number. After y=x+2y = x + 2 the root is y2−a2\sqrt{y^2 - a^2} with a2=3a^2 = 3⁠, and formula 7.6.2 (i) applies:

∫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}

Compared with Q3 the only changes are the minus sign in front of the log and a domain with a gap in it.

Given, to find, and the plan
Given
The integrand x2+4x+1\sqrt{x^2 + 4x + 1}⁠.
To find
∫x2+4x+1 dx\int\sqrt{x^2 + 4x + 1}\,dx⁠, and where the answer is valid.
Plan
(1) Complete the square. (2) Find the domain. (3) Put y=x+2y = x + 2⁠. (4) Recall how 7.6.2 (i) is derived. (5) Apply it with a2=3a^2 = 3 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)⁠. Basics: completing the square

2Formula 7.6.2 (i)

Derived in the textbook (Section 7.6.2) by parts, with the constant function 1 as the second function, using formula 7.4 (4): ∫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: integration by parts

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

ddxlog⁡∣u∣=u′u\frac{d}{dx}\log|u| = \frac{u'}{u} wherever u≠0u \ne 0⁠, whether uu is positive or negative (standard formula (xii), Section 7.2). Basics: logarithms and 1/x

Solution

  1. Complete the square

    Half the coefficient of xx is 2, and 22=42^2 = 4⁠:

    x2+4x+1=(x2+4x+4)+1−4=(x+2)2−3.\begin{aligned} x^2 + 4x + 1 &= (x^2 + 4x + 4) + 1 - 4 \\ &= (x + 2)^2 - 3. \end{aligned}
    The leftover 1−4=−31 - 4 = -3 is negative, so the shape is "square minus a2a^2" with a=3a = \sqrt3⁠: formula 7.6.2 (i).
    Completing the square, as in Section 7.4 (7). Basics: completing the square
  2. The domain has two pieces

    We need (x+2)2−3≥0(x + 2)^2 - 3 \ge 0⁠, that is ∣x+2∣≥3|x + 2| \ge \sqrt3⁠:

    x≤−2−3orx≥−2+3.x \le -2 - \sqrt3 \quad\text{or}\quad x \ge -2 + \sqrt3.

    Numerically, x≤−3.732x \le -3.732 or x≥−0.268x \ge -0.268 (to three decimals). Between these values the quadratic is negative and the integrand does not exist.

    ∣x+2∣≥3|x + 2| \ge \sqrt3 means x+2≥3x + 2 \ge \sqrt3 or x+2≤−3x + 2 \le -\sqrt3⁠. The roots of x2+4x+1=0x^2 + 4x + 1 = 0 are −2±3-2 \pm \sqrt3⁠; the upward parabola is non-negative outside them. Because the domain has a gap, the constant CC may even be chosen differently on the two pieces.
  3. Put y=x+2y = x + 2

    Then dy=dxdy = dx and

    ∫x2+4x+1 dx=∫y2−(3)2 dy.\int\sqrt{x^2 + 4x + 1}\,dx = \int\sqrt{y^2 - \left(\sqrt3\right)^2}\,dy.
    A shift has derivative 1, so dx=dydx = dy⁠. The domain becomes ∣y∣≥3|y| \ge \sqrt3⁠, exactly where y2−3\sqrt{y^2 - 3} is real.
    Integration by substitution, Section 7.3.1. Basics: substitution
  4. How formula 7.6.2 (i) is derived

    For a>0a > 0⁠, ∣y∣>a|y| > a⁠, let I=∫y2−a2⋅1 dyI = \int\sqrt{y^2 - a^2}\cdot 1\,dy⁠. By parts (first function the root, second function 1), and writing y2=(y2−a2)+a2y^2 = (y^2 - a^2) + a^2⁠:

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

    With 7.4 (4) and solving 2I=…2I = \dots for II⁠:

    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}
    This is the textbook's own derivation in Section 7.6.2. The derivative of y2−a2\sqrt{y^2 - a^2} is yy2−a2\frac{y}{\sqrt{y^2 - a^2}}⁠, so the product rule term is y⋅yy2−a2y\cdot\frac{y}{\sqrt{y^2 - a^2}}⁠. The a2a^2 part comes with a minus sign this time, which is why the log is subtracted.
    Integration by parts, Section 7.6; formula 7.4 (4). Lesson: integration by parts
  5. Apply it with a2=3a^2 = 3 and return to xx

    With a2=3a^2 = 3⁠, a22=32\frac{a^2}{2} = \frac32⁠. Putting back y=x+2y = x + 2 and y2−3=x2+4x+1y^2 - 3 = x^2 + 4x + 1⁠:

    ∫x2+4x+1 dx=x+22x2+4x+1−32log⁡∣x+2+x2+4x+1∣+C.\begin{aligned} \int\sqrt{x^2 + 4x + 1}\,dx &= \frac{x + 2}{2}\sqrt{x^2 + 4x + 1} \\ &\quad - \frac32\log\left|x + 2 + \sqrt{x^2 + 4x + 1}\right| + C. \end{aligned}
    Here the modulus really matters. On the left piece, x+2≤−3x + 2 \le -\sqrt3 is negative and x2+4x+1<∣x+2∣\sqrt{x^2 + 4x + 1} < |x + 2|⁠, so x+2+x2+4x+1x + 2 + \sqrt{x^2 + 4x + 1} is negative there. It is never 0: that would need (x+2)2−3=−(x+2)\sqrt{(x + 2)^2 - 3} = -(x + 2)⁠, and squaring gives −3=0-3 = 0⁠, impossible. So the log is defined on the whole domain.
    Formula 7.6.2 (i). Lesson: integration by parts
  6. Check: differentiate the answer

    Write y=x+2y = x + 2⁠, r=y2−3r = \sqrt{y^2 - 3}⁠, so drdx=yr\frac{dr}{dx} = \frac{y}{r} where r>0r > 0⁠. 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}

    So the derivative of our answer is, over the denominator 2r2r⁠,

    r2+y2−32r=2(y2−3)2r=r2r=r=x2+4x+1. ✓\begin{aligned} \frac{r^2 + y^2 - 3}{2r} &= \frac{2(y^2 - 3)}{2r} = \frac{r^2}{r} \\ &= r = \sqrt{x^2 + 4x + 1}.\ \checkmark \end{aligned}
    −32⋅1r=−32r-\frac32\cdot\frac1r = -\frac{3}{2r}⁠, and r2=r22r\frac r2 = \frac{r^2}{2r} with r2=y2−3r^2 = y^2 - 3⁠. The rule ddxlog⁡∣u∣=u′u\frac{d}{dx}\log|u| = \frac{u'}{u} holds for negative uu as well, so the check covers both pieces. It needs r>0r > 0⁠, so it applies at every point of the domain except the two end points x=−2±3x = -2 \pm \sqrt3⁠; there the integrand is 0 and the answer's one-sided slope is 0 as well.
    Product rule; chain rule; standard formula (xii), Section 7.2. Basics: logarithms and 1/x
Result ∫x2+4x+1 dx=x+22x2+4x+1−32log⁡∣x+2+x2+4x+1∣+C,\begin{aligned} \int\sqrt{x^2 + 4x + 1}\,dx &= \frac{x + 2}{2}\sqrt{x^2 + 4x + 1} \\ &\quad - \frac32\log\left|x + 2 + \sqrt{x^2 + 4x + 1}\right| + C, \end{aligned}

valid for x≤−2−3x \le -2 - \sqrt3 and for x≥−2+3x \ge -2 + \sqrt3⁠. (Textbook answer: (x+2)2x2+4x+1\frac{(x + 2)}{2}\sqrt{x^2 + 4x + 1} −32log⁡∣x+2+x2+4x+1∣+C- \frac32\log\left|x + 2 + \sqrt{x^2 + 4x + 1}\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. One interval is taken on each piece of the domain:

IntervalSum of thin stripsF(b)−F(a)F(b) - F(a)
[0,1][0, 1]1.77887011.77887011.77887011.7788701
[−6,−4][-6, -4]4.81570344.81570344.81570344.8157034
Common mistakes
  1. Plus sign in front of the log. For y2−a2\sqrt{y^2 - a^2} the log term is subtracted; +32log⁡+\frac32\log gives derivative x2+4x+1+3x2+4x+1\sqrt{x^2 + 4x + 1} + \frac{3}{\sqrt{x^2 + 4x + 1}}⁠.
  2. Dropping the modulus. On x≤−2−3x \le -2 - \sqrt3 the expression inside the log is negative.
  3. Claiming the domain is all real xx⁠. Between −2−3-2 - \sqrt3 and −2+3-2 + \sqrt3 the quadratic is negative.
What to take away
  1. Leftover negative after completing the square, with +y2+y^2⁠: formula 7.6.2 (i), log term subtracted.
  2. Formulas (i) and (ii) are one pattern: ∫y2+k dy\int\sqrt{y^2 + k}\,dy equals y2y2+k\frac{y}{2}\sqrt{y^2 + k} plus k2log⁡∣y+y2+k∣\frac{k}{2}\log\left|y + \sqrt{y^2 + k}\right|⁠, plus CC⁠, with k=a2k = a^2 in (ii) and k=−a2k = -a^2 in (i).
  3. Find the domain; when it has two pieces, check one interval on each.

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
∫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 (4)
∫y2−a2 dy\int\sqrt{y^2 - a^2}\,dy formulaSteps 4, 5Formula 7.6.2 (i), 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 →