# How do you integrate int x^3/sqrt(x^2-2x+10)dx using trigonometric substitution?

May 31, 2018

You simplify the denominator by rearrangement and trig substitution until it is gone, at which point you find out exactly how messy you have made your numerator. In this case, quite messy, but it is solvable term by term. The value in this answer is mostly in the shorter first part.

#### Explanation:

'Fix' the denominator

First 'complete the square' in the denominator:
$\sqrt{{x}^{2} - 2 x + 10} = \sqrt{{\left(x - 1\right)}^{2} + 9}$
This is needed in order to put it into a form that a trig substitution can simplify by use of an identity - we need to simplify the denominator here in order to tackle the integral.

Then set $x - 1 = 3 \tan \theta$, making the integral
$\int {\left(1 + 3 \tan \theta\right)}^{3} / \sqrt{9 {\tan}^{2} \theta + 9} \frac{\mathrm{dx}}{d \theta} d \theta$
From our substitution formula, $\frac{\mathrm{dx}}{d \theta} = 3 {\sec}^{2} \theta$, the standard derivative of $\tan$. Thus the integral is
$\int {\left(1 + 3 \tan \theta\right)}^{3} / \sqrt{9 {\tan}^{2} \theta + 9} \cdot 3 {\sec}^{2} \theta d \theta$
$= \int \frac{{\sec}^{2} \theta {\left(1 + 3 \tan \theta\right)}^{3}}{\sqrt{{\tan}^{2} \theta + 1}} d \theta$

(Recall the identity $1 + {\tan}^{2} x = {\sec}^{2}$)

$= \int \frac{{\sec}^{2} \theta {\left(1 + 3 \tan \theta\right)}^{3}}{\sqrt{{\sec}^{2} \theta}} d \theta$
$= \int \sec \theta {\left(1 + 3 \tan \theta\right)}^{3} d \theta$

(Multiply out terms, recalling the binomial theorem for coefficients)

$= \int \sec \theta + 9 \sec \theta \tan \theta + 27 \sec \theta {\tan}^{2} \theta + 27 \sec \theta {\tan}^{3} \theta d \theta$

So this is how it is done in general - you simplify the denominator until it is gone, at which point you find out exactly how messy you have made your numerator. In this case, quite messy, but it is solvable term by term.

Solve what's left

For the first term, it will suffice here to state that $\int \sec \theta d \theta = \log | \sec \theta + \tan \theta | + C$. This answer is growing long, and there are proofs of this online, for example here: https://www.math.ubc.ca/~feldman/m121/secx.pdf

Note that $\frac{d}{\mathrm{dx}} \sec x = \sec x \tan x$, by the quotient rule and identity. So the second term is easy: $\int 9 \sec \theta \tan \theta \mathrm{dx} = 9 \sec \theta + C$.

Recall "integration by parts", a reformulation of the product rule of differentiation:
$\int u \frac{\mathrm{dv}}{d \theta} d \theta = u v - \int v \frac{\mathrm{du}}{d \theta} d \theta$

For the third term, use the $\sec$ derivative that was so useful for the second term; set $u = \tan \theta$ and $\frac{\mathrm{dv}}{d \theta} = 27 \sec \theta \tan \theta$. Then $v = 27 \sec \theta$, $\frac{\mathrm{du}}{d \theta} = {\sec}^{2} \theta$ and the integral of the third term is $27 \sec \theta \tan \theta - 27 \int {\sec}^{3} \theta d \theta$.
The above link also explains how to integrate ${\sec}^{3} \theta$. Taking this result as given, we see that $\int 27 \sec \theta {\tan}^{2} \theta d \theta = \frac{27}{2} \sec \theta \tan \theta - \frac{27}{2} \log | \sec \theta + \tan \theta | + C$.

