matlab求解微分方程的通解问题
matlab求解微分方程的通解问题
解某微分方程:x^2*D2y+x*Dy+(x^2-1/2)*y=0,初值:y(pi/2)=2,Dy(pi/2)=-2/pi,书本标准答案为:
ans=2^(1/2)*pi*^(1/2)/x^(1/2)*sin(x);
但我运行:dsolve('x^2*D2y+x*Dy+(x^2-1/2)*y=0','y(pi/2)=2,Dy(pi/2)=-2/pi','x')
ans =
(2*bessely(-2^(1/2)/2,x)*(2^(1/2)*besselj(-2^(1/2)/2,pi/2) - besselj(-2^(1/2)/2,pi/2) + pi*besselj(1 - 2^(1/2)/2,pi/2)))/(pi*(besselj(1 - 2^(1/2)/2,pi/2)*bessely(-2^(1/2)/2,pi/2) - bessely(1 - 2^(1/2)/2,pi/2)*besselj(-2^(1/2)/2,pi/2))) - (2*besselj(-2^(1/2)/2,x)*(2^(1/2)*bessely(-2^(1/2)/2,pi/2) - bessely(-2^(1/2)/2,pi/2) + pi*bessely(1 - 2^(1/2)/2,pi/2)))/(pi*(besselj(1 - 2^(1/2)/2,pi/2)*bessely(-2^(1/2)/2,pi/2) - bessely(1 - 2^(1/2)/2,pi/2)*besselj(-2^(1/2)/2,pi/2)))
即使我simpify(ans),j结果还是一样,怎么回事啊?
syms x y
y=sqrt(2*pi/x)*sin(x);y1=diff(y,'x');y2=diff(y,'x',2);
h=x^2*y2+x*y1+(x^2-1/2)*y;h=simplify(h)
结果:
h =
-1/4/x*2^(1/2)*sin(x)*pi^(1/2)/(1/x)^(1/2)
可见不等于0,=y,说明原答案有问题