30.3.22 problem 23

Internal problem ID [7478]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.4, Exact equations. Exercises. page 64
Problem number : 23
Date solved : Tuesday, September 30, 2025 at 04:38:09 PM
CAS classification : [_separable]

\begin{align*} {\mathrm e}^{t} y+t \,{\mathrm e}^{t} y+\left (t \,{\mathrm e}^{t}+2\right ) y^{\prime }&=0 \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=-1 \\ \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 14
ode:=exp(t)*y(t)+t*exp(t)*y(t)+(t*exp(t)+2)*diff(y(t),t) = 0; 
ic:=[y(0) = -1]; 
dsolve([ode,op(ic)],y(t), singsol=all);
 
\[ y = -\frac {2}{t \,{\mathrm e}^{t}+2} \]
Mathematica. Time used: 0.104 (sec). Leaf size: 16
ode=( Exp[t]*y[t]+t*Exp[t]*y[t]  )+( t*Exp[t]+2  )*D[y[t],t]==0; 
ic={y[0]==-1}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to -\frac {2}{e^t t+2} \end{align*}
Sympy
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(t*y(t)*exp(t) + (t*exp(t) + 2)*Derivative(y(x), x) + y(t)*exp(t),0) 
ics = {y(0): -1} 
dsolve(ode,func=y(t),ics=ics)
 
ValueError : Couldnt solve for initial conditions