35.7.19 problem 22

Internal problem ID [6201]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 7. Other second-Order equations. page 435
Problem number : 22
Date solved : Wednesday, March 05, 2025 at 12:24:31 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{2} y^{\prime \prime }+x y^{\prime }+y&=2 x \end{align*}

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