60.2.32 problem Problem 43

Internal problem ID [15212]
Book : Differential equations and the calculus of variations by L. ElSGOLTS. MIR PUBLISHERS, MOSCOW, Third printing 1977.
Section : Chapter 2, DIFFERENTIAL EQUATIONS OF THE SECOND ORDER AND HIGHER. Problems page 172
Problem number : Problem 43
Date solved : Thursday, October 02, 2025 at 10:07:19 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} \left (1+x \right )^{2} y^{\prime \prime }+\left (1+x \right ) y^{\prime }+y&=2 \cos \left (\ln \left (1+x \right )\right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 24
ode:=(1+x)^2*diff(diff(y(x),x),x)+(1+x)*diff(y(x),x)+y(x) = 2*cos(ln(1+x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_2 +\ln \left (1+x \right )\right ) \sin \left (\ln \left (1+x \right )\right )+\cos \left (\ln \left (1+x \right )\right ) c_1 \]
Mathematica. Time used: 0.064 (sec). Leaf size: 31
ode=(1+x)^2*D[y[x],{x,2}]+(1+x)*D[y[x],x]+y[x]==2*Cos[Log[1+x]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \left (\frac {1}{2}+c_1\right ) \cos (\log (x+1))+(\log (x+1)+c_2) \sin (\log (x+1)) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x + 1)**2*Derivative(y(x), (x, 2)) + (x + 1)*Derivative(y(x), x) + y(x) - 2*cos(log(x + 1)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (-x**2*Derivative(y(x), (x, 2)) - 2*x*Derivative(y(x), (x, 2)) - y(x) + 2*cos(log(x + 1)) - Derivative(y(x), (x, 2)))/(x + 1) cannot be solved by the factorable group method