Step 1: Write in standard linear form \(\dfrac{dy}{dx}+Py=Q\):
Divide throughout by \(dx\) and by \((1+x^2)\):
\[ \dfrac{dy}{dx}+\dfrac{2x}{1+x^2}\,y=\dfrac{\cot x}{1+x^2} \]
Here \(P=\dfrac{2x}{1+x^2}\), \(Q=\dfrac{\cot x}{1+x^2}\).
Step 2: Find the integrating factor:
\[ \text{IF}=e^{\int P\,dx}=e^{\int\frac{2x}{1+x^2}dx}=e^{\ln(1+x^2)}=1+x^2 \]
Step 3: Multiply through by the IF and integrate:
\[ \dfrac{d}{dx}\big[y(1+x^2)\big]=\cot x \]
\[ y(1+x^2)=\int\cot x\,dx=\ln|\sin x|+C \]
Final Answer:
\[ \boxed{y(1+x^2)=\ln|\sin x|+C} \]