75.19.11 problem 628

Internal problem ID [17056]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 15.4 Nonhomogeneous linear equations with constant coefficients. The Euler equations. Exercises page 143
Problem number : 628
Date solved : Monday, March 31, 2025 at 03:39:26 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.002 (sec). Leaf size: 22
ode:=x^2*diff(diff(y(x),x),x)+x*diff(y(x),x)+y(x) = x*(6-ln(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (\ln \left (x \right )\right ) c_2 +\cos \left (\ln \left (x \right )\right ) c_1 -\frac {x \left (\ln \left (x \right )-7\right )}{2} \]
Mathematica. Time used: 0.172 (sec). Leaf size: 61
ode=x^2*D[y[x],{x,2}]+x*D[y[x],x]+y[x]==x*(6-Log[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \cos (\log (x)) \int _1^x(\log (K[1])-6) \sin (\log (K[1]))dK[1]+\sin (\log (x)) \int _1^x-\cos (\log (K[2])) (\log (K[2])-6)dK[2]+c_1 \cos (\log (x))+c_2 \sin (\log (x)) \]
Sympy. Time used: 0.275 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), (x, 2)) - x*(6 - log(x)) + x*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (\log {\left (x \right )} \right )} + C_{2} \cos {\left (\log {\left (x \right )} \right )} - \frac {x \log {\left (x \right )}}{2} + \frac {7 x}{2} \]