If the function is of the form ${\frac {dy}{dx}}+p(x)y=r(x)$ , then the integrating factor is $I(x)=e^{\int p(x)dx}$.

OR

If the function is of the standard form $M(x,y)dx+N(x,y)dy=0$ , then the integrating factor is $I(x)=e^{\int {\frac {M_{y}-N_{x}}{N}}dx}$ or $I(x)=e^{\int {\frac {N_{x}-M_{y}}{M}}dy}$.

Substitute the integration factor into the equation $I(x)M(x,y)dx+I(x)N(x,y)dy=0$ and solve.