Step 1: Spot an exact differential:
Look at the left side $(1 + x^2)\,dy + 2xy\,dx$. Take the product $(1 + x^2)\,y$ and differentiate it: $d\big[(1 + x^2)\,y\big] = (1 + x^2)\,dy + y\cdot 2x\,dx$.
This is exactly the left side, so the equation can be solved without finding any integrating factor.
Step 2: Rewrite the equation:
\[ d\big[(1 + x^2)\,y\big] = \cot x\,dx \] Now one side holds only the quantity $(1 + x^2)y$ and the other side holds only $x$, so we can integrate straight away.
Step 3: Integrate both sides:
\[ \int d\big[(1 + x^2)\,y\big] = \int \cot x\,dx \] \[ (1 + x^2)\,y = \int \frac{\cos x}{\sin x}\,dx \] Put $t = \sin x$, so $dt = \cos x\,dx$. The right side becomes $\int \dfrac{dt}{t} = \log|t|$.
Step 4: Write the answer:
\[ (1 + x^2)\,y = \log|\sin x| + C \] Dividing by $1 + x^2$ (which is never zero) gives $y$ explicitly.
As a check, differentiating $(1 + x^2)\,y$ gives $\dfrac{\cos x}{\sin x} = \cot x$ on the right, which matches the original equation.
Final Answer:
The solution is $y = \dfrac{\log|\sin x| + C}{1 + x^2}$. \[\boxed{(1 + x^2)\,y = \log|\sin x| + C}\]