15.16.11 problem 11

Internal problem ID [3231]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 25, page 112
Problem number : 11
Date solved : Sunday, March 30, 2025 at 01:22:04 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{2} y^{\prime \prime }-x y^{\prime }+2 y&=x^{2} \ln \left (x \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 26
ode:=x^2*diff(diff(y(x),x),x)-x*diff(y(x),x)+2*y(x) = x^2*ln(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x \left (2 \cos \left (\ln \left (x \right )\right ) c_1 +2 \sin \left (\ln \left (x \right )\right ) c_2 +x \left (\ln \left (x \right )-1\right )\right )}{2} \]
Mathematica. Time used: 0.084 (sec). Leaf size: 31
ode=x^2*D[y[x],{x,2}]-x*D[y[x],x]+2*y[x]==x^2*Log[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} x (x (\log (x)-1)+2 c_2 \cos (\log (x))+2 c_1 \sin (\log (x))) \]
Sympy. Time used: 0.343 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*log(x) + x**2*Derivative(y(x), (x, 2)) - x*Derivative(y(x), x) + 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x \left (C_{1} \sin {\left (\log {\left (x \right )} \right )} + C_{2} \cos {\left (\log {\left (x \right )} \right )} + x \log {\left (x \right )} - x\right )}{2} \]