The Ultimate Guide on How to Solve Integrals by Completing the Square


The Ultimate Guide on How to Solve Integrals by Completing the Square

Not all integrals are straightforward; some require advanced algebraic techniques to rewrite expressions before integration. One such method is completing the square, an algebraic tool that transforms quadratic expressions into a more manageable form. In this guide on how to solve integrals by completing the square, we’ll take you step by step through how to solve integrals using this technique.

This article is part of a three-part series on integrals of rational functions. The following infographic illustrates this topic.

Integrating Rational Functions Infographic Resized. Related Article - The Ultimate Guide on How to Solve Integrals by Completing the Square

Completing the Square

Before applying this technique to integration, it’s necessary to understand what completing the square means. Given a quadratic expression:

$$ax^2 + bx + c.$$

We can rewrite it in the form:

$$a(x – h)^2 + k.$$

where \( h = -\frac{b}{2a} \) and \( k = c – \frac{b^2}{4a} \).

Now, let’s see how this technique is used in integration.

When to Use Completing the Square in Integration

Completing the square is particularly useful when dealing with integrals involving rational functions or square roots, such as:

Irreducible quadratic under square roots:

$$\int \sqrt{ax^2 + bx + c} dx.$$

Irreducible quadratics in the denominator:

$$\int \frac{1}{ax^2 + bx + c} dx.$$

This transformation takes integrals containing an irreducible quadratic to an integral that can be solved via the substitution rule or trigonometric substitution.

Steps to Solving Integrals by Completing the Square

Step 1: Recognizing the Need for Completing the Square

Completing the square is often the best approach if the integral involves an irreducible quadratic in the denominator or under a square root.

Step 2: Completing the Square

As an example, we complete the square for the quadratic \( 2x^2 + 12x + 16 \). We start by factoring out a 2 to get \( 2(x^2 + 6x + 8) \). \( \frac{6}{2}^2 = 3^2 = 9 \), so we rewrite the quadratic as $$2(x^2 + 6x + 9 – 1) = 2((x + 3)^2 – 1)) = 2(x + 3)^2 – 2.$$

Step 3: Using a Substitution.

Perform the substitution \( u = x – h \). If you need help with the substitution, check out The Ultimate Step-by-Step Guide to Solving Integrals Using Substitution.

Step 4: Solving the Integral

Solve the resulting integral via other methods. Don’t forget to back substitute.

Worked Out Examples

The first example demonstrates how the process works.

Example 1: Evaluate \( \int \frac{1}{x^2 + 6x + 10} dx \).

Solution: First, we complete the square. We begin by writing 10 as 9 + 1 to obtain

$$\int \frac{1}{x^2 + 6x + 9 + 1} dx.$$

Now notice that, \( x^2 + 6x + 9 = (x+3)^2 \), so we have

$$\int \frac{1}{(x + 3)^2 + 1} dx.$$

Let \( u = x + 3 \), then \( du = dx \). Substituting into the integral, we get

$$\int \frac{1}{u^2 + 1} du.$$

Integrating gives

$$\arctan{u} + C.$$

Back substituting, we arrive at a final answer of

$$\arctan{(x + 3)} + C.$$

Trigonometric substitution is often needed when completing the square to solve integrals. It will be needed in the following examples. If you haven’t already, please refer to my guide, Trigonometric Substitution for Beginners: A Step-by-Step Guide.

Example 2: Evaluate \( \int \frac{1}{\sqrt{x^2 + 6x + 10}} dx \).

Solution: First, we complete the square. We begin by writing 10 as 9 + 1 to obtain

$$\int \frac{1}{\sqrt{x^2 + 6x + 9 + 1}} dx.$$

Noting that \( x^2 + 6x + 9 = (x + 3)^2 \) we have

$$\int \frac{1}{\sqrt{(x + 3)^2 + 1}} dx.$$

Let \( x + 3 = \tan{\theta} \), then \( dx = \sec^2{\theta} d\theta \). Substituting into the integral, we arrive at

$$\int \frac{1}{\sqrt{\tan^2{\theta} + 1}}\sec^2{\theta} d\theta. $$

Applying the Pythagorean identity, we get

$$\int \frac{1}{\sqrt{\sec^2{\theta}}}\sec^2{\theta} d\theta. $$

Taking the square root gives

$$\int \frac{1}{\sec{\theta}}\sec^2{\theta} d\theta $$

This simplifies to

$$\int \sec{\theta} d\theta, $$

which is equivalent to

$$\int \frac{\sec{\theta}(\sec{\theta} + \tan{\theta})}{\sec{\theta} + \tan{\theta}} d\theta. $$

