50.12.10 problem 7

Internal problem ID [8014]
Book : Differential Equations: Theory, Technique, and Practice by George Simmons, Steven Krantz. McGraw-Hill NY. 2007. 1st Edition.
Section : Chapter 2. Second-Order Linear Equations. Section 2.4. THE USE OF A KNOWN SOLUTION TO FIND ANOTHER. Page 74
Problem number : 7
Date solved : Sunday, March 30, 2025 at 12:40:42 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.216 (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") 
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