Answer :

To find the integral [tex]\(\int \frac{x^2+2}{x^2+3x+7} \, dx\)[/tex], follow these steps:

1. Simplify the Numerator: Notice that the numerator [tex]\(x^2 + 2\)[/tex] can be rewritten in a form that makes the integration more manageable. We do this by expressing [tex]\(x^2 + 2\)[/tex] in terms of the denominator [tex]\(x^2 + 3x + 7\)[/tex].

2. Rewrite the Numerator:

We observe that:
[tex]\[ x^2 + 3x + 7 = (x^2 + 3x) + 7 \][/tex]

To manipulate [tex]\(x^2 + 2\)[/tex], consider subtracting and adding the terms from the denominator:
[tex]\[ x^2 + 2 = (x^2 + 3x + 7) - 3x - 5 \][/tex]

Therefore:
[tex]\[ \frac{x^2 + 2}{x^2 + 3x + 7} = \frac{x^2 + 3x + 7 - 3x - 5}{x^2 + 3x + 7} = 1 - \frac{3x + 5}{x^2 + 3x + 7} \][/tex]

3. Split the Integral: Now we can split the integral into two simpler integrals:
[tex]\[ \int \frac{x^2 + 2}{x^2 + 3x + 7} \, dx = \int 1 \, dx - \int \frac{3x + 5}{x^2 + 3x + 7} \, dx \][/tex]

4. Integrate the First Term:

The integral of 1 with respect to [tex]\(x\)[/tex] is simply:
[tex]\[ \int 1 \, dx = x \][/tex]

5. Integrate the Second Term:

To integrate [tex]\(\frac{3x + 5}{x^2 + 3x + 7}\)[/tex], we break it down further using partial fractions or appropriate substitutions.

a. Separate the Integral:
[tex]\[ \int \frac{3x + 5}{x^2 + 3x + 7} \, dx = \int \frac{3x + 3}{x^2 + 3x + 7} \, dx + \int \frac{2}{x^2 + 3x + 7} \, dx \][/tex]

i. First Part: Notice [tex]\(3x + 3\)[/tex] in the numerator. We split this into:
[tex]\[ \int \frac{3x + 3}{x^2 + 3x + 7} \, dx = \int \frac{3(x + \frac{3}{2})}{x^2 + 3x + 7} \, dx \][/tex]

Using substitution [tex]\(u = x^2 + 3x + 7\)[/tex], which gives us [tex]\(du = (2x + 3) dx\)[/tex]. Adjust the constants properly.

ii. Second Part: For the term [tex]\( \frac{2}{x^2 + 3x + 7} \)[/tex], complete the square:
[tex]\[ x^2 + 3x + 7 = (x + \frac{3}{2})^2 + \frac{19}{4} \][/tex]

Then use a trigonometric substitution [tex]\(x + \frac{3}{2} = u\tan(\theta)\)[/tex].

6. Combine the Results:

Gather all parts:
[tex]\[ x - \frac{3}{2}\ln(x^2 + 3x + 7) - \frac{\sqrt{19}}{19} \arctan \left( \frac{2\sqrt{19}x + 3\sqrt{19}}{19} \right) \][/tex]

Thus the final integral evaluation is:
[tex]\[ \boxed{x - \frac{3}{2} \ln(x^2 + 3x + 7) - \frac{\sqrt{19}}{19} \arctan \left( \frac{2 \sqrt{19}x}{19} + \frac{3\sqrt{19}}{19} \right) + C} \][/tex]
where [tex]\(C\)[/tex] is the constant of integration.