10.6.22 problem 22

Internal problem ID [1239]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Miscellaneous problems, end of chapter 2. Page 133
Problem number : 22
Date solved : Saturday, March 29, 2025 at 10:49:34 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (-1\right )&=1 \end{align*}

Maple. Time used: 0.181 (sec). Leaf size: 86
ode:=diff(y(x),x) = (x^2-1)/(1+y(x)^2); 
ic:=y(-1) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\left (8+4 x^{3}-12 x +4 \sqrt {x^{6}-6 x^{4}+4 x^{3}+9 x^{2}-12 x +8}\right )^{{2}/{3}}-4}{2 \left (8+4 x^{3}-12 x +4 \sqrt {x^{6}-6 x^{4}+4 x^{3}+9 x^{2}-12 x +8}\right )^{{1}/{3}}} \]
Mathematica. Time used: 2.963 (sec). Leaf size: 97
ode=D[y[x],x]== (x^2-1)/(1+y[x]^2); 
ic=y[-1]==1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\sqrt [3]{2} \left (x^3+\sqrt {x^6-6 x^4+4 x^3+9 x^2-12 x+8}-3 x+2\right )^{2/3}-2}{2^{2/3} \sqrt [3]{x^3+\sqrt {x^6-6 x^4+4 x^3+9 x^2-12 x+8}-3 x+2}} \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((1 - x**2)/(y(x)**2 + 1) + Derivative(y(x), x),0) 
ics = {y(-1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
ZeroDivisionError : polynomial division