8.11.38 problem 61

Internal problem ID [906]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 5.5, Nonhomogeneous equations and undetermined coefficients Page 351
Problem number : 61
Date solved : Saturday, March 29, 2025 at 10:34:06 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.003 (sec). Leaf size: 17
ode:=x^2*diff(diff(y(x),x),x)+x*diff(y(x),x)+y(x) = 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 +\ln \left (x \right ) \]
Mathematica. Time used: 0.028 (sec). Leaf size: 20
ode=x^2*D[y[x],{x,2}]+x*D[y[x],x]+y[x]==Log[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \log (x)+c_1 \cos (\log (x))+c_2 \sin (\log (x)) \]
Sympy. Time used: 0.227 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), (x, 2)) + x*Derivative(y(x), x) + y(x) - log(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 )} + \log {\left (x \right )} \]