19.1.22 problem 22

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

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