14.11.1 problem 1

Internal problem ID [2594]
Book : Differential equations and their applications, 4th ed., M. Braun
Section : Chapter 2. Second order differential equations. Section 2.5. Method of judicious guessing. Excercises page 164
Problem number : 1
Date solved : Tuesday, March 04, 2025 at 02:28:50 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+3 y&=t^{3}-1 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 30
ode:=diff(diff(y(t),t),t)+3*y(t) = t^3-1; 
dsolve(ode,y(t), singsol=all);
 
\[ y = \sin \left (\sqrt {3}\, t \right ) c_2 +\cos \left (\sqrt {3}\, t \right ) c_1 +\frac {t^{3}}{3}-\frac {2 t}{3}-\frac {1}{3} \]
Mathematica. Time used: 0.021 (sec). Leaf size: 40
ode=D[y[t],{t,2}]+3*y[t]==t^3-1; 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {1}{3} \left (t^3-2 t-1\right )+c_1 \cos \left (\sqrt {3} t\right )+c_2 \sin \left (\sqrt {3} t\right ) \]
Sympy. Time used: 0.100 (sec). Leaf size: 36
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(-t**3 + 3*y(t) + Derivative(y(t), (t, 2)) + 1,0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ y{\left (t \right )} = C_{1} \sin {\left (\sqrt {3} t \right )} + C_{2} \cos {\left (\sqrt {3} t \right )} + \frac {t^{3}}{3} - \frac {2 t}{3} - \frac {1}{3} \]