60.1.18 problem 18

Internal problem ID [10032]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 18
Date solved : Sunday, March 30, 2025 at 02:54:20 PM
CAS classification : [_Riccati]

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

Maple. Time used: 0.002 (sec). Leaf size: 62
ode:=diff(y(x),x)-y(x)^2-x*y(x)-x+1 = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-i \sqrt {\pi }\, {\mathrm e}^{-2} \sqrt {2}\, \operatorname {erf}\left (\frac {i \sqrt {2}\, \left (x -2\right )}{2}\right )+2 \,{\mathrm e}^{\frac {x \left (x -4\right )}{2}}-2 c_1}{i \sqrt {\pi }\, {\mathrm e}^{-2} \sqrt {2}\, \operatorname {erf}\left (\frac {i \sqrt {2}\, \left (x -2\right )}{2}\right )+2 c_1} \]
Mathematica. Time used: 0.318 (sec). Leaf size: 88
ode=D[y[x],x]- y[x]^2 - x*y[x] - x + 1==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -1+\frac {e^{\frac {1}{2} (x-4) x}}{-\int _1^xe^{\frac {1}{2} (K[1]-4) K[1]}dK[1]+c_1} \\ y(x)\to -1 \\ y(x)\to -\frac {e^{\frac {1}{2} (x-4) x}}{\int _1^xe^{\frac {1}{2} (K[1]-4) K[1]}dK[1]}-1 \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*y(x) - x - y(x)**2 + Derivative(y(x), x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : bad operand type for unary -: list