# Thread: Trig Substitution with Completing the Square

1. ## Trig Substitution with Completing the Square

Integral of:

$\displaystyle dx/(sqrt(x^2+2x+65)$

I completed the square on the denominator to rewrite it as:

$\displaystyle sqrt((x+1)^2+64)$

When I try to solve this, I let:

$\displaystyle u=x+1$
$\displaystyle du=dx$

So we get the integral of:

$\displaystyle du/sqrt(u^2+64)$

Then I set:
$\displaystyle u=8tan(theta)$
$\displaystyle du=8sec^2(theta)d(theta)$

This simplifies to just the integral of:

$\displaystyle sec(theta)d(theta)$

The integral of this is:

$\displaystyle ln(abs(tan(theta)sec(theta)) + C$

When I setup a right triangle, I get the following sides:

Hypotenuse:sqrt((x+1)^2+64)
Opposite: x+1

When I use these values to replace tan(theta) and sec(theta) my final answer is:

$\displaystyle ln(abs((x+1)/8) * (sqrt((x+1)^2+64)/8)) + C$

However, the online website has a different answer. It has the same basic terms but without dividing by 8. Where am I going wrong?

2. ## Re: Trig Substitution with Completing the Square

The two forms are equivalent, as you may write:

$\displaystyle \ln\left(\frac{f(x)}{8} \right)+C=\ln(f(x))-\ln(8)+C=\ln(f(x))+C$

Since $\displaystyle \ln(8)$ in a constant, it may be combined with the constant of integration.

3. ## Re: Trig Substitution with Completing the Square

Hello, vesperka!

Your final line should have a Plus (+).

$\displaystyle \ln\left|\frac{x+1}{8} + \frac{\sqrt{x^2+2x +65}}{8}\right| + C$

However, the online website has a different answer.
It has the same basic terms but without dividing by 8.

They did some "invisible" (very sneaky) simplifying.

You had: .$\displaystyle \ln\left|\frac{x+1}{8} + \frac{\sqrt{x^2+2x +65}}{8}\right| +\;c$

. . . . . .$\displaystyle =\;\ln\left|\frac{x+1 + \sqrt{x^2+2x+65}}{8}\right| +\; c$

. . . . . .$\displaystyle =\;\ln\left|x + 1 + \sqrt{x^2 + 2x + 65}\right|\; - \underbrace{\ln(8)\;+\;c}_{\text{This is a constant}}$

. . . . . .$\displaystyle =\;\ln\left|x + 1 + \sqrt{x^2+2x+65}\right| + C$

Yes . . . just one more thing to watch for.

4. ## Re: Trig Substitution with Completing the Square

Thanks for the replies guys. I didn't realize this, but for the integral of sec(theta) I was multiplying the tangent and secant inside of the natural log when they actually should be added together. Thanks for the explanation on why -ln(8) is a constant that can be factored out!