Step 1: Denominator Completion of the Square
The quadratic expression in the denominator is:
\[
x^2 + 2x + 4.
\]
Completing the square yields:
\[
x^2 + 2x + 4 = (x+1)^2 + 3.
\]
Step 2: Substitution Application
Let:
\[
t = x+1 \quad \text{therefore} \quad dt = dx.
\]
The integral transforms to:
\[
I = \int \frac{3(t-1) + 5}{\sqrt{t^2 + 3}} \, dt.
\]
Simplifying the numerator:
\[
3(t-1) + 5 = 3t - 3 + 5 = 3t + 2.
\]
The integral becomes:
\[
I = \int \frac{3t + 2}{\sqrt{t^2 + 3}} \, dt.
\]
Step 3: Integral Decomposition
The expression is split as:
\[
I = \int \frac{3t}{\sqrt{t^2+3}} \,dt + \int \frac{2}{\sqrt{t^2+3}} \,dt.
\]
First Integral:
Using the substitution \( u = t^2 + 3 \), which implies \( du = 2t \, dt \):
\[
\int \frac{3t}{\sqrt{t^2+3}} \, dt = \frac{3}{2} \int \frac{du}{\sqrt{u}}.
\]
The integral \( \int u^{-1/2} \, du \) evaluates to \( 2u^{1/2} \), resulting in:
\[
\frac{3}{2} \cdot 2\sqrt{t^2+3} = 3\sqrt{t^2+3}.
\]
Second Integral:
Applying the standard formula \( \int \frac{dx}{\sqrt{x^2 + a^2}} = \sinh^{-1} \left( \frac{x}{a} \right) \):
\[
\int \frac{2}{\sqrt{t^2+3}} \,dt = 2\sinh^{-1} \left(\frac{t}{\sqrt{3}}\right).
\]
Step 4: Back-Substitution \( t = x+1 \)
Substituting \( t \) back in terms of \( x \):
\[
I = 3\sqrt{x^2+2x+4} + 2\sinh^{-1} \left(\frac{x+1}{\sqrt{3}}\right) + C.
\]
Final Answer:
\[
\int \frac{3x+5}{\sqrt{x^2+2x+4}} \,dx = 3\sqrt{x^2+2x+4} + 2\sinh^{-1} \left(\frac{x+1}{\sqrt{3}}\right) + C.
\]