78.11.10 problem 8

Internal problem ID [18210]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 16. The Use of a Known Solution to find Another. Problems at page 121
Problem number : 8
Date solved : Monday, March 31, 2025 at 05:22:47 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }-x f \left (x \right ) y^{\prime }+f \left (x \right ) y&=0 \end{align*}

Maple. Time used: 0.014 (sec). Leaf size: 27
ode:=diff(diff(y(x),x),x)-x*f(x)*diff(y(x),x)+f(x)*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x \left (\int {\mathrm e}^{\int \frac {-2+f \left (x \right ) x^{2}}{x}d x}d x c_1 +c_2 \right ) \]
Mathematica. Time used: 0.226 (sec). Leaf size: 44
ode=D[y[x],{x,2}] -x*f[x]*D[y[x],x]+f[x]*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \left (c_2 \int _1^x\frac {\exp \left (-\int _1^{K[2]}-f(K[1]) K[1]dK[1]\right )}{K[2]^2}dK[2]+c_1\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
f = Function("f") 
ode = Eq(-x*f(x)*Derivative(y(x), x) + f(x)*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
TypeError : cannot determine truth value of Relational