15.16.10 problem 10

Internal problem ID [3230]
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 : 10
Date solved : Sunday, March 30, 2025 at 01:22:00 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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