65.11.4 problem 18.1 (iv)

Internal problem ID [13714]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 18, The variation of constants formula. Exercises page 168
Problem number : 18.1 (iv)
Date solved : Wednesday, March 05, 2025 at 10:13:34 PM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

\begin{align*} t^{2} x^{\prime \prime }-2 x&=t^{3} \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 20
ode:=t^2*diff(diff(x(t),t),t)-2*x(t) = t^3; 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = c_{2} t^{2}+\frac {t^{3}}{4}+\frac {c_{1}}{t} \]
Mathematica. Time used: 0.012 (sec). Leaf size: 25
ode=t^2*D[x[t],{t,2}]-2*x[t]==t^3; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \frac {t^3}{4}+c_2 t^2+\frac {c_1}{t} \]
Sympy. Time used: 0.184 (sec). Leaf size: 14
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t**3 + t**2*Derivative(x(t), (t, 2)) - 2*x(t),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = \frac {C_{1} + \frac {t^{3} \left (C_{2} + t\right )}{4}}{t} \]