19.1.20 problem 20

Internal problem ID [4232]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 20
Date solved : Tuesday, September 30, 2025 at 07:07:58 AM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (1\right )&=0 \\ \end{align*}
Maple. Time used: 0.023 (sec). Leaf size: 13
ode:=2*x*diff(y(x),x) = 1-y(x)^2; 
ic:=[y(1) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {x -1}{1+x} \]
Mathematica. Time used: 0.317 (sec). Leaf size: 14
ode=2*x*D[y[x],x]==1-y[x]^2; 
ic=y[1]==0; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {x-1}{x+1} \end{align*}
Sympy. Time used: 0.185 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*Derivative(y(x), x) + y(x)**2 - 1,0) 
ics = {y(1): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x - 1}{x + 1} \]