74.1.16 problem 23

Internal problem ID [15796]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 1. Introduction to Differential Equations. Exercises 1.1, page 10
Problem number : 23
Date solved : Tuesday, January 28, 2025 at 08:07:30 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.003 (sec). Leaf size: 30

dsolve(diff(x(t),t$2)+x(t)=t*cos(t)-cos(t),x(t), singsol=all)
 
\[ x \left (t \right ) = \frac {\left (t^{2}+4 c_{2} -2 t -1\right ) \sin \left (t \right )}{4}+\frac {\cos \left (t \right ) \left (4 c_{1} +t -2\right )}{4} \]

Solution by Mathematica

Time used: 0.232 (sec). Leaf size: 58

DSolve[D[x[t],{t,2}]+x[t]==t*Cos[t]-Cos[t],x[t],t,IncludeSingularSolutions -> True]
 
\[ x(t)\to \sin (t) \int _1^t\cos ^2(K[2]) (K[2]-1)dK[2]+\cos (t) \int _1^t-\cos (K[1]) (K[1]-1) \sin (K[1])dK[1]+c_1 \cos (t)+c_2 \sin (t) \]