23.1.334 problem 320

Internal problem ID [4941]
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 : 320
Date solved : Tuesday, September 30, 2025 at 09:03:30 AM
CAS classification : [_linear]

\begin{align*} x \left (1+x \right ) y^{\prime }&=\left (1+x \right ) \left (x^{2}-1\right )+\left (x^{2}+x -1\right ) y \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 19
ode:=x*(1+x)*diff(y(x),x) = (1+x)*(x^2-1)+(x^2+x-1)*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\left (1+x \right ) \left (-{\mathrm e}^{x} c_1 +x \right )}{x} \]
Mathematica. Time used: 0.091 (sec). Leaf size: 86
ode=x*(1+x)*D[y[x],x]==(x+1)*(x^2-1)+(x^2+x-1)*y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \exp \left (\int _1^x\frac {K[1]^2+K[1]-1}{K[1] (K[1]+1)}dK[1]\right ) \left (\int _1^x\frac {\exp \left (-\int _1^{K[2]}\frac {K[1]^2+K[1]-1}{K[1] (K[1]+1)}dK[1]\right ) \left (K[2]^2-1\right )}{K[2]}dK[2]+c_1\right ) \end{align*}
Sympy. Time used: 0.239 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*(x + 1)*Derivative(y(x), x) - (x + 1)*(x**2 - 1) - (x**2 + x - 1)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{x} + \frac {C_{1} e^{x}}{x} - x - 1 \]