78.2.38 problem 15.d

Internal problem ID [20990]
Book : A FIRST COURSE IN DIFFERENTIAL EQUATIONS FOR SCIENTISTS AND ENGINEERS. By Russell Herman. University of North Carolina Wilmington. LibreText. compiled on 06/09/2025
Section : Chapter 2, Second order ODEs. Problems section 2.6
Problem number : 15.d
Date solved : Thursday, October 02, 2025 at 07:01:09 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

With initial conditions

\begin{align*} y \left (1\right )&=\pi \\ y^{\prime }\left (1\right )&=0 \\ \end{align*}
Maple. Time used: 0.030 (sec). Leaf size: 25
ode:=x^2*diff(diff(y(x),x),x)-2*x*diff(y(x),x)+2*y(x) = 3*x^2-x; 
ic:=[y(1) = Pi, D(y)(1) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -\left (\left (-3 x -1\right ) \ln \left (x \right )+\left (\pi +4\right ) x -2 \pi -4\right ) x \]
Mathematica. Time used: 1.742 (sec). Leaf size: 7370
ode=x^2*D[y[x],{x,2}]-2*D[y[x],x]+2*y[x]==3*x^2-x; 
ic={y[1]==Pi,Derivative[1][y][1] ==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 

Too large to display

Sympy. Time used: 0.171 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), (x, 2)) - 3*x**2 - 2*x*Derivative(y(x), x) - x + 2*y(x),0) 
ics = {y(1): pi, Subs(Derivative(y(x), x), x, 1): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (3 x \log {\left (x \right )} + x \left (- \pi - 2\right ) - \log {\left (x \right )} + 2 + 2 \pi \right ) \]