15.6.6 problem 6

Internal problem ID [2963]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 10, page 41
Problem number : 6
Date solved : Tuesday, March 04, 2025 at 03:36:09 PM
CAS classification : [_linear]

\begin{align*} y x^{\prime }+\left (1+y \right ) x&={\mathrm e}^{y} \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 19
ode:=y*diff(x(y),y)+(1+y)*x(y) = exp(y); 
dsolve(ode,x(y), singsol=all);
 
\[ x \left (y \right ) = \frac {{\mathrm e}^{y}+2 \,{\mathrm e}^{-y} c_{1}}{2 y} \]
Mathematica. Time used: 0.071 (sec). Leaf size: 18
ode=y*D[x[y],y]+(1+y)*x[y]==Exp[-y]; 
ic={}; 
DSolve[{ode,ic},x[y],y,IncludeSingularSolutions->True]
 
\[ x(y)\to \frac {e^{-y} (y+c_1)}{y} \]
Sympy. Time used: 0.295 (sec). Leaf size: 14
from sympy import * 
y = symbols("y") 
x = Function("x") 
ode = Eq(y*Derivative(x(y), y) + (y + 1)*x(y) - exp(y),0) 
ics = {} 
dsolve(ode,func=x(y),ics=ics)
 
\[ x{\left (y \right )} = \frac {C_{1} e^{- y} + \frac {e^{y}}{2}}{y} \]