pag. 200, #4. Superposition principle (with the initial conditions x(0)=1, x'(0)=-1) DO # 6 with initial conditions y(0)=-1, y'(0)=2diffeq:=diff(x(t),t$2)-4*diff(x(t),t)+3*x(t)=-2*exp(t);
inits:=x(0)=1,D(x)(0)=-1;First, we form the characteristic equation using the coefficients from the differential equation. Then we solve that.char_eq:=r^2-4*r+3=0;
ev:=solve(%,r);Finally, we form the general solution to the nonhomogeneous equation by adding to the general solution of the homogeneous associated equation, the given particular solution.gsol:=x(t)=c1*exp(1*t)+c2*exp(3*t)+t*exp(t);subs(t=0,rhs(gsol)=1):
eq1:=subs(x(t)=1,lhs(gsol))=subs(t=0,rhs(gsol));
diff(gsol,t);
eq2:=subs(diff(x(t),t)=-1,lhs(%))=subs(t=0,rhs(%));csol:=solve({eq1,eq2},{c1,c2});specsol:=subs(csol,gsol);Checking the differential equation and the initial values.subs(specsol,diffeq):
simplify(%);subs(t=0,rhs(specsol)):
simplify(%);diff(specsol,t):
subs(t=0,rhs(%)):
simplify(%);pag.187, #26. Third order linear constant coefficient equation.DO # 28restart:
interface(verboseproc,showassumed=0):
diffeq:=diff(y(x),x$3)+diff(y(x),x$2)-6*diff(y(x),x)+4*y(x)=0;One way to derive the characteristic equation is to substitute LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYmLUkjbWlHRiQ2I1EhRictRiM2J0YrLUYjNiYtRiw2JVEieUYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1JI21vR0YkNi1RMCZBcHBseUZ1bmN0aW9uO0YnL0Y6USdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGRC8lKXN0cmV0Y2h5R0ZELyUqc3ltbWV0cmljR0ZELyUobGFyZ2VvcEdGRC8lLm1vdmFibGVsaW1pdHNHRkQvJSdhY2NlbnRHRkQvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR0ZTLUkobWZlbmNlZEdGJDYkLUYjNiQtRiw2JVEieEYnRjZGOUZARkBGQC1GPTYtUSI9RidGQEZCRkVGR0ZJRktGTUZPL0ZSUSwwLjI3Nzc3NzhlbUYnL0ZVRlxvLUklbXN1cEdGJDYlLUY9Ni1RLyZFeHBvbmVudGlhbEU7RidGQEZCRkVGR0ZJRktGTUZPRlEvRlVRLDAuMTExMTExMWVtRictRiM2Ji1GLDYlUSJyRidGNkY5LUY9Ni1RMSZJbnZpc2libGVUaW1lcztGJ0ZARkJGRUZHRklGS0ZNRk9GUUZURmVuRkAvJTFzdXBlcnNjcmlwdHNoaWZ0R1EiMEYnRkBGK0ZA into the differential equation and collect terms to factor out the exponential. This procedure gives us the characteristic equation.subs(y(x)=exp(r*x),diffeq);
collect(%,exp(r*x));As the equation is the 3rd order, the characteristic equation is the cubic.char_eq:=lhs(%)/exp(r*x);ev:=solve(%,r);The three solutions to the characteristic equation arereal, then we can write down the general solution.sol:=y(x)=c1*exp(1*x)+c2*exp((sqrt(5)-1)*x)+c3*exp((-1+sqrt(5))*x);subs(sol,diffeq):
simplify(%);pag.187, #49(a). Numerical approximation to eigenvalues.DO #49(b) restart:
diffeq:=3*diff(y(x),x$3)+18*diff(y(x),x$2)+13*diff(y(x),x)-19*y(x)=0;subs(y(x)=exp(r*x),%);
simplify(%);
collect(%,exp(r*x));char_eqn:=%/exp(r*x);We solve for floating point decimal approximations to the eigenvalues. Rather than use Newton's method, we have employed Maple's built in fsolve command.ev:=fsolve(%,r);sol:=y(x)=c1*exp(ev[1]*x)+c2*exp(ev[2]*x)+c3*exp(ev[3]*x);Checking.subs(sol,diffeq):
expand(%);Note that the result is not exactly zero because of the approximation, but that the coefficients are quite close to zero.