Section 2.2 Homogeneous Linear ODEs with Constant Coefficients

We want to solve the equation: y’’+ ay’ + by = 0

DSolve[y''[x]+y'[x]-2 y[x]==0,y[x],x]

eqn=y''[x]+y'[x]-2y[x]==0

sol=DSolve[{eqn,y[0]==4, y'[0]==-5},y[x],x]

Expand[%]

DSolve[{eqn,y[0]==4, y'[0]==-5},y,x]

f[x_]:= y[x] /. sol

Plot[f[x],{x,0, 2},PlotRange->{{0,2},{0,8}}]

Solve: y’’ + 6y’ + 9y = 0 (double root)

eqn=y''[x]+6 y'[x] + 9 y[x] ==0

sol=DSolve[eqn,y[x],x]

Factor[sol]

Solve: y’’ + y’ + 0.25 y = 0 (double root)

eqn=y''[x]+ y'[x]+0.25 y[x]==0

sol=DSolve[{eqn,y[0]==3, y'[0]==-3.5},y,x]

f[x_]:= y[x] /. sol

Plot[f[x],{x,0, 12},PlotRange->{{0,12},{-1,3}}]

Solve: y’’ + 0.4 y’ + 9.04 y = 0 (complex roots)

eqn=y''[x]+0.4 y'[x]+9.04 y[x]==0

sol=DSolve[eqn,y[x],x]

Factor[sol]

sol=DSolve[{eqn,y[0]==0,y'[0]==3},y,x]

f[x_]:= y[x] /. sol

sol=DSolve[{eqn,y[0]==0, y'[0]==3},y,x]

Plot[f[x],{x,0, 30},PlotRange->{{0,30},{-1,1}}]

Solve: y’’ +  36 y = 0 (complex roots)

eqn=y''[x]+36 y[x]==0

sol=DSolve[eqn,y[x],x]

Solve: y’’ - y = 0, y(0) = 1, y’(0) = -2

eqn=y''[x]-y[x]==0

sol=DSolve[{eqn,y[0]==1,y'[0]==-2},y[x],x]

Expand[%]

sol=DSolve[{eqn,y[0]==1,y'[0]==-2},y,x]

f[x_]:= y[x] /. sol

Plot[f[x],{x,-5, 5}]