58.2.19 problem 20

Internal problem ID [9142]
Book : Second order enumerated odes
Section : section 2
Problem number : 20
Date solved : Sunday, March 30, 2025 at 02:23:20 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{2} y^{\prime \prime }-3 x y^{\prime }+3 y&=2 x^{3}-x^{2} \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 28
ode:=x^2*diff(diff(y(x),x),x)-3*x*diff(y(x),x)+3*y(x) = 2*x^3-x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x \left (2 x^{2} \ln \left (x \right )+\left (c_1 -1\right ) x^{2}+2 x +2 c_2 \right )}{2} \]
Mathematica. Time used: 0.02 (sec). Leaf size: 27
ode=x^2*D[y[x],{x,2}]-3*x*D[y[x],x]+3*y[x]==2*x^3-x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \left (x^2 \log (x)+\left (-\frac {3}{2}+c_2\right ) x^2+x+c_1\right ) \]
Sympy. Time used: 0.247 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x**3 + x**2*Derivative(y(x), (x, 2)) + x**2 - 3*x*Derivative(y(x), x) + 3*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (C_{1} + C_{2} x^{2} + x^{2} \log {\left (x \right )} + x\right ) \]