80.7.22 problem B 14

Internal problem ID [21341]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 7. System of first order equations. Excercise 7.6 at page 162
Problem number : B 14
Date solved : Thursday, October 02, 2025 at 07:28:35 PM
CAS classification : system_of_ODEs

\begin{align*} x^{\prime }&=x+3 y \left (t \right )+2 t\\ y^{\prime }\left (t \right )&=x-y \left (t \right )+t^{2} \end{align*}
Maple. Time used: 0.054 (sec). Leaf size: 53
ode:=[diff(x(t),t) = x(t)+3*y(t)+2*t, diff(y(t),t) = x(t)-y(t)+t^2]; 
dsolve(ode);
 
\begin{align*} x \left (t \right ) &= {\mathrm e}^{-2 t} c_2 +{\mathrm e}^{2 t} c_1 -\frac {3 t^{2}}{4}-\frac {t}{2}-\frac {7}{8} \\ y \left (t \right ) &= -{\mathrm e}^{-2 t} c_2 +\frac {{\mathrm e}^{2 t} c_1}{3}-t +\frac {1}{8}+\frac {t^{2}}{4} \\ \end{align*}
Mathematica. Time used: 0.309 (sec). Leaf size: 94
ode={D[x[t],t]==x[t]+3*y[t]+2*t,D[y[t],t]==x[t]-y[t]+t^2}; 
ic={}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \frac {1}{8} \left (-6 t^2-4 t+2 (c_1-3 c_2) e^{-2 t}+6 (c_1+c_2) e^{2 t}-7\right )\\ y(t)&\to \frac {1}{8} e^{-2 t} \left (e^{2 t} \left (2 t^2-8 t+1\right )+2 (c_1+c_2) e^{4 t}-2 c_1+6 c_2\right ) \end{align*}
Sympy. Time used: 0.124 (sec). Leaf size: 56
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(-2*t - x(t) - 3*y(t) + Derivative(x(t), t),0),Eq(-t**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 )} = - C_{1} e^{- 2 t} + 3 C_{2} e^{2 t} - \frac {3 t^{2}}{4} - \frac {t}{2} - \frac {7}{8}, \ y{\left (t \right )} = C_{1} e^{- 2 t} + C_{2} e^{2 t} + \frac {t^{2}}{4} - t + \frac {1}{8}\right ] \]