原方程=>dy/dx+2x/(x^2-1)*y=cosx/(x^2-1)
对应的齐次方程:dy/dx+2x/(x^2-1)*y=0
分离变量得 1/y*dy=-2x/(x^2-1)*dx
两边积分得 ln|y|=-ln|x^2-1|+lnC1
y=C/(x^2-1)
下面用待定系数法求解非齐次方程通解
令y=C(x)/(x^2-1)
则C'(x)/(x^2-1)=cosx/(x^2-1)
C'(x)=cosx
C(x)=∫cosxdx=sinx+C
非齐次方程通解:y=(sinx+C)/(x^2-1)