Finally, for the fourth term, we take the same approach with the $\sec$ derivative. Set $\frac{\mathrm{dv}}{d \theta} = 27 \sec \theta \tan \theta$; set $u = {\tan}^{2} \theta$. Then $v = 27 \sec \theta$ and $\frac{\mathrm{du}}{d \theta} = 2 \tan \theta {\sec}^{2} \theta$, so the fourth term becomes
$27 \sec \theta {\tan}^{2} \theta - \int 54 \tan \theta {\sec}^{3} \theta d \theta$.
Repeat integration by parts, this time with $\frac{\mathrm{du}}{d \theta} = 54 \sec \theta \tan \theta$ and $v = {\sec}^{2} \theta$. Then $u = 54 \sec \theta$ and $\frac{\mathrm{dv}}{d \theta} = 2 \tan \theta \sec \theta$. The fourth term is now
$27 \sec \theta {\tan}^{2} \theta - 54 {\sec}^{3} \theta + \int 108 \tan \theta {\sec}^{2} \theta d \theta$.
A third integration by parts now (have patience!)... Again, $\frac{\mathrm{du}}{d \theta} = 108 \sec \theta \tan \theta$. $v = \sec \theta$. So $u = 108 \sec \theta$ and $\frac{\mathrm{dv}}{d \theta} = \sec \theta \tan \theta$. The fourth term is now
$27 \sec \theta {\tan}^{2} \theta - 54 {\sec}^{3} \theta + 108 {\sec}^{2} \theta - \int 108 \tan \theta {\sec}^{2} \theta d \theta$.

But this is where we can break the chain of integrations (hurrah, I hear you cry - it's been pretty tedious) - we now have the same integral as we did at the previous step, so we can employ a trick.

This step showed us that
$\int \tan \theta {\sec}^{2} \theta d \theta = {\sec}^{2} \theta - \int \tan \theta {\sec}^{2} \theta d \theta$
So
$\int \tan \theta {\sec}^{2} \theta d \theta = \frac{1}{2} {\sec}^{2} \theta$

Therefore the fourth term is
$27 \sec \theta {\tan}^{2} \theta - 54 {\sec}^{3} \theta + 54 {\sec}^{2} \theta$

Using the identity ${\tan}^{2} \theta = {\sec}^{2} \theta - 1$, we can simplify this:
$27 {\sec}^{3} \theta - 27 \sec \theta - 54 {\sec}^{3} \theta + 54 {\sec}^{2} \theta$
$- 27 \sec \theta + 54 {\sec}^{2} \theta - 27 {\sec}^{3} \theta$

Combining the four terms, we obtain the answer:
$\log | \sec \theta + \tan \theta | + 9 \sec x + \frac{27}{2} \sec \theta \tan \theta - \frac{27}{2} \log | \sec \theta + \tan \theta | - 27 \sec \theta + 54 {\sec}^{2} \theta - 27 {\sec}^{3} \theta + C$
which simplifies a little to
$- \frac{25}{2} \log | \sec \theta + \tan \theta | + \frac{27}{2} \sec \theta \tan \theta - 18 \sec \theta + 54 {\sec}^{2} \theta - 27 {\sec}^{3} \theta + C$

But we aren't quite done yet - we have to get back to our original variable, $x$. Recall our substitution: $x - 1 = 3 \tan \theta$. This was an elegant substitution that would have made for a nice integral if the numerator hadn't been so awkward. So $\tan \theta = \frac{x - 1}{3}$ and $\sec \theta = \sqrt{1 + {\left(x - 1\right)}^{2} / 9}$.

This leaves us with
$- \frac{25}{2} \log | \frac{x - 1}{3} + \sqrt{1 + {\left(x - 1\right)}^{2} / 9} | + \frac{9}{2} \left(x - 5\right) \sqrt{1 + {\left(x - 1\right)}^{2} / 9} + 54 \left(1 + {\left(x - 1\right)}^{2} / 9\right) - 27 {\left(1 + {\left(x - 1\right)}^{2} / 9\right)}^{\frac{3}{2}} + C$

Not a beautiful expression!