65.7.1 problem 14.1 (i)

Internal problem ID [13686]
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 (i)
Date solved : Wednesday, March 05, 2025 at 10:12:02 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.007 (sec). Leaf size: 23
ode:=diff(diff(x(t),t),t)-4*x(t) = t^2; 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = c_{2} {\mathrm e}^{2 t}+c_{1} {\mathrm e}^{-2 t}-\frac {t^{2}}{4}-\frac {1}{8} \]
Mathematica. Time used: 0.014 (sec). Leaf size: 32
ode=D[x[t],{t,2}]-4*x[t]==t^2; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to -\frac {t^2}{4}+c_1 e^{2 t}+c_2 e^{-2 t}-\frac {1}{8} \]
Sympy. Time used: 0.096 (sec). Leaf size: 24
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t**2 - 4*x(t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} e^{- 2 t} + C_{2} e^{2 t} - \frac {t^{2}}{4} - \frac {1}{8} \]