Solve the indefinite integral of 1/sqrt(x^2+2x+5).

I solved it all out by completing the square and then trig sub and then drawing a triangle to go back to x variable and got:
ln |(sqrt(x^2+2x+5)/2 + (X+1)/2 ) |

but the book answer is:
ln |(sqrt(x^2+2x+5) + x + 1 ) |

So, how did they rid of the 1/2 or where did I go wrong?

I don't seem to understand your explaination.

Factor x² + 2 x + 5:

x² + 2 x + 5 = ( x + 1 )² + 4

∫ dx / √ ( x² + 2 x + 5 ) = ∫ dx / √ [ ( x + 1 )² + 4 ]

Substitute:

( x + 1 ) / 2 = u

x + 1 = 2 u , dx = 2 du

∫ dx / √ [ ( x + 1 )² + 4 ] = ∫ 2 du / √ [ ( 2 u )² + 4 ] =

2 ∫ du / √ ( 4 u² + 4 ) =

2 ∫ du / √ [ 4 ∙ ( u² + 1 ) ] =

2 ∫ du / [ √4 ∙ √ ( u² + 1 ) ] =

2 ∫ du / [ 2 ∙ √ ( u² + 1 ) ] =

∫ du / √ ( u² + 1 ) = arc sinh ( u ) = arc sinh [ ( x + 1 ) / 2 ] + C

∫ dx / √ ( x² + 2 x + 5 ) = arcsinh [ ( x + 1 ) / 2 ] + C

So, the mysterious 2 crops again. However, for an indefinite integral, the extra constant does not matter, since

ln((x+...)/2) = -ln2 + ln(x+...) which disappears into the arbitrary constant C.

To find the indefinite integral of 1/sqrt(x^2+2x+5), you correctly started by completing the square and then making a trigonometric substitution. However, there seems to be a discrepancy in the simplification of the expression.

Let's go through the steps again:

1. Rewrite the integrand: 1/sqrt(x^2+2x+5).

2. Complete the square inside the square root:
x^2 + 2x + 5 = (x + 1)^2 + 4.

3. Make the substitution:
Let x + 1 = 2tan(theta), which implies dx = 2sec^2(theta) d(theta).

4. Substitute the trigonometric identity:
x = 2tan(theta) - 1.

Now, let's substitute these expressions back into the integral:

∫(1/sqrt(x^2+2x+5)) dx = ∫(1/sqrt((x+1)^2+4)) dx
= ∫(1/sqrt(4tan^2(theta)+4)) * 2sec^2(theta) d(theta)
= ∫(2sec^2(theta)/2sec(theta)) d(theta)
= ∫sec(theta) d(theta)
= ln |sec(theta) + tan(theta)| + C
= ln |(sqrt(x^2+2x+5) + x + 1 ) | + C.

After simplifying the result, we indeed have the book's answer: ln |(sqrt(x^2+2x+5) + x + 1 ) |.

It seems there might have been a calculation error or misinterpretation in simplifying the trigonometric substitution. Double-check your calculations and verify that the simplification mentioned above is correct.

This is how another person explained it to me:

dx/sqrt[(x+1)^2 +4 ]

let z = x+1
dx = dz

dz/sqrt[z^2 + 4]

= ln[z+sqrt(z^2+4)]

= ln[x+1 + sqrt(x^2+2x+1 + 4)]

because
integral dx/sqrt(x^2+p^2)
=ln[ x +sqrt(x^2+p^2)]

I still don't get how the 1/2 disappeared?

The question is, where did you get the 1/2 factor anyway? You have declined to show just what you did. You know that

x^2+2x+5 = (x+1)^2 + 2^2

and that

∫1/√(x^2+a^2) dx = ln(x+√(x^2+a^2))

since if
x = a*tanθ
x^2+a^2 = a^2 sec^2θ
dx = a sec^2θ dθ

∫1/√(x^2+a^2) dx = ∫1/(a secθ) (a sec^2θ) dθ
= ∫secθ dθ
= ln(secθ+tanθ) + C

So, where did you get your factor of 2?