75.32.5 problem 829

Internal problem ID [17211]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 3 (Systems of differential equations). Section 23.3 dAlemberts method. Exercises page 243
Problem number : 829
Date solved : Monday, March 31, 2025 at 03:44:46 PM
CAS classification : system_of_ODEs

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

Maple. Time used: 0.170 (sec). Leaf size: 35
ode:=[diff(x(t),t) = 2*x(t)+4*y(t)+cos(t), diff(y(t),t) = -x(t)-2*y(t)+sin(t)]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= -2 \cos \left (t \right )-3 \sin \left (t \right )+c_1 t +c_2 \\ y \left (t \right ) &= 2 \sin \left (t \right )+\frac {c_1}{4}-\frac {c_1 t}{2}-\frac {c_2}{2} \\ \end{align*}
Mathematica. Time used: 0.013 (sec). Leaf size: 150
ode={D[x[t],t]==2*x[t]+4*y[t]+Cos[t],D[y[t],t]==-x[t]-2*y[t]+Sin[t]}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to (2 t+1) \int _1^t(\cos (K[1]) (1-2 K[1])-4 K[1] \sin (K[1]))dK[1]+4 t \int _1^t(\cos (K[2]) K[2]+2 \sin (K[2]) K[2]+\sin (K[2]))dK[2]+2 c_1 t+4 c_2 t+c_1 \\ y(t)\to -t \int _1^t(\cos (K[1]) (1-2 K[1])-4 K[1] \sin (K[1]))dK[1]+(1-2 t) \int _1^t(\cos (K[2]) K[2]+2 \sin (K[2]) K[2]+\sin (K[2]))dK[2]+c_1 (-t)-2 c_2 t+c_2 \\ \end{align*}
Sympy. Time used: 0.158 (sec). Leaf size: 34
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-2*x(t) - 4*y(t) - cos(t) + Derivative(x(t), t),0),Eq(x(t) + 2*y(t) - sin(t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = 2 C_{1} t + C_{1} + 2 C_{2} - 3 \sin {\left (t \right )} - 2 \cos {\left (t \right )}, \ y{\left (t \right )} = - C_{1} t - C_{2} + 2 \sin {\left (t \right )}\right ] \]