How to establish differential equation function in MATLAB How to establish differential equation function in MATLAB, such as: dy / DX = XY, (when x = 0, y = 1), in 0=

How to establish differential equation function in MATLAB How to establish differential equation function in MATLAB, such as: dy / DX = XY, (when x = 0, y = 1), in 0=


syms x
y=dsolve('Dy=x*y','y(0)=1','x')
Y=subs(y,x,0:0.1:4);
plot(0:0.1:4,Y)



Matlab to calculate symbolic expression
Calculate the value of the symbolic expression f (x) = x + cos (x) - sin (x) at x = π - 1, and set the result to the following precision: 1,2,10,20,50 significant digits after the decimal point


f=sym('x+cos(x)-sin(x)')
a=subs(f,x,pi-1);
b1=vpa(a,1);
b2=vpa(a,2);
b3=vpa(a,10);
b4=vpa(a,20);



Because the original function of Cotx is ln (SiNx) + C, the original function of cot (arcsinx) is ln (sin (arcsinx)) + C = LNX + C, differential
After 1 / x = cot (arcsinx), what's going on


You should forget the composition arcsinx when you seek the derivative, and you get 1 / x = cot (arcsinx) * (arcsinx) ', and cot (arcsinx) = cos (arcsinx) / sin (arcsinx) = (1-sin (arcsinx) ^ 2) ^ (1 / 2) / x = (1-x ^ 2) ^ (1 / 2) / X