70.17.17 problem 26

Internal problem ID [18989]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 4. Second order linear equations. Section 4.7 (Variation of parameters). Problems at page 280
Problem number : 26
Date solved : Thursday, October 02, 2025 at 03:36:43 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} \left (1-x \right ) y^{\prime \prime }+x y^{\prime }-y&=g \left (x \right ) \end{align*}
Maple. Time used: 0.007 (sec). Leaf size: 43
ode:=(1-x)*diff(diff(y(x),x),x)+x*diff(y(x),x)-y(x) = g(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = c_2 x +{\mathrm e}^{x} c_1 +\int \frac {g \left (x \right )}{\left (-1+x \right )^{2}}d x x -\int \frac {x g \left (x \right ) {\mathrm e}^{-x}}{\left (-1+x \right )^{2}}d x {\mathrm e}^{x} \]
Mathematica. Time used: 0.143 (sec). Leaf size: 254
ode=(1-x)*D[y[x],{x,2}]+x*D[y[x],x]-y[x]==g[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \exp \left (\int _1^x\frac {K[1]-2}{2 (K[1]-1)}dK[1]-\frac {1}{2} \int _1^x-\frac {K[2]}{K[2]-1}dK[2]\right ) \left (\int _1^x\frac {\exp \left (\int _1^{K[4]}\frac {K[1]-2}{2 (K[1]-1)}dK[1]+\frac {1}{2} \int _1^{K[4]}-\frac {K[2]}{K[2]-1}dK[2]\right ) g(K[4]) \int _1^{K[4]}\exp \left (-2 \int _1^{K[3]}\frac {K[1]-2}{2 (K[1]-1)}dK[1]\right )dK[3]}{K[4]-1}dK[4]+\int _1^x\exp \left (-2 \int _1^{K[3]}\frac {K[1]-2}{2 (K[1]-1)}dK[1]\right )dK[3] \left (\int _1^x-\frac {\exp \left (\int _1^{K[5]}\frac {K[1]-2}{2 (K[1]-1)}dK[1]+\frac {1}{2} \int _1^{K[5]}-\frac {K[2]}{K[2]-1}dK[2]\right ) g(K[5])}{K[5]-1}dK[5]+c_2\right )+c_1\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) + (1 - x)*Derivative(y(x), (x, 2)) - g(x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (x*Derivative(y(x), (x, 2)) + g(x) + y(x) - Derivative(y(x), (x, 2)))/x cannot be solved by the factorable group method