82.54.13 problem Ex. 13

Internal problem ID [18958]
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 : Monday, March 31, 2025 at 06:26:33 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.008 (sec). Leaf size: 127
ode:=diff(diff(y(x),x),x)+x*diff(y(x),x)-y(x) = f(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {2 \pi ^{{3}/{2}} \operatorname {erf}\left (\frac {\sqrt {2}\, x}{2}\right ) c_1 x -\int x f \left (x \right ) {\mathrm e}^{\frac {x^{2}}{2}}d x \pi \sqrt {2}\, \operatorname {erf}\left (\frac {\sqrt {2}\, x}{2}\right ) x +2 \pi \sqrt {2}\, {\mathrm e}^{-\frac {x^{2}}{2}} c_1 -2 \,{\mathrm e}^{-\frac {x^{2}}{2}} \int x f \left (x \right ) {\mathrm e}^{\frac {x^{2}}{2}}d x \sqrt {\pi }+\int f \left (x \right ) \left (\sqrt {\pi }\, \sqrt {2}+{\mathrm e}^{\frac {x^{2}}{2}} \pi \,\operatorname {erf}\left (\frac {\sqrt {2}\, x}{2}\right ) x \right )d x \sqrt {2}\, x +2 c_2 x \sqrt {\pi }}{2 \sqrt {\pi }} \]
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