Answer :

To find the integral [tex]\(\int \frac{\cos (x)}{\sin ^2(x)+1} \, dx\)[/tex], we can proceed step-by-step as follows:

1. Substitute a trigonometric identity:
Let us consider the substitution [tex]\( u = \sin(x) \)[/tex]. This implies [tex]\( du = \cos(x) \, dx \)[/tex].

2. Rewrite the integral in terms of [tex]\( u \)[/tex]:
Given the substitution [tex]\( u = \sin(x) \)[/tex], we have:
[tex]\[ \int \frac{\cos(x)}{\sin^2(x) + 1} \, dx = \int \frac{1}{u^2 + 1} \, du \][/tex]

3. Recognize the standard integral form:
The integral [tex]\(\int \frac{1}{u^2 + 1} \, du \)[/tex] is a standard form and is known to be:
[tex]\[ \int \frac{1}{u^2 + 1} \, du = \arctan(u) + C \][/tex]
where [tex]\(C\)[/tex] is the constant of integration.

4. Substitute back in terms of [tex]\( x \)[/tex]:
Since [tex]\( u = \sin(x) \)[/tex], we substitute back to get:
[tex]\[ \arctan(u) + C = \arctan(\sin(x)) + C \][/tex]

Therefore, the final result for the integral is:
[tex]\[ \int \frac{\cos (x)}{\sin ^2(x)+1} \, dx = \arctan(\sin(x)) + C \][/tex]

Here, [tex]\( C \)[/tex] is the constant of integration.