75.19.12 problem 629

Internal problem ID [17057]
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 : 629
Date solved : Monday, March 31, 2025 at 03:39:29 PM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

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

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