(应用常数变易法)
∵xy'-2y=0 ==>dy/y=2dx/x
==>ln│y│=2ln│x│+ln│C│ (C是积分常数)
==>y=Cx²
∴设原方程的解为y=C(x)x² (C(x)表示关于x的函数)
∵代入原方程,得C'(x)x³+2C(x)x²-2C(x)x²=x³cosx
==>C'(x)x³=x³cosx
==>C'(x)=cosx
==>C(x)=sinx+C (C是积分常数)
∴y=C(x)x²=(sinx+C)x²
故原方程的通解是y=(sinx+C)x² (C是积分常数).