Find the general solution of the differential equation $(1+x^2)dy+2xy\;dx=\cot x\;dx\;(x\neq0)$

Toolbox:
• To solve the first order linear differential equation of the form $\large\frac{dy}{dx}$$+ Py = Q • (i) Write the given equation in the form of \large\frac{dy}{dx}$$ + Py = Q$
• (ii) Find the integrating factor (I.F) = $e^{\int Pdx}$.
• (iii) Write the solution as y(I.F) = integration of $Q(I.F) dx + C$
Step 1:
By using the information in the tool box, let us write the equation as
$\large\frac{dy}{dx} +\frac{2xy}{(1+x^2) }=\frac{ \cot x}{(1+x^2)}$ ( divide throughout by $(1+x^2)dx$
Here $P = \large\frac{2x}{(1+x^2)}$ and $Q =\large\frac{ \cot x}{(1+x^2)}$