ABSTRACT

To solve the differential equation de involving Y = y(x), we use the command dsolve(de,Y).

> y:=’y’: > Y:=y(x);

Y := y(x);

> dY := diff(Y,x); ∂

∂x y(x)

> ddY := diff(%,x); ∂2

∂x2 y(x)

> de := ddY+5*dY+6*Y = sin(x)*exp(-3*x);

de := ∂2

∂x2 y(x) + 5

∂x y(x) + 6 y(x) = sin(x) e−3x

> ans := dsolve(de, Y);

ans := y(x) = e−3 x C2 + e−2 x C1 + 1 2 (cos(x)− sin(x)) e−3 x

We found that the general solution to the differential equation

y′′ + 5y′ + 6y = sinx e−3x

is y =

1 2 (cos(x)− sin(x))e−3x + c1e−3x + c2e−2x,

where c1 and c2 are any constants. We use maple to check the solution. There are two methods. First we check the solution by computing derivatives and

sol := 1/2 cos(x)e−3 x − 1/2 sin(x)e−3 x + C1 e−3 x + C2 e−2 x

> dsol:=diff(sol,x);

dsol := sin(x)e−3 x − 2 cos(x)e−3 x − 3 C1 e−3 x − 2 C2 e−2 x

> ddsol:=diff(sol,x,x);

ddsol := 7 cos(x)e−3 x − sin(x)e−3 x + 9 C1 e−3 x + 4 C2 e−2 x

> simplify(ddsol + 5*dsol + 6*sol);

This confirms the solution found before. A quicker method is to use maple’s odtest function.