15.17.3 problem 3

Internal problem ID [3239]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 26, page 115
Problem number : 3
Date solved : Sunday, March 30, 2025 at 01:23:34 AM
CAS classification : system_of_ODEs

\begin{align*} \frac {d}{d t}x \left (t \right )+2 x \left (t \right )&=3 t\\ \frac {d}{d t}x \left (t \right )+2 \frac {d}{d t}y \left (t \right )+y \left (t \right )&=\cos \left (2 t \right ) \end{align*}

Maple. Time used: 0.324 (sec). Leaf size: 45
ode:=[diff(x(t),t)+2*x(t) = 3*t, diff(x(t),t)+2*diff(y(t),t)+y(t) = cos(2*t)]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= \frac {3 t}{2}-\frac {3}{4}+{\mathrm e}^{-2 t} c_2 \\ y \left (t \right ) &= -\frac {2 \,{\mathrm e}^{-2 t} c_2}{3}+\frac {4 \sin \left (2 t \right )}{17}+\frac {\cos \left (2 t \right )}{17}-\frac {3}{2}+{\mathrm e}^{-\frac {t}{2}} c_1 \\ \end{align*}
Mathematica. Time used: 0.31 (sec). Leaf size: 74
ode={D[x[t],t]+2*x[t]==3*t,D[x[t],t]+2*D[y[t],t]+y[t]==Cos[2*t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to \frac {3 t}{2}+c_1 e^{-2 t}-\frac {3}{4} \\ y(t)\to \frac {4}{17} \sin (2 t)+\frac {1}{17} \cos (2 t)+\frac {1}{6} \left (-4 c_1 e^{-2 t}+(4 c_1+6 c_2) e^{-t/2}-9\right ) \\ \end{align*}
Sympy. Time used: 0.274 (sec). Leaf size: 54
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-3*t + 2*x(t) + Derivative(x(t), t),0),Eq(y(t) - cos(2*t) + Derivative(x(t), t) + 2*Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = - \frac {3 C_{1} e^{- 2 t}}{2} + \frac {3 t}{2} - \frac {3}{4}, \ y{\left (t \right )} = C_{1} e^{- 2 t} + C_{2} e^{- \frac {t}{2}} + \frac {4 \sin {\left (2 t \right )}}{17} + \frac {\cos {\left (2 t \right )}}{17} - \frac {3}{2}\right ] \]