12.20.10 problem section 9.4, problem 27

Internal problem ID [2231]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 9 Introduction to Linear Higher Order Equations. Section 9.4. Variation of Parameters for Higher Order Equations. Page 503
Problem number : section 9.4, problem 27
Date solved : Saturday, March 29, 2025 at 11:51:25 PM
CAS classification : [[_3rd_order, _exact, _linear, _nonhomogeneous]]

\begin{align*} x^{3} y^{\prime \prime \prime }+x^{2} y^{\prime \prime }-2 x y^{\prime }+2 y&=x \left (x +1\right ) \end{align*}

With initial conditions

\begin{align*} y \left (-1\right )&=-6\\ y^{\prime }\left (-1\right )&={\frac {43}{6}}\\ y^{\prime \prime }\left (-1\right )&=-{\frac {5}{2}} \end{align*}

Maple. Time used: 0.045 (sec). Leaf size: 28
ode:=x^3*diff(diff(diff(y(x),x),x),x)+x^2*diff(diff(y(x),x),x)-2*x*diff(y(x),x)+2*y(x) = x*(1+x); 
ic:=y(-1) = -6, D(y)(-1) = 43/6, (D@@2)(y)(-1) = -5/2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {x \left (-2 i \pi x +2 x \ln \left (x \right )+3 i \pi -3 \ln \left (x \right )-12 x +24\right )}{6} \]
Mathematica. Time used: 0.008 (sec). Leaf size: 34
ode=x^3*D[y[x],{x,3}]+x^2*D[y[x],{x,2}]-2*x*D[y[x],x]+2*y[x]==x*(x+1); 
ic={y[-1]==-6,Derivative[1][y][-1]==43/6,Derivative[2][y][-1]==-5/2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{6} x (-2 i \pi x-12 x+(2 x-3) \log (x)+3 i \pi +24) \]
Sympy. Time used: 0.363 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**3*Derivative(y(x), (x, 3)) + x**2*Derivative(y(x), (x, 2)) - x*(x + 1) - 2*x*Derivative(y(x), x) + 2*y(x),0) 
ics = {y(-1): -6, Subs(Derivative(y(x), x), x, -1): 43/6, Subs(Derivative(y(x), (x, 2)), x, -1): -5/2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x^{2} \log {\left (x \right )}}{3} + x^{2} \left (-2 - \frac {i \pi }{3}\right ) - \frac {x \log {\left (x \right )}}{2} + x \left (4 + \frac {i \pi }{2}\right ) \]