9.6.22 problem 22

Internal problem ID [2979]
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 : 22
Date solved : Tuesday, September 30, 2025 at 06:13:36 AM
CAS classification : [_linear]

\begin{align*} 2 y-x y-3+x y^{\prime }&=0 \end{align*}

With initial conditions

\begin{align*} y \left (1\right )&=1 \\ \end{align*}
Maple. Time used: 0.027 (sec). Leaf size: 19
ode:=2*y(x)-x*y(x)-3+x*diff(y(x),x) = 0; 
ic:=[y(1) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {-3 x -3+7 \,{\mathrm e}^{x -1}}{x^{2}} \]
Mathematica. Time used: 0.021 (sec). Leaf size: 24
ode=(2*y[x]-x*y[x]-3)+x*D[y[x],x]==0; 
ic={y[1]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {7 e^x-3 e (x+1)}{e x^2} \end{align*}
Sympy. Time used: 0.177 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*y(x) + x*Derivative(y(x), x) + 2*y(x) - 3,0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {-3 + \frac {7 e^{x}}{e x} - \frac {3}{x}}{x} \]