83.5.18 problem 18

Internal problem ID [19042]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter II. Equations of first order and first degree. Exercise II (D) at page 16
Problem number : 18
Date solved : Monday, March 31, 2025 at 06:36:16 PM
CAS classification : [_separable]

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

Maple. Time used: 0.017 (sec). Leaf size: 30
ode:=diff(y(x),x)+x = x*exp((n-1)*y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\ln \left (-\frac {1}{{\mathrm e}^{\frac {\left (n -1\right ) \left (x^{2}+2 c_1 \right )}{2}}-1}\right )}{n -1} \]
Mathematica. Time used: 1.397 (sec). Leaf size: 47
ode=D[y[x],x]+x==x*Exp[ (n-1)*y[x]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {\log \left ((n-1) \left (\frac {1}{n-1}-e^{\frac {1}{2} (n-1) \left (x^2+2 c_1\right )}\right )\right )}{n-1} \\ y(x)\to 0 \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-x*exp((n - 1)*y(x)) + x + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : < not supported between instances of NoneType and y