82.39.4 problem Ex. 4

Internal problem ID [18857]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VII. Linear equations with variable coefficients. End of chapter problems at page 91
Problem number : Ex. 4
Date solved : Thursday, March 13, 2025 at 01:03:34 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} \left (x +a \right )^{2} y^{\prime \prime }-4 \left (x +a \right ) y^{\prime }+6 y&=x \end{align*}

Maple. Time used: 0.007 (sec). Leaf size: 25
ode:=(x+a)^2*diff(diff(y(x),x),x)-4*(x+a)*diff(y(x),x)+6*y(x) = x; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \left (a +x \right )^{2} c_{2} +\left (a +x \right )^{3} c_{1} +\frac {x}{2}+\frac {a}{3} \]
Mathematica. Time used: 0.049 (sec). Leaf size: 33
ode=(x+a)^2*D[y[x],{x,2}]-4*(x+a)*D[y[x],x]+6*y[x]==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{6} (2 a+3 x)+c_2 (a+x)^3+c_1 (a+x)^2 \]
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-x + (a + x)**2*Derivative(y(x), (x, 2)) - (4*a + 4*x)*Derivative(y(x), x) + 6*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (a**2*Derivative(y(x), (x, 2)) + 2*a*x*Derivative(y(x), (x, 2)) + x**2*Derivative(y(x), (x, 2)) - x + 6*y(x))/(4*(a + x)) cannot be solved by the factorable group method