25.1.23 problem 23

Internal problem ID [4235]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 23
Date solved : Tuesday, March 04, 2025 at 05:57:15 PM
CAS classification : [_separable]

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

Maple. Time used: 0.003 (sec). Leaf size: 9
ode:=diff(y(x),x) = exp(x)*(y(x)^2+1); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \tan \left ({\mathrm e}^{x}+c_{1} \right ) \]
Mathematica. Time used: 0.324 (sec). Leaf size: 26
ode=D[y[x],x]==Exp[x]*(y[x]^2+1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \tan \left (e^x+c_1\right ) \\ y(x)\to -i \\ y(x)\to i \\ \end{align*}
Sympy. Time used: 0.296 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-y(x)**2 - 1)*exp(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \tan {\left (C_{1} + e^{x} \right )} \]