60.1.31 problem 31

Internal problem ID [10045]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 31
Date solved : Sunday, March 30, 2025 at 02:55:20 PM
CAS classification : [_separable]

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

Maple. Time used: 0.005 (sec). Leaf size: 23
ode:=diff(y(x),x)-a*x^n*(1+y(x)^2) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tan \left (\frac {a \left (x^{n +1}+\left (n +1\right ) c_1 \right )}{n +1}\right ) \]
Mathematica. Time used: 0.381 (sec). Leaf size: 52
ode=D[y[x],x] - a*x^n*(y[x]^2+1)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}\frac {1}{K[1]^2+1}dK[1]\&\right ]\left [\frac {a x^{n+1}}{n+1}+c_1\right ] \\ y(x)\to -i \\ y(x)\to i \\ \end{align*}
Sympy. Time used: 0.808 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
a = symbols("a") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-a*x**n*(y(x)**2 + 1) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \tan {\left (\begin {cases} \frac {C_{1} n}{n + 1} + \frac {C_{1}}{n + 1} + \frac {a x^{n + 1}}{n + 1} & \text {for}\: n > -1 \vee n < -1 \\C_{1} + a \log {\left (x \right )} & \text {otherwise} \end {cases} \right )} \]