2nd order linear ODE with constant coefficients MapleFiles/ET502/ LODE2ndOrder.mws example
> | restart; |
> | with(linalg): |
Warning, the protected names norm and trace have been redefined and unprotected
coefficients:
> | a0:=1;a1:=3;a2:=2; |
> | f:=exp(2*x); |
auxilary equation:
> | ax:=a0*m^2+a1*m+a2; |
> | solve(ax=0,m); |
fundamental set:
> | y1:=exp(-x); |
> | y2:=exp(-2*x); |
Wronskians:
> | A:=matrix(2,2,[y1,y2,diff(y1,x),diff(y2,x)]); |
> | W:=simplify(det(A)); |
Variation of parameter:
> | VP1:=simplify(-y2/W*f/a0); |
> | VP2:=simplify(y1/W*f/a0); |
> | u1:=simplify(int(VP1,x)); |
> | u2:=simplify(int(VP2,x)); |
complimentary solution:
> | yc:=c[1]*y1+c[2]*y2; |
particular solution of non-homogeneous equation:
> | yp:=u1*y1+u2*y2; |
> | yp:=simplify(yp); |
General solution of non-homogeneous equation:
> | y:=yc+yp; |
Solution curves of homogeneous equation:
> | p:={seq(seq(i*exp(-x)+j*exp(-2*x),i=-2..2),j=-2..2)}: |
> | plot(p,x=-1.5..0.5,color=black); |
> |