19.1.21 problem 21

Internal problem ID [4233]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 21
Date solved : Tuesday, September 30, 2025 at 07:08:00 AM
CAS classification : [_separable]

\begin{align*} \left (1-x \right ) y^{\prime }&=x y \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 15
ode:=(1-x)*diff(y(x),x) = x*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_1 \,{\mathrm e}^{-x}}{-1+x} \]
Mathematica. Time used: 0.02 (sec). Leaf size: 23
ode=(1-x)*D[y[x],x]==x*y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {c_1 e^{-x}}{x-1}\\ y(x)&\to 0 \end{align*}
Sympy. Time used: 0.145 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*y(x) + (1 - x)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} e^{- x}}{x - 1} \]