89.7.22 problem 22 (n=1)

Internal problem ID [24453]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 4. Additional topics on equations of first order and first degree. Exercises at page 61
Problem number : 22 (n=1)
Date solved : Thursday, October 02, 2025 at 10:36:57 PM
CAS classification : [_separable]

\begin{align*} x y^{\prime }-y&=x^{k} y \end{align*}
Maple. Time used: 0.000 (sec). Leaf size: 15
ode:=x*diff(y(x),x)-y(x) = x^k*y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_1 x \,{\mathrm e}^{\frac {x^{k}}{k}} \]
Mathematica. Time used: 0.544 (sec). Leaf size: 27
ode=x*D[y[x],x]-y[x]==x^k*y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to c_1 e^{\frac {x^k+\log \left (x^k\right )}{k}}\\ y(x)&\to 0 \end{align*}
Sympy. Time used: 0.306 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
k = symbols("k") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - x**k*y(x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \begin {cases} x e^{C_{1} + \frac {x^{k}}{k}} & \text {for}\: k > 0 \vee k < 0 \\x^{2} e^{C_{1}} & \text {otherwise} \end {cases} \]