Hint : The equation has an integrating factor that depends on x .
So if I let M=e^y*x^2*cosx+1, then M with respect to y is x^2*e^y*cosx+y
If N=e^y*x^2*sinx, then N with respect to x is e^y(2xsinx-x^2+2cosx) right?
So if I use (Ms of y-Ns of x)/N=((x^2*e^y*cosx+y)-(e^y(2xsinx-x^2+2cosx))/(e^y*x^2*sinx).
But it's so hard to simplify this to get the integrating factor. Or am I doing something wrong?