Answer:
y=t−1+ce
−t
where t=tanx.
Given, cos
2
x
dx
dy
+y=tanx
⇒
dx
dy
+ysec
2
x=tanxsec
2
x ....(1)
Here P=sec
2
x⇒∫PdP=∫sec
2
xdx=tanx
∴I.F.=e
tanx
Multiplying (1) by I.F. we get
e
tanx
dx
dy
+e
tanx
ysec
2
x=e
tanx
tanxsec
2
x
Integrating both sides, we get
ye
tanx
=∫e
tanx
.tanxsec
2
xdx
Put tanx=t⇒sec
2
xdx=dt
∴ye
t
=∫te
t
dt=e
t
(t−1)+c
⇒y=t−1+ce
−t
where t=tanx