The given differential equation is
dxdy+(secx)y=tanx
It is of the form
dxdy+Py=Q
Comparing,
P=secx,Q=tanx
Integrating Factor
∫Pdx=∫secxdx=log(secx+tanx)
I.F.=e∫Pdx=elog(secx+tanx)=secx+tanx
General Solution
y(I.F.)=∫Q(I.F.)dx+c
⇒y(secx+tanx)=∫tanx(secx+tanx)dx+c
=∫(secxtanx+tan2x)dx+c
Using tan2x=sec2x−1,
=∫(secxtanx+sec2x−1)dx+c
=secx+tanx−x+c
y(secx+tanx)=secx+tanx−x+c
which is the required general solution.