29.11.6 problem 297

Internal problem ID [4897]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 11
Problem number : 297
Date solved : Sunday, March 30, 2025 at 04:09:31 AM
CAS classification : [_rational, [_1st_order, `_with_symmetry_[F(x),G(x)]`], _Riccati]

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

Maple. Time used: 0.002 (sec). Leaf size: 14
ode:=(-x^2+1)*diff(y(x),x) = 1-(2*x-y(x))*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = x +\frac {1}{c_1 -\operatorname {arctanh}\left (x \right )} \]
Mathematica. Time used: 0.25 (sec). Leaf size: 52
ode=(1-x^2)D[y[x],x]==1-(2 x-y[x])y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x \log (1-x)-x \log (x+1)+2 c_1 x+2}{\log (1-x)-\log (x+1)+2 c_1} \\ y(x)\to x \\ \end{align*}
Sympy. Time used: 0.441 (sec). Leaf size: 134
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((1 - x**2)*Derivative(y(x), x) + (2*x - y(x))*y(x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {- 3 x^{5} \log {\left (x - 1 \right )} + 3 x^{5} \log {\left (x + 1 \right )} + 10 x^{4} + 6 x^{3} \log {\left (x - 1 \right )} - 6 x^{3} \log {\left (x + 1 \right )} - 22 x^{2} - 3 x \log {\left (x - 1 \right )} + 3 x \log {\left (x + 1 \right )} + 16}{- 3 x^{4} \log {\left (x - 1 \right )} + 3 x^{4} \log {\left (x + 1 \right )} - 6 x^{3} + 6 x^{2} \log {\left (x - 1 \right )} - 6 x^{2} \log {\left (x + 1 \right )} + 10 x - 3 \log {\left (x - 1 \right )} + 3 \log {\left (x + 1 \right )}} \]