Given equation can be written as
x2dydx−xy=2cos2(y2x), x≠0
⇒x2dydx−xy2cos2(y2x)=1⇒sec2(y2x)2[x2dydx−xy]=1
Dividing both sides by x3, we get
sec2(y2x)2⎡⎢
⎢
⎢⎣xdydx−yx2⎤⎥
⎥
⎥⎦=1x3⇒ddx[tan(y2x)]=1x3
Integrating both sides, we get
tan(y2x)=−12x2+k
Substituting x=1, y=π2, we get
k=32, therefore, tan(y2x)=12x2+32tan(y2x)=−12x2+32 is the required solution.