Solve the ODE $\ddot{y}+2\lambda\dot{y} + n^2y=f\cos(wt)$ for given boundary conditions.

ordinary differential equations

I'm having trouble understanding the given solution to this problem.

Solve the ODE $$\ddot{y}+2\lambda\dot{y} + n^2y=f\cos(wt)$$ with $y(0)=\dot{y}(0)=0$, where $f$, $n$, $w$ and $\lambda$ are positive constants with $\lambda <<n$.

Solution

enter image description here

The 3rd line onward is what I am having difficulty understanding. My attempt is below.

Attempt

$y_h=e^{-\lambda t}(A_1\cos(\sigma t)+A_2\sin(\sigma t))$ where $y_h$ is the homogeneous solution.

For the particular solution guess $y_p=B_1\cos(wt)+B_2\sin(wt)$, so $\dot{y}_p=-B_1 w\sin(wt)+B_2 w\cos(wt)$, and $\ddot{y}_p=-B_1 w^2\cos(wt)-B_2 w^2\sin(wt)$.

Substitute these into the ODE to get
$$ \cos(wt)[B_1 (n^2-w^2)+2\lambda w B_2]+\sin(wt)[B_2(n^2-w^2)-2\lambda w B_1]=f\cos(wt).$$

Then $$B_1 (n^2- w^2)+2\lambda w B_2 =f \quad\&\quad B_2(n^2-w^2)-2\lambda w B_1=0$$

The 2nd equation gives $B_1=B_2\dfrac{(n^2-w^2)}{2\lambda w}$. Substituting into the 1st equation gives $B_2=\dfrac{2\lambda w f}{(n^2-w^2)^2+4\lambda^2w^2}$, which implies $B_1=\dfrac{f(n^2-w^2)}{(n^2-w^2)^2+4\lambda^2w^2}$.

Substituting these back into the original guess we get
$$y_p=\dfrac{2\lambda w f}{(n^2-w^2)^2+4\lambda^2w^2}\cos(wt)+\dfrac{f(n^2-w^2)}{(n^2-w^2)^2+4\lambda^2w^2}\sin(wt).$$

So the general solution is

$$y=y_h+y_p=e^{-\lambda t}(A_1\cos(\sigma t)+A_2\sin(\sigma t))+\dfrac{2\lambda w f}{(n^2-w^2)^2+4\lambda^2w^2}\cos(wt)+\dfrac{f(n^2-w^2)}{(n^2-w^2)^2+4\lambda^2w^2}\sin(wt).$$

…and now I just feel lost (partly due to being rusty and the solution being written in a foreign style).

Best Answer

The solutions are both correct, if you were to insert the constants $B_1,B_2$ correctly back into $y_p$. The difference of the forms is "hidden" in the not largely discussed nature of $\alpha$.

The cited solution considers the original equation as the real part of the complex equation $$ \ddot z+2λ\dot z+n^2z=f\,e^{i\omega t}. $$ This equation now only has a single exponential as inhomogeneity, so that the standard procedure of the method of undetermined coefficients easily applies, trying $z_p(t)=C\,e^{i\omega t}$ one finds $$C=\frac{f}{-ω^2+2iλω+n^2}.$$

At this point, instead of using the polar decomposition of $C=R\cdot e^{iα}$, you could as well just compute the real part of the solution found, $$ y_p(t)=Re(z_p(t))=Re\left(\frac{f((n^2-ω^2)-2iλω)(\cos ωt+i\sin ωt)}{(n^2-ω^2)^2+(2λω)^2}\right) \\ =\frac{f((n^2-ω^2)\cos ωt+2λω\sin ωt)}{(n^2-ω^2)^2+(2λω)^2} $$ which is your solution with the constants inserted correctly.

Related Question