82.54.13 problem Ex. 13

Internal problem ID [18950]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter IX. Equations of the second order. problems at end of chapter at page 120
Problem number : Ex. 13
Date solved : Thursday, March 13, 2025 at 01:13:07 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.007 (sec). Leaf size: 106
ode:=diff(diff(y(x),x),x)+x*diff(y(x),x)-y(x) = f(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {x \left (\int \left (\sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, x}{2}\right ) x \,{\mathrm e}^{\frac {x^{2}}{2}}+2\right ) f \left (x \right )d x \right )}{2}+\frac {\left (-\sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, x}{2}\right ) x -2 \,{\mathrm e}^{-\frac {x^{2}}{2}}\right ) \left (\int x f \left (x \right ) {\mathrm e}^{\frac {x^{2}}{2}}d x \right )}{2}-{\mathrm e}^{-\frac {x^{2}}{2}} c_{1} -\frac {x \left (c_{1} \sqrt {\pi }\, \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, x}{2}\right )-2 c_{2} \right )}{2} \]
Mathematica. Time used: 0.274 (sec). Leaf size: 148
ode=D[y[x],{x,2}]+x*D[y[x],x]-y[x]==f[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \left (-\sqrt {\frac {\pi }{2}} x \text {erf}\left (\frac {x}{\sqrt {2}}\right )-e^{-\frac {x^2}{2}}\right ) \int _1^xe^{\frac {K[2]^2}{2}} f(K[2]) K[2]dK[2]+x \int _1^x\left (e^{\frac {K[1]^2}{2}} \sqrt {\frac {\pi }{2}} \text {erf}\left (\frac {K[1]}{\sqrt {2}}\right ) K[1] f(K[1])+f(K[1])\right )dK[1]-\sqrt {\frac {\pi }{2}} c_2 x \text {erf}\left (\frac {x}{\sqrt {2}}\right )-c_2 e^{-\frac {x^2}{2}}+c_1 x \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - f(x) - y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (f(x) + y(x) - Derivative(y(x), (x, 2)))/x cannot be solved by the factorable group method