18.2.1 problem Problem 15.1

Internal problem ID [3484]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 15, Higher order ordinary differential equations. 15.4 Exercises, page 523
Problem number : Problem 15.1
Date solved : Monday, January 27, 2025 at 07:39:15 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} x^{\prime \prime }+\omega _{0}^{2} x&=a \cos \left (\omega 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.028 (sec). Leaf size: 28

dsolve([diff(x(t),t$2)+ (omega__0)^2*x(t)=a*cos(omega*t),x(0) = 0, D(x)(0) = 0],x(t), singsol=all)
 
\[ x = \frac {a \left (\cos \left (\omega _{0} t \right )-\cos \left (\omega t \right )\right )}{\omega ^{2}-\omega _{0}^{2}} \]

Solution by Mathematica

Time used: 0.336 (sec). Leaf size: 33

DSolve[{D[x[t],{t,2}]+(Subscript[\[Omega],0])^2*x[t]==a*Cos[\[Omega]*t],{x[0]==0,Derivative[1][x][0 ]==0}},x[t],t,IncludeSingularSolutions -> True]
 
\[ x(t)\to \frac {a \left (\cos \left (t \omega _0\right )-\cos (t \omega )\right )}{\omega ^2-\omega _0^2} \]