24.1.10 problem 2(d)

Internal problem ID [4199]
Book : Elementary Differential equations, Chaundy, 1969
Section : Exercises 3, page 60
Problem number : 2(d)
Date solved : Sunday, March 30, 2025 at 02:42:26 AM
CAS classification : [_linear]

\begin{align*} x y^{\prime }-n y&=x^{n} \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 12
ode:=x*diff(y(x),x)-n*y(x) = x^n; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\ln \left (x \right )+c_1 \right ) x^{n} \]
Mathematica. Time used: 0.046 (sec). Leaf size: 14
ode=x*D[y[x],x]-n*y[x]==x^n; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x^n (\log (x)+c_1) \]
Sympy. Time used: 0.219 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-n*y(x) + x*Derivative(y(x), x) - x**n,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \log {\left (x \right )}\right ) e^{n \log {\left (x \right )}} \]