Step 1: Recognize the left side as an exact product derivative in disguise:
Notice $d\big[y(1+x^2)\big]=(1+x^2)\,dy+2xy\,dx$ exactly matches the left side of the given equation — this is the product rule for $y\cdot(1+x^2)$.
Step 2: Rewrite the whole equation using this observation:
$d\big[y(1+x^2)\big]=\cot x\,dx$.
Step 3: Integrate both sides directly:
$y(1+x^2)=\int\cot x\,dx=\ln|\sin x|+C$.
Final Answer:
\[ \boxed{y=\dfrac{\ln|\sin x|+C}{1+x^2}} \]