Distributing \( \sec{\theta} \) gives

$$\int \frac{\sec^2{\theta} + \sec{\theta}\tan{\theta}}{\sec{\theta} + \tan{\theta}} d\theta. $$

Let \( u = \sec{\theta} + \tan{\theta} \), then \( du = \sec^2{\theta} + \sec{\theta}\tan{\theta} d\theta \). Substituting into the integral, we get

$$ \int \frac{1}{u} du. $$

Integrating gives

$$ \ln{|u|} + C. $$

Back substituting, we obtain

$$ \ln{|\sec{\theta} + \tan{\theta}|} + C. $$

Shown below is the right triangle for our substitution.

Trigonometric Substitution Tangent x Plus 3

Using the triangle to convert everything back into terms of x, we arrive at

$$ \ln{|x + 3 + \sqrt{(x + 3)^2 + 1}|} + C. $$

Simplifying, we obtain a final answer of

$$ \ln{|x + 3 + \sqrt{x^2 + 6x + 10}|} + C. $$

Our last example is the most difficult. It uses all the methods discussed in this article and Basic Integration Problems for Beginners.

Example 3: Evaluate \( \int \frac{2x + 7}{(x^2 + 6x + 10)^2} dx \).

Solution: We first use linearity to split the integral into two integrals as follows:

$$\int \frac{2x + 6}{(x^2 + 6x + 10)^2} dx + \int \frac{1}{(x^2 + 6x + 10)^2} dx.$$

Now, we complete the square in the second integral. To begin, we write 10 as 9 + 1, which gives

$$\int \frac{2x + 6}{(x^2 + 6x + 10)^2} dx + \int \frac{1}{(x^2 + 6x + 9 + 1)^2} dx.$$

Writing \( x^2 + 6x + 9 \) as \( (x + 3)^2 \) we obtain

$$\int \frac{2x + 6}{(x^2 + 6x + 10)^2} dx + \int \frac{1}{((x + 3)^2 + 1)^2} dx.$$

In the first integral, let \( u = x^2 + 6x + 10 \), then \( du = (2x + 6)dx \). For the second integral, let \( x + 3 = \tan{\theta} \), then \( dx = \sec^2{\theta} d\theta \). Substituting into the integral, we have

$$\int \frac{1}{u^2} du + \int \frac{1}{(\tan^2{\theta}+ 1)^2}\sec^2{\theta} d\theta.$$

Applying the Pythagorean identity gives

$$\int \frac{1}{u^2} du + \int \frac{1}{(\sec^2{\theta})^2}\sec^2{\theta} d\theta.$$

This simplifies to

$$\int \frac{1}{u^2} du + \int \frac{1}{\sec^2{\theta}} d\theta.$$

Using exponential and trigonometric identities, we obtain

$$\int u^{-2} du + \int \cos^2{\theta} d\theta.$$

Applying the power-reducing identity, we get

$$\int u^{-2} du + \int \frac{1}{2} + \frac{1}{2}\cos{2\theta} d\theta.$$

Integrating gives

$$-u^{-1} + \frac{1}{2}\theta + \frac{1}{4}\sin{2\theta} + C.$$

This is equivalent to

$$-\frac{1}{u} + \frac{1}{2}\theta + \frac{1}{2}\sin{\theta}\cos{\theta} + C.$$

Shown below is the right triangle for our substitution.

Trigonometric Substitution Tangent x Plus 3

Using the triangle and back-substituting gives us

$$-\frac{1}{x^2 + 6x + 10} + \frac{1}{2}\arctan{(x + 3)} + \frac{1}{2}\frac{x + 3}{(x + 3)^2 + 1} + C.$$

Simplifying, we arrive at a final answer of

$$\frac{x + 1}{2(x^2 + 6x + 10)} + \frac{1}{2}\arctan{(x + 3)} + C.$$

Conclusion

In this guide, you learned how to solve integrals by completing the square, an integration technique used when dealing with irreducible quadratics. By transforming the integral into a simpler form, you can apply standard integration techniques like u-substitution or trigonometric substitution. With practice, you’ll master using this method.

Further Reading

How to Integrate Using Polynomial Long Division with Examples – Now that you know how to solve integrals by completing the square, it is time to learn other methods for integrating rational functions. Polynomial long division is one of these methods.

A Comprehensive Beginner’s Guide to Partial Fraction Decomposition – Partial fraction decomposition is the main method used to integrate rational functions. This article demonstrates this algebraic procedure.

Frequently Asked Questions

Yes, it can be used on rational integrals where a reducible quadratic appears in the denominator. However, in this case, we generally use partial fraction decomposition.