29.21.27 problem 603

Internal problem ID [5197]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 21
Problem number : 603
Date solved : Sunday, March 30, 2025 at 06:51:41 AM
CAS classification : [[_1st_order, _with_linear_symmetries], _rational]

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

Maple. Time used: 0.007 (sec). Leaf size: 28
ode:=(1-x^2+y(x)^2)*diff(y(x),x) = 1+x^2-y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y^{2}+2 x y+x^{2}+2 \ln \left (-x +y\right )-c_1 = 0 \]
Mathematica. Time used: 0.374 (sec). Leaf size: 25
ode=(1-x^2+y[x]^2)D[y[x],x]==1+x^2-y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [e^{\frac {1}{2} (y(x)+x)^2} (x-y(x))=c_1,y(x)\right ] \]
Sympy. Time used: 6.116 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + (-x**2 + y(x)**2 + 1)*Derivative(y(x), x) + y(x)**2 - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ C_{1} + \frac {\left (x + y{\left (x \right )}\right )^{2}}{4} + \frac {\log {\left (x - y{\left (x \right )} \right )}}{2} = 0 \]