74.22.16 problem 16

Internal problem ID [16584]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 6. Systems of Differential Equations. Exercises 6.1, page 282
Problem number : 16
Date solved : Thursday, March 13, 2025 at 08:23:54 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{\prime \prime }+x&={\mathrm e}^{t} \end{align*}

Maple. Time used: 0.006 (sec). Leaf size: 17
ode:=diff(diff(x(t),t),t)+x(t) = exp(t); 
dsolve(ode,x(t), singsol=all);
 
\[ x \left (t \right ) = c_{2} \sin \left (t \right )+\cos \left (t \right ) c_{1} +\frac {{\mathrm e}^{t}}{2} \]
Mathematica. Time used: 0.059 (sec). Leaf size: 53
ode=D[x[t],{t,2}]+x[t]==Exp[t]; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ x(t)\to \cos (t) \int _1^t-e^{K[1]} \sin (K[1])dK[1]+\sin (t) \int _1^te^{K[2]} \cos (K[2])dK[2]+c_1 \cos (t)+c_2 \sin (t) \]
Sympy. Time used: 0.067 (sec). Leaf size: 17
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(x(t) - exp(t) + Derivative(x(t), (t, 2)),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ x{\left (t \right )} = C_{1} \sin {\left (t \right )} + C_{2} \cos {\left (t \right )} + \frac {e^{t}}{2} \]