If I have the differential equation
$$ \ddot x + \omega_{0}^{2} x = F_0 \sin{\omega t}$$
The solution is either $$ x(t) = A\cos{\omega_{0}t} + B\sin{\omega_{0}t} + \frac{F_0}{\omega_{0}^{2} – \omega^{2}} \sin{\omega t} \tag{—> (1)}$$
or $$x(t) = D\cos{(\omega_{0}t – \delta)} + \frac{F_0}{\omega_{0}^{2} – \omega^{2}} \sin{\omega t} \tag{—> (2)}$$
Both solutions are equivalent from the identity $\cos(x-y) = \cos x\cos y + \sin x\sin y$
But now here comes my question, if I'm given initial conditions $x , \dot x$ are zero at $t=0$ and I use equation (1) to determine the constants, I get:
\begin{align}
x(0) &= A = 0
\\
x(t) &= B\sin{\omega_{0}t} + \frac{F_0}{\omega_{0}^{2} – \omega^{2}} \sin{\omega t}
\\
\dot x(t) &= \omega_{0} B \cos{\omega_{0}t} + \omega \frac{F_0}{\omega_{0}^{2} – \omega^{2}} \cos{\omega t}
\\
\dot x(0) &= \omega_{0} B + \omega \frac{F_0}{\omega_{0}^{2} – \omega^{2}} = 0
\\
B &= – \frac{F_0}{\omega_{0}^{2} – \omega^{2}} \frac {\omega}{\omega_{0}}
\end{align}
So I have determined $A$ and $B$ uniquely.
Now when I use the second equation
\begin{align}
x(t) &= D\cos{(\omega_{0}t – \delta)} + \frac{F_0}{\omega_{0}^{2} – \omega^{2}} \sin{\omega t}
\\
x(0) &= D\cos{\delta} = 0
\end{align}
So $\delta$ must equal $(n+\frac{1}{2}) \pi$
\begin{align}
x(t) &= D\cos{(\omega_{0} t – (n+\frac{1}{2}) \pi)} + \frac{F_0}{\omega_{0}^{2} – \omega^{2}} \sin{\omega t}
\\
\dot x(t) &= -\omega_{0} D \sin{(\omega_{0}t – (n+\frac{1}{2}) \pi)} + \omega \frac{F_0}{\omega_{0}^{2} – \omega^{2}} \cos{\omega t}
\\
\dot x(0) &= \omega_{0} D \sin{(n+\frac{1}{2}) \pi)} + \omega \frac{F_0}{\omega_{0}^{2} – \omega^{2}} = 0
\end{align}
Therefore $D = – \frac {\omega F_{0}}{\omega_{0} (\omega_{0}^{2} – \omega^{2})} (-1)^{n}$ since $\sin{(n+\frac{1}{2}) \pi} = (-1)^{n}$
So now I have a value of $D$ for every value of $n$, I have no idea which $D$ to choose, and why don't the two procedures yield the same result even though they are equivalent equations?
Best Answer
Your formulas are correct. $n$ in $D$ is to ensure the sign. Actually, if you plug the formula for $D$ into the expression and break the cosine term into the sum of production, then you will get the same result.