在命令窗口直接输入
y=dsolve('D2y+2*Dy+2*y=x*exp(-x)','Dy(0)=0,y(0)=0','x')
可以得到结果
y=(sin(x)*(cos(x) + x*sin(x)))/exp(x) - (cos(x)*(sin(x) - x*cos(x)))/exp(x) - sin(x)/exp(x)
在命令窗口直接输入
y=dsolve('D2y+2*Dy+2*y=x*exp(-x)','Dy(0)=0,y(0)=0','x')
可以得到结果
y=(sin(x)*(cos(x) + x*sin(x)))/exp(x) - (cos(x)*(sin(x) - x*cos(x)))/exp(x) - sin(x)/exp(x)