80.10.12 problem 39

Internal problem ID [21407]
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 11. Laplace transform. Excercise 11.7 at page 248
Problem number : 39
Date solved : Thursday, October 02, 2025 at 07:30:53 PM
CAS classification : system_of_ODEs

\begin{align*} x^{\prime }&=-x+y \left (t \right )\\ y^{\prime }\left (t \right )&=x+y \left (t \right ) \end{align*}

With initial conditions

\begin{align*} x \left (0\right )&=1 \\ y \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.062 (sec). Leaf size: 103
ode:=[diff(x(t),t) = -x(t)+y(t), diff(y(t),t) = x(t)+y(t)]; 
ic:=[x(0) = 1, y(0) = 0]; 
dsolve([ode,op(ic)]);
 
\begin{align*} x \left (t \right ) &= \left (\frac {1}{2}-\frac {\sqrt {2}}{4}\right ) {\mathrm e}^{\sqrt {2}\, t}+\left (\frac {1}{2}+\frac {\sqrt {2}}{4}\right ) {\mathrm e}^{-\sqrt {2}\, t} \\ y \left (t \right ) &= \left (\frac {1}{2}-\frac {\sqrt {2}}{4}\right ) \sqrt {2}\, {\mathrm e}^{\sqrt {2}\, t}-\left (\frac {1}{2}+\frac {\sqrt {2}}{4}\right ) \sqrt {2}\, {\mathrm e}^{-\sqrt {2}\, t}+\left (\frac {1}{2}-\frac {\sqrt {2}}{4}\right ) {\mathrm e}^{\sqrt {2}\, t}+\left (\frac {1}{2}+\frac {\sqrt {2}}{4}\right ) {\mathrm e}^{-\sqrt {2}\, t} \\ \end{align*}
Mathematica. Time used: 0.006 (sec). Leaf size: 79
ode={D[x[t],t]==-x[t]+y[t],D[y[t],t]==x[t]+y[t]}; 
ic={x[0] ==1,y[0]==0}; 
DSolve[{ode,ic},{x[t],y[t]},t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to \frac {1}{4} e^{-\sqrt {2} t} \left (-\left (\sqrt {2}-2\right ) e^{2 \sqrt {2} t}+2+\sqrt {2}\right )\\ y(t)&\to \frac {e^{-\sqrt {2} t} \left (e^{2 \sqrt {2} t}-1\right )}{2 \sqrt {2}} \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode=[Eq(x(t) - y(t) + Derivative(x(t), t),0),Eq(-x(t) - y(t) + Derivative(y(t), t),0)] 
ics = {x(0): 1, y(0): 0} 
dsolve(ode,func=x(t),ics=ics)
 
ValueError : 
Input to the funcs should be a list of functions.