74.21.6 problem 21 (b)

Internal problem ID [16644]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 5. Applications of Higher Order Equations. Exercises 5.3, page 249
Problem number : 21 (b)
Date solved : Tuesday, January 28, 2025 at 09:14:35 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.020 (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 \left (t \right ) = \sin \left (t \right ) \left (1+\frac {t}{2}\right ) \]

Solution by Mathematica

Time used: 0.022 (sec). Leaf size: 45

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}{4} \sin (t) \left (-4 \int _1^t\cos ^2(K[1])dK[1]+4 \int _1^0\cos ^2(K[1])dK[1]+\sin (2 t)-4\right ) \]