29.3.10 problem 64

Internal problem ID [4672]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 3
Problem number : 64
Date solved : Tuesday, March 04, 2025 at 07:02:03 PM
CAS classification : [_Riccati]

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

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