We have,
cos2xdydx+y=tanx
dydx+sec2x(y)=sec2xtanx
We know that the general equation
dydx+Py=Q
Here,
P=sec2x,Q=sec2xtanx
Since, integrating factor
I.F=e∫Pdx
I.F=e∫sec2xdx
I.F=etanx
We know that the general solution,
y×I.F=∫(Q×I.F)dx+C
Therefore,
y×etanx=∫(sec2xtanx)etanxdx+C
Let t=tanx
dt=sec2xdx
Therefore,
y×et=∫tetdt+C
y×et=tet−∫1etdt+C
y×et=tet−et+C
On putting the value of t, we get
y×etanx=tanxetanx−etanx+C
Hence, this is the answer.