Step 1: Understanding the Concept
Let \(t=\cos x\), so \(\sin x\,dx=-dt\) and \(\sin^2x=1-t^2\).
Step 2: Rewrite the integral
\(\sin x(1+\sin^2x)=\sin x(2-t^2)\) and \(\cos2x=2t^2-1\).
The integral becomes \(-\displaystyle\int\dfrac{2-t^2}{2t^2-1}dt\).
Step 3: Split
\(\dfrac{2-t^2}{2t^2-1}=-\dfrac12+\dfrac{3/2}{2t^2-1}\), so the integral is \(\dfrac t2-\dfrac32\displaystyle\int\dfrac{dt}{2t^2-1}\).
Step 4: Integrate
\(\displaystyle\int\dfrac{dt}{2t^2-1}=\dfrac{\sqrt2}{4}\log\left|\dfrac{\sqrt2t-1}{\sqrt2t+1}\right|\).
Hence \(A=\dfrac12,\ B=-\dfrac{3}{4\sqrt2},\ f(x)=\dfrac{\sqrt2\cos x-1}{\sqrt2\cos x+1}\).
Final Answer:
The values are \(A=\dfrac12\), \(B=-\dfrac{3}{4\sqrt2}\) and \(f(x)=\dfrac{\sqrt2\cos x-1}{\sqrt2\cos x+1}\).
\[ \boxed{\text{(A) }\mathrm{A}=\dfrac{1}{2},\ \mathrm{B}=\dfrac{-3}{4\sqrt{2}},\ \mathrm{f}(x)=\dfrac{\sqrt{2}\cos x-1}{\sqrt{2}\cos x+1}} \]