dydx+2ytanx=y2 ....(1)
which is a Bernoulli's differential eqn
Dividing (1) by y2, we get
y−2dydx+2y−1tanx=1 ....(2)
Put z=y−1
⇒dzdx=−1y2dydx
So, eqn (2) becomes
−dzdx+2ztanx=1
⇒dzdx−2ztanx=−1 ...(3)
which is a linear differential equation with z as dependent variable.
Integrating factor I.F.=e∫Pdx
=e∫−2tanxdx
=e2logcosx
⇒I.F.=cos2x
Solution of (3) is given
zcos2x=∫cos2dx
zcos2x=∫1+cos2x2dx
⇒zcos2x=12(x+sin2x2)+C
⇒y−1cos2x=(x2+sin2x4)+C
⇒cos2x=(x2+sin2x4)y+Cy
On comparing with given solution,
A=2,B=4
A+B=6