65.14.1 problem 26.1 (i)

Internal problem ID [13738]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 26, Explicit solutions of coupled linear systems. Exercises page 257
Problem number : 26.1 (i)
Date solved : Wednesday, March 05, 2025 at 10:14:42 PM
CAS classification : system_of_ODEs

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

With initial conditions

\begin{align*} x \left (0\right ) = 0\\ y \left (0\right ) = 1 \end{align*}

Maple. Time used: 0.056 (sec). Leaf size: 51
ode:=[diff(x(t),t) = 4*x(t)-y(t), diff(y(t),t) = 2*x(t)+y(t)+t^2]; 
ic:=x(0) = 0y(0) = 1; 
dsolve([ode,ic]);
 
\begin{align*} x \left (t \right ) &= \frac {5 \,{\mathrm e}^{2 t}}{4}-\frac {29 \,{\mathrm e}^{3 t}}{27}-\frac {t^{2}}{6}-\frac {5 t}{18}-\frac {19}{108} \\ y \left (t \right ) &= \frac {5 \,{\mathrm e}^{2 t}}{2}-\frac {29 \,{\mathrm e}^{3 t}}{27}-\frac {7 t}{9}-\frac {23}{54}-\frac {2 t^{2}}{3} \\ \end{align*}
Mathematica. Time used: 0.227 (sec). Leaf size: 274
ode={D[x[t],t]==4*x[t]-y[t],D[y[t],t]==2*x[t]+y[t]+t^2}; 
ic={x[0]==0,y[0]==1}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to -e^{2 t} \left (\left (2 e^t-1\right ) \int _1^0e^{-3 K[1]} \left (-1+e^{K[1]}\right ) K[1]^2dK[1]+\left (1-2 e^t\right ) \int _1^te^{-3 K[1]} \left (-1+e^{K[1]}\right ) K[1]^2dK[1]-\left (e^t-1\right ) \left (-\int _1^te^{-3 K[2]} \left (-1+2 e^{K[2]}\right ) K[2]^2dK[2]+\int _1^0e^{-3 K[2]} \left (-1+2 e^{K[2]}\right ) K[2]^2dK[2]-1\right )\right ) \\ y(t)\to e^{2 t} \left (-2 \left (e^t-1\right ) \int _1^0e^{-3 K[1]} \left (-1+e^{K[1]}\right ) K[1]^2dK[1]+2 \left (e^t-1\right ) \int _1^te^{-3 K[1]} \left (-1+e^{K[1]}\right ) K[1]^2dK[1]+\left (e^t-2\right ) \left (-\int _1^te^{-3 K[2]} \left (-1+2 e^{K[2]}\right ) K[2]^2dK[2]+\int _1^0e^{-3 K[2]} \left (-1+2 e^{K[2]}\right ) K[2]^2dK[2]-1\right )\right ) \\ \end{align*}
Sympy. Time used: 0.165 (sec). Leaf size: 61
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-4*x(t) + y(t) + Derivative(x(t), t),0),Eq(-t**2 - 2*x(t) - y(t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = \frac {C_{1} e^{2 t}}{2} + C_{2} e^{3 t} - \frac {t^{2}}{6} - \frac {5 t}{18} - \frac {19}{108}, \ y{\left (t \right )} = C_{1} e^{2 t} + C_{2} e^{3 t} - \frac {2 t^{2}}{3} - \frac {7 t}{9} - \frac {23}{54}\right ] \]