64.12.24 problem 24

Internal problem ID [13457]
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 : Monday, March 31, 2025 at 07:58:26 AM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

\begin{align*} \left (2 x +1\right ) \left (x +1\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: 0.644 (sec). Leaf size: 177
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]
 
\[ y(x)\to \frac {\exp \left (-\frac {1}{2} \int _1^x\frac {2 K[1]}{2 K[1]^2+3 K[1]+1}dK[1]\right ) \left (-(x+1) x \int _1^x-\frac {\exp \left (\frac {1}{2} \int _1^{K[3]}\frac {2 K[1]}{2 K[1]^2+3 K[1]+1}dK[1]\right ) \sqrt {-2 K[3]-1}}{K[3]+1}dK[3]+\int _1^x-\exp \left (\frac {1}{2} \int _1^{K[2]}\frac {2 K[1]}{2 K[1]^2+3 K[1]+1}dK[1]\right ) \sqrt {-2 K[2]-1} K[2]dK[2]-c_2 x^2-c_2 x+c_1\right )}{\sqrt {-2 x-1}} \]
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