58.12.24 problem 24

Internal problem ID [14809]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.4. Variation of parameters. Exercises page 162
Problem number : 24
Date solved : Thursday, October 02, 2025 at 09:55:10 AM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

\begin{align*} \left (2 x +1\right ) \left (1+x \right ) y^{\prime \prime }+2 x y^{\prime }-2 y&=\left (2 x +1\right )^{2} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 43
ode:=(2*x+1)*(1+x)*diff(diff(y(x),x),x)+2*x*diff(y(x),x)-2*y(x) = (2*x+1)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {4 x^{3}+\left (6 c_1 +24 c_2 +4\right ) x^{2}+\left (6 c_1 +24 c_2 +1\right ) x +6 c_2}{6 x +6} \]
Mathematica. Time used: 1.919 (sec). Leaf size: 75
ode=(2*x+1)*(x+1)*D[y[x],{x,2}]+2*x*D[y[x],x]-2*y[x]==(2*x+1)^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {8 x^3+6 x^2+1}{12 x+12}+\frac {c_1 \sqrt {2 x+1}}{\sqrt {-2 x-1} (x+1)}-\frac {c_2 x \sqrt {2 x+1}}{\sqrt {-2 x-1}} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*Derivative(y(x), x) + (x + 1)*(2*x + 1)*Derivative(y(x), (x, 2)) - (2*x + 1)**2 - 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (x*(-2*x*Derivative(y(x), (x, 2)) + 4*x - 3*Derivative(y(x), (x, 2)) + 4) + 2*y(x) - Derivative(y(x), (x, 2)) + 1)/(2*x) cannot be solved by the factorable group method