89.8.20 problem 22

Internal problem ID [24480]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 4. Additional topics on equations of first order and first degree. Exercises at page 66
Problem number : 22
Date solved : Thursday, October 02, 2025 at 10:41:33 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

With initial conditions

\begin{align*} y \left (3\right )&=7 \\ \end{align*}
Maple. Time used: 0.203 (sec). Leaf size: 31
ode:=x+y(x)-4-(3*x-y(x)-4)*diff(y(x),x) = 0; 
ic:=[y(3) = 7]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -\frac {2 x}{\operatorname {LambertW}\left (-\frac {\left (x -2\right ) {\mathrm e}^{-\frac {1}{2}}}{2}\right )}+\frac {4}{\operatorname {LambertW}\left (-\frac {\left (x -2\right ) {\mathrm e}^{-\frac {1}{2}}}{2}\right )}+x \]
Mathematica. Time used: 62.276 (sec). Leaf size: 165
ode=(x+y[x]-4 )-(3*x-y[x]-4 )*D[y[x],x]==0; 
ic={y[3]==7}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [-\frac {2^{2/3} \left (x \left (-\log \left (\frac {2-x}{y(x)-3 x+4}\right )\right )+x \log \left (-\frac {x-y(x)}{y(x)-3 x+4}\right )+y(x) \left (\log \left (\frac {2-x}{y(x)-3 x+4}\right )-\log \left (-\frac {x-y(x)}{y(x)-3 x+4}\right )+1+\log (2)\right )-3 x-x \log (6)+x \log (3)+4\right )}{9 (x-y(x))}=\frac {1}{9} 2^{2/3} \log (x-2)+\frac {1}{18} \left (-\frac {-2+\log (2)-3 \log (3)+3 \log (6)}{\sqrt [3]{2}}+2 i 2^{2/3} \pi \right ),y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x - (3*x - y(x) - 4)*Derivative(y(x), x) + y(x) - 4,0) 
ics = {y(3): 7} 
dsolve(ode,func=y(x),ics=ics)
 
ValueError : Couldnt solve for initial conditions