6.10.27 problem 27

Internal problem ID [1831]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 5 linear second order equations. Section 5.7 Variation of Parameters. Page 262
Problem number : 27
Date solved : Tuesday, September 30, 2025 at 05:20:12 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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