Concept:
Use substitution method:
\[
\int f(x)\,dx = g(x)
\Rightarrow \int f(t)\,dt = g(t)
\]
Step 1: Substitution
\[
t = \sin x \Rightarrow dt = \cos x \, dx
\]
Step 2: Transform integral
\[
\int \cos x \, f(\sin x)\,dx = \int f(t)\,dt
\]
Step 3: Integrate
\[
= g(t) + C = g(\sin x) + C
\]
Final:
\[
{g(\sin x) + C}
\]