23.1.605 problem 599

Internal problem ID [5212]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 599
Date solved : Tuesday, September 30, 2025 at 11:55:53 AM
CAS classification : [_exact, _rational]

\begin{align*} \left (x +y^{2}\right ) y^{\prime }+y&=b x +a \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 580
ode:=(x+y(x)^2)*diff(y(x),x)+y(x) = b*x+a; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {\left (6 b \,x^{2}+12 a x -12 c_1 +2 \sqrt {9 b^{2} x^{4}+36 b \,x^{3} a -36 b \,x^{2} c_1 +36 a^{2} x^{2}-72 a x c_1 +16 x^{3}+36 c_1^{2}}\right )^{{2}/{3}}-4 x}{2 \left (6 b \,x^{2}+12 a x -12 c_1 +2 \sqrt {9 b^{2} x^{4}+36 b \,x^{3} a -36 b \,x^{2} c_1 +36 a^{2} x^{2}-72 a x c_1 +16 x^{3}+36 c_1^{2}}\right )^{{1}/{3}}} \\ y &= -\frac {i \left (6 b \,x^{2}+12 a x -12 c_1 +2 \sqrt {9 b^{2} x^{4}+36 b \,x^{3} a -36 b \,x^{2} c_1 +36 a^{2} x^{2}-72 a x c_1 +16 x^{3}+36 c_1^{2}}\right )^{{2}/{3}} \sqrt {3}+4 i \sqrt {3}\, x +\left (6 b \,x^{2}+12 a x -12 c_1 +2 \sqrt {9 b^{2} x^{4}+36 b \,x^{3} a -36 b \,x^{2} c_1 +36 a^{2} x^{2}-72 a x c_1 +16 x^{3}+36 c_1^{2}}\right )^{{2}/{3}}-4 x}{4 \left (6 b \,x^{2}+12 a x -12 c_1 +2 \sqrt {9 b^{2} x^{4}+36 b \,x^{3} a -36 b \,x^{2} c_1 +36 a^{2} x^{2}-72 a x c_1 +16 x^{3}+36 c_1^{2}}\right )^{{1}/{3}}} \\ y &= \frac {i \left (6 b \,x^{2}+12 a x -12 c_1 +2 \sqrt {9 b^{2} x^{4}+36 b \,x^{3} a -36 b \,x^{2} c_1 +36 a^{2} x^{2}-72 a x c_1 +16 x^{3}+36 c_1^{2}}\right )^{{2}/{3}} \sqrt {3}+4 i \sqrt {3}\, x -\left (6 b \,x^{2}+12 a x -12 c_1 +2 \sqrt {9 b^{2} x^{4}+36 b \,x^{3} a -36 b \,x^{2} c_1 +36 a^{2} x^{2}-72 a x c_1 +16 x^{3}+36 c_1^{2}}\right )^{{2}/{3}}+4 x}{4 \left (6 b \,x^{2}+12 a x -12 c_1 +2 \sqrt {9 b^{2} x^{4}+36 b \,x^{3} a -36 b \,x^{2} c_1 +36 a^{2} x^{2}-72 a x c_1 +16 x^{3}+36 c_1^{2}}\right )^{{1}/{3}}} \\ \end{align*}
Mathematica. Time used: 5.06 (sec). Leaf size: 420
ode=(x+y[x]^2)*D[y[x],x]+y[x]==a+b*x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {-2\ 2^{2/3} x+\sqrt [3]{2} \left (\sqrt {16 x^3+9 \left (2 a x+b x^2+2 c_1\right ){}^2}+6 a x+3 b x^2+6 c_1\right ){}^{2/3}}{2 \sqrt [3]{\sqrt {16 x^3+9 \left (2 a x+b x^2+2 c_1\right ){}^2}+6 a x+3 b x^2+6 c_1}}\\ y(x)&\to \frac {i \sqrt [3]{2} \left (\sqrt {3}+i\right ) \left (\sqrt {36 a^2 x^2+36 a b x^3+72 a c_1 x+9 b^2 x^4+36 b c_1 x^2+16 x^3+36 c_1{}^2}+6 a x+3 b x^2+6 c_1\right ){}^{2/3}+2\ 2^{2/3} \left (1+i \sqrt {3}\right ) x}{4 \sqrt [3]{\sqrt {16 x^3+9 \left (2 a x+b x^2+2 c_1\right ){}^2}+6 a x+3 b x^2+6 c_1}}\\ y(x)&\to \frac {x-i \sqrt {3} x}{\sqrt [3]{2} \sqrt [3]{\sqrt {16 x^3+9 \left (2 a x+b x^2+2 c_1\right ){}^2}+6 a x+3 b x^2+6 c_1}}-\frac {i \left (\sqrt {3}-i\right ) \sqrt [3]{\sqrt {16 x^3+9 \left (2 a x+b x^2+2 c_1\right ){}^2}+6 a x+3 b x^2+6 c_1}}{2\ 2^{2/3}} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-a - b*x + (x + y(x)**2)*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out