Solution:
Key idea: A first-order linear equation can be written as dxdy+Py=Q, where P and Q are functions of x only. Its integrating factor is IF=e∫Pdx. Multiplying the equation by the IF turns the left side into dxd(y⋅IF), so the solution is y⋅IF=∫Q⋅IFdx+c, where c is the arbitrary constant.
Step 1 — Find the integrating factor.
The equation is in standard form with P=secx and Q=tanx. We use ∫secxdx=log∣secx+tanx∣ and work on −2π<x<2π, where secx+tanx>0.
IF=secx+tanx
Step 2 — Multiply by the IF.
The left side becomes dxd(y(secx+tanx)).
y(secx+tanx)=∫tanx(secx+tanx)dx
Step 3 — Integrate.
We expand and replace tan2x by sec2x−1.
y(secx+tanx)=∫(secxtanx+sec2x−1)dx
Each term is a standard integral.
y(secx+tanx)=secx+tanx−x+c
Step 4 — Rearrange.
We move secx+tanx to the left and take it out as a common factor.
(y−1)(secx+tanx)=c−x
Therefore, the general solution is (y−1)(secx+tanx)=c−x.