Laplace Transform Method:
Ordinary Differential Equation
M.M. Yovanovich
LPTODE6.MWS
> restart:
> assume(m>0,n>0,p>0,omega>0):
> ode:= diff(theta(t),t) + m*theta(t)=n+p*cos(omega*t);
> sol:= dsolve(ode, theta(t));
> ic:=simplify(subs(t=0, rhs(sol)))=thetai;
> const:= solve(ic, _C1); _C1:= %;
> sol1:= expand(sol): sol1:= simplify(%);
> sol12:= simplify(subs(p=0, sol1));
> with(inttrans):
> alias(f(s) = laplace(theta(t),t,s)):
> laplace(ode, t,s);
> lptode:= subs(theta(0) = thetai, %);
> solve(%, f(s));
> sol2:= invlaplace(%, s, t);
> sol3:= simplify(subs(n=0, p=0, sol2));
Here we obtain the solution directly by means of the Laplace transform method.
> sol4:= dsolve({ode, theta(0)=thetai}, theta(t), method=laplace);
>