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?

1/√(x^2+2x+5) = 1/√((x+1)^2 + 3)

Now, ∫1/√(u^2+a^2) du = ln(x+√(u^2+a^2))

let u = x+2 and a^2=3, and you have a result of

ln(u+√(u^2+a^2)) = ln((x+1)+√((x+1)^2+3)
= ln(x+1+√(x^2+2x+5))

I don't understand what you mean?

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?

To solve the indefinite integral of 1/sqrt(x^2+2x+5), you need to simplify the expression and then integrate it. It seems like you made a mistake when simplifying the expression after the trigonometric substitution. Let's go over the correct approach step by step:

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

2. Perform a trigonometric substitution to simplify the expression. Let's substitute x + 1 = 2tan(θ) or x = 2tan(θ) - 1. Also, note that dx = 2sec^2(θ) dθ.
The square root expression becomes:
sqrt((x + 1)^2 + 4) = sqrt(4tan^2(θ) + 4)
= 2sqrt(tan^2(θ) + 1)
= 2sec(θ)

The integral becomes:
∫(1/sqrt(x^2 + 2x + 5)) dx
= ∫(1/2sec(θ)) * (2sec^2(θ)dθ)
= ∫(cos(θ))dθ

3. Convert back to the x variable. From the trigonometric substitution, we have x = 2tan(θ) - 1, which gives us:
cos(θ) = 1/sqrt(tan^2(θ) + 1)
= 1/sqrt((x/2)^2 + 1)

4. Now, we can rewrite the integral as:
∫(cos(θ))dθ = ∫(1/sqrt((x/2)^2 + 1))dx

At this point, you should have the integral as:
∫(1/sqrt((x/2)^2 + 1))dx

The correct book answer should be ln |(sqrt(x^2+2x+5) + x + 1)|.

So, it seems like you made the mistake of not simplifying the expression properly after the trigonometric substitution. Make sure to review your derivation and check the simplification steps.