62.14.4 problem Ex 4

Internal problem ID [12806]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter IV, differential equations of the first order and higher degree than the first. Article 25. Equations solvable for \(y\). Page 52
Problem number : Ex 4
Date solved : Wednesday, March 05, 2025 at 08:32:53 PM
CAS classification : [[_homogeneous, `class C`], _Riccati]

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

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