若-cosx换成+cosx,则易解。同除以(1-x^2)dx得一阶线性微分方程,用通解公式得解为y=sinx/(1-x^2)+c/(1-x^2),代入y(0)=1得c=1,故y=(1+sinx)/(1-x^2).
(1-x^2)dy+(2xy-cosx)dx=0
(1-x^2)dy+yd(x^2-1)=cosxdx
dy/(1-x^2)+yd(1/(1-x^2))=cosxdx/(1-x^2)^2
d(y/(1-x^2))=cosxdx/(1-x^2)^2
通解y/(1-x^2)=∫cosxdx/(1-x^2)^2