Solution:
Key idea: The equation is linear in y. In standard form dxdy+Py=Q, the integrating factor is e∫Pdx, and we use ∫cosecxdx=lntan2x.
Step 1 — Write the equation in standard form.
We divide every term by sinx (taking sinx=0).
dxdy−sinx1y=tan2x
So P=−cosecx and Q=tan2x.
Step 2 — Find the integrating factor.
We integrate P, taking 0<x<π so that tan2x>0.
∫Pdx=−ln(tan2x)
Raising e to this power gives the reciprocal of tan2x.
I.F.=cot2x
Step 3 — Write and evaluate the solution.
We use y×I.F.=∫Q×I.F.dx+C. The product tan2xcot2x equals 1.
ycot2x=∫tan2xcot2xdx
ycot2x=∫1dx
ycot2x=x+C
Step 4 — Make y the subject.
We multiply both sides by tan2x.
y=(x+C)tan2x
Therefore, the general solution is ycot2x=x+C, or y=(x+C)tan2x.