75.31.6 problem 820

Internal problem ID [17194]
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.2 The method of undetermined coefficients. Exercises page 239
Problem number : 820
Date solved : Thursday, March 13, 2025 at 09:18:35 AM
CAS classification : system_of_ODEs

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

With initial conditions

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

Maple. Time used: 0.074 (sec). Leaf size: 27
ode:=[diff(x(t),t) = y(t)-x(t)+exp(t), diff(y(t),t) = x(t)-y(t)+exp(t)]; 
ic:=x(0) = 0y(0) = 1; 
dsolve([ode,ic]);
 
\begin{align*} x \left (t \right ) &= -\frac {{\mathrm e}^{-2 t}}{2}+{\mathrm e}^{t}-\frac {1}{2} \\ y \left (t \right ) &= \frac {{\mathrm e}^{-2 t}}{2}+{\mathrm e}^{t}-\frac {1}{2} \\ \end{align*}
Mathematica. Time used: 0.005 (sec). Leaf size: 40
ode={D[x[t],t]==y[t]-x[t]+Exp[t],D[y[t],t]==x[t]-y[t]+Exp[t]}; 
ic={x[0]==0,y[0]==1}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)\to -\frac {e^{-2 t}}{2}+e^t-\frac {1}{2} \\ y(t)\to \frac {e^{-2 t}}{2}+e^t-\frac {1}{2} \\ \end{align*}
Sympy. Time used: 0.114 (sec). Leaf size: 27
from sympy import * 
t = symbols("t") 
x = Function("x") 
y = Function("y") 
ode=[Eq(x(t) - y(t) - exp(t) + Derivative(x(t), t),0),Eq(-x(t) + y(t) - exp(t) + Derivative(y(t), t),0)] 
ics = {} 
dsolve(ode,func=[x(t),y(t)],ics=ics)
 
\[ \left [ x{\left (t \right )} = C_{1} - C_{2} e^{- 2 t} + e^{t}, \ y{\left (t \right )} = C_{1} + C_{2} e^{- 2 t} + e^{t}\right ] \]