15.16.12 problem 12

Internal problem ID [3232]
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 : 12
Date solved : Sunday, March 30, 2025 at 01:22:07 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.031 (sec). Leaf size: 43
ode:=x^2*diff(diff(y(x),x),x)+4*x*diff(y(x),x)+3*y(x) = (x-1)*ln(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {1}{3}+\frac {\left (3 x -7\right ) \ln \left (x \right )}{21}-\frac {5 x}{49}+\frac {\sin \left (\frac {\sqrt {3}\, \ln \left (x \right )}{2}\right ) c_2 +\cos \left (\frac {\sqrt {3}\, \ln \left (x \right )}{2}\right ) c_1}{x^{{3}/{2}}} \]
Mathematica. Time used: 0.581 (sec). Leaf size: 67
ode=x^2*D[y[x],{x,2}]+4*x*D[y[x],x]+3*y[x]==(x-1)*Log[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {c_2 \cos \left (\frac {1}{2} \sqrt {3} \log (x)\right )}{x^{3/2}}+\frac {c_1 \sin \left (\frac {1}{2} \sqrt {3} \log (x)\right )}{x^{3/2}}-\frac {5 x}{49}+\frac {1}{7} x \log (x)-\frac {\log (x)}{3}+\frac {1}{3} \]
Sympy. Time used: 0.497 (sec). Leaf size: 58
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), (x, 2)) + 4*x*Derivative(y(x), x) - (x - 1)*log(x) + 3*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} \sin {\left (\frac {\sqrt {3} \log {\left (x \right )}}{2} \right )} + C_{2} \cos {\left (\frac {\sqrt {3} \log {\left (x \right )}}{2} \right )} + \frac {x^{\frac {3}{2}} \left (21 x \log {\left (x \right )} - 15 x - 49 \log {\left (x \right )} + 49\right )}{147}}{x^{\frac {3}{2}}} \]