86.7.4 problem 4

Internal problem ID [23151]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 5. Linear equations of the second order with constant coefficients. Exercise 5c at page 83
Problem number : 4
Date solved : Thursday, October 02, 2025 at 09:23:31 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} z^{\prime \prime }-3 z^{\prime }+2 z&=4 \sin \left (3 t \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 27
ode:=diff(diff(z(t),t),t)-3*diff(z(t),t)+2*z(t) = 4*sin(3*t); 
dsolve(ode,z(t), singsol=all);
 
\[ z = {\mathrm e}^{2 t} c_1 +{\mathrm e}^{t} c_2 -\frac {14 \sin \left (3 t \right )}{65}+\frac {18 \cos \left (3 t \right )}{65} \]
Mathematica. Time used: 0.012 (sec). Leaf size: 37
ode=D[z[t],{t,2}]-3*D[z[t],t]+2*z[t]==4*Sin[3*t]; 
ic={}; 
DSolve[{ode,ic},z[t],t,IncludeSingularSolutions->True]
 
\begin{align*} z(t)&\to c_1 e^t+c_2 e^{2 t}+\frac {2}{65} (9 \cos (3 t)-7 \sin (3 t)) \end{align*}
Sympy. Time used: 0.131 (sec). Leaf size: 31
from sympy import * 
t = symbols("t") 
z = Function("z") 
ode = Eq(2*z(t) - 4*sin(3*t) - 3*Derivative(z(t), t) + Derivative(z(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=z(t),ics=ics)
 
\[ z{\left (t \right )} = C_{1} e^{t} + C_{2} e^{2 t} - \frac {14 \sin {\left (3 t \right )}}{65} + \frac {18 \cos {\left (3 t \right )}}{65} \]