The given differential equation is dxdy+ytanx=secx
This is a first-order linear differential equation of the form dxdy+P(x)⋅y=Q(x) where P(x)=tanx and Q(x)=secx.
The integrating factor is IF=e∫P(x)dx=e∫tanxdx
∫tanxdx=∫cosxsinxdx
Let u=cosx, then du=−sinxdx
=−∫u1du
=−ln∣u∣
=−ln∣cosx∣
=ln∣secx∣
Therefore IF=eln∣secx∣=secx
Multiplying the entire equation by secx:
secx⋅dxdy+ysecxtanx=sec2x
The left side is the derivative of (ysecx) by the product rule.
dxd(ysecx)=sec2x
Integrating both sides:
∫dxd(ysecx)dx=∫sec2xdx
ysecx=tanx+c
ysecx−tanx=c
where c is an arbitrary constant.