73.13.23 problem 20.2 (e)

Internal problem ID [15330]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 20. Euler equations. Additional exercises page 382
Problem number : 20.2 (e)
Date solved : Monday, March 31, 2025 at 01:34:32 PM
CAS classification : [[_Emden, _Fowler]]

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

With initial conditions

\begin{align*} y \left (1\right )&=3\\ y^{\prime }\left (1\right )&=0 \end{align*}

Maple. Time used: 0.070 (sec). Leaf size: 16
ode:=x^2*diff(diff(y(x),x),x)-x*diff(y(x),x)+2*y(x) = 0; 
ic:=y(1) = 3, D(y)(1) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -3 x \left (-\cos \left (\ln \left (x \right )\right )+\sin \left (\ln \left (x \right )\right )\right ) \]
Mathematica. Time used: 0.023 (sec). Leaf size: 17
ode=x^2*D[y[x],{x,2}]-x*D[y[x],x]+2*y[x]==0; 
ic={y[1]==3,Derivative[1][y][1]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to 3 x (\cos (\log (x))-\sin (\log (x))) \]
Sympy. Time used: 0.202 (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*y(x),0) 
ics = {y(1): 3, Subs(Derivative(y(x), x), x, 1): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (- 3 \sin {\left (\log {\left (x \right )} \right )} + 3 \cos {\left (\log {\left (x \right )} \right )}\right ) \]