75.5.9 problem 108

Internal problem ID [16674]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 5. Homogeneous equations. Exercises page 44
Problem number : 108
Date solved : Monday, March 31, 2025 at 03:04:54 PM
CAS classification : [_linear]

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

Maple. Time used: 0.001 (sec). Leaf size: 19
ode:=x+y(x)-2+(1-x)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (-1+x \right ) \ln \left (-1+x \right )+1+\left (-1+x \right ) c_1 \]
Mathematica. Time used: 0.042 (sec). Leaf size: 27
ode=x+y[x]-2+(1-x)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to (x-1) \log (1-x)+(-1+c_1) x+2-c_1 \]
Sympy. Time used: 0.267 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x + (1 - x)*Derivative(y(x), x) + y(x) - 2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} x - C_{1} + x \log {\left (x - 1 \right )} - \log {\left (x - 1 \right )} + 1 \]