40.13.16 problem 37

Internal problem ID [6770]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 18. Linear equations with variable coefficients (Equations of second order). Supplemetary problems. Page 120
Problem number : 37
Date solved : Sunday, March 30, 2025 at 11:22:09 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x y^{\prime \prime }+2 y^{\prime }+4 x y&=4 \end{align*}

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