74.21.5 problem 21 (a)

Internal problem ID [16643]
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 (a)
Date solved : Tuesday, January 28, 2025 at 09:14:32 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 )&=0 \end{align*}

Solution by Maple

Time used: 0.007 (sec). Leaf size: 9

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

Solution by Mathematica

Time used: 0.026 (sec). Leaf size: 44

DSolve[{D[x[t],{t,2}]+x[t]==Cos[t],{x[0]==0,Derivative[1][x][0 ]==0}},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)\right ) \]