65.7.2 problem 14.1 (ii)

Internal problem ID [13687]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 14, Inhomogeneous second order linear equations. Exercises page 140
Problem number : 14.1 (ii)
Date solved : Wednesday, March 05, 2025 at 10:12:04 PM
CAS classification : [[_2nd_order, _missing_y]]

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

Maple. Time used: 0.002 (sec). Leaf size: 26
ode:=diff(diff(x(t),t),t)-4*diff(x(t),t) = t^2; 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = -\frac {t^{2}}{16}-\frac {t^{3}}{12}+\frac {{\mathrm e}^{4 t} c_{1}}{4}-\frac {t}{32}+c_{2} \]
Mathematica. Time used: 4.008 (sec). Leaf size: 44
ode=D[x[t],{t,2}]-4*D[x[t],t]==t^2; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \int _1^te^{4 K[2]} \left (c_1+\int _1^{K[2]}e^{-4 K[1]} K[1]^2dK[1]\right )dK[2]+c_2 \]
Sympy. Time used: 0.165 (sec). Leaf size: 24
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t**2 - 4*Derivative(x(t), t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} + C_{2} e^{4 t} - \frac {t^{3}}{12} - \frac {t^{2}}{16} - \frac {t}{32} \]