79.3.6 problem 7 (vi)

Internal problem ID [18530]
Book : Elementary Differential Equations. By R.L.E. Schwarzenberger. Chapman and Hall. London. First Edition (1969)
Section : Chapter 5. Linear equations. Exercises at page 85
Problem number : 7 (vi)
Date solved : Tuesday, January 28, 2025 at 11:54:20 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+x&=\cos \left (t \right ) \end{align*}

With initial conditions

\begin{align*} x \left (0\right )&=0\\ x^{\prime }\left (0\right )&=1 \end{align*}

Solution by Maple

Time used: 0.010 (sec). Leaf size: 12

dsolve([diff(x(t),t$2)+x(t)=cos(t),x(0) = 0, D(x)(0) = 1],x(t), singsol=all)
 
\[ x = \sin \left (t \right ) \left (1+\frac {t}{2}\right ) \]

Solution by Mathematica

Time used: 0.025 (sec). Leaf size: 14

DSolve[{D[x[t],{t,2}]+x[t]==Cos[t],{x[0]==0,Derivative[1][x][0] == 1}},x[t],t,IncludeSingularSolutions -> True]
 
\[ x(t)\to \frac {1}{2} (t+2) \sin (t) \]