I have a question regarding using multiple scales to solve (approximate) the solution of a differential equation.
I have the following differential equation $$\ddot{x} +(4+K \epsilon^2 + \epsilon \cos2t)x=0, \quad x(0)=1, \quad \dot{x}(0)=0,$$ where $K$ is a constant and $\epsilon \ll 1$.
I have shown that a standard perturbation solution becomes invalid when $\epsilon^2t = O(1)$.
The question I'm working on then asks, 'by using the method of multiple scales find the leading order solution for $x$ valid when $\epsilon^2t = O(1)$'.
I have spent a long while attempting this question, and I can't quite seem to make it work. When I've been taught the subject the examples only covered when a standard perturbation solution becomes invalid for $\epsilon t = O(1)$. I feel as if I'm missing a knack for problems when solution becomes invalid when $\epsilon^2t = O(1)$. I've given my attempt in as much detail as possible, and asked some questions at the end.
I've attempted the question as follows. Let $$\tau=t \quad \text{and} \quad T=\epsilon^2t, $$ then $$ \dot{x} = x_{\tau} + \epsilon^2 x_T \quad \text{and} \quad \ddot{x} = x_{\tau \tau} + 2\epsilon^2 x_{T \tau}. $$ Substituting these in to the differential equation we have, $$x_{\tau \tau}+2\epsilon^2x_{T \tau}+(4+K \epsilon^2 + \epsilon \cos2\tau)x = 0. \quad \text{(1)}$$ Now let $$ x = X_0(\tau,T) + \epsilon X_1(\tau,T) + \epsilon^2 X_2(\tau,T) + O(\epsilon^3).$$ Substituting this value of $x$ into $(1)$ and neglecting terms $O(\epsilon^3)$ gives $$ (X_{0_{\tau \tau}} +4X_0) +\epsilon (X_{1_{\tau \tau}} + 4X_1 + X_0 \cos2\tau) + \epsilon^2 (X_{2_{\tau \tau}} + 4X_2 + KX_0 + X_1 \cos{2\tau} + 2X_{0_{\tau T}}) =0.$$ Equating each power of epsilon gives the following differential equations $$X_{0_{\tau \tau}} +4X_0=0$$ $$X_{1_{\tau \tau}} + 4X_1 = -X_0 \cos2\tau$$ $$X_{2_{\tau \tau}} + 4X_2 = -KX_0 - X_1\cos{2\tau} - 2X_{0_{\tau T}}.$$ Note we have initial conditions, $$x(0)=1 \implies X_0(0,0) + \epsilon X_1(0,0) + \epsilon^2 X_2(0,0) = 1 \\ \implies X_0(0,0)=1, \quad X_1(0,0) = X_2(0,0) =0,$$ and, $$\dot{x}(0)=0 \implies \left[ X_{0_{\tau}} + \epsilon^2 X_{0_{T}} \right] + \epsilon \left[ X_{1_{\tau}} + \epsilon^2 X_{1_{T}} \right] + \epsilon^2 \left[ X_{2_{\tau}} + \epsilon^2 X_{2_{T}} \right] =0 \quad \text{at} \; \tau=T=0 \\ \implies \left[ X_{0_{\tau}} \right] + \epsilon \left[ X_{1_{\tau}} \right] + \epsilon^2 \left[ X_{2_{\tau}} + X_{0_{T}} \right] =0 \quad \text{at} \; \tau=T=0 \\ \implies X_{0_{\tau}}(0,0) = X_{1_{\tau}}(0,0) = 0, \quad X_{2_{\tau}}(0,0) = -X_{0_{T}}(0,0).$$ Finally, on to solving the equations. The $\epsilon^0$ equation yields, $$X_0(\tau,T)=A(T)\cos(2\tau)+B(T)\sin(2\tau),$$ and the initial conditions require, $$A(0)=1, \quad \text{and} \quad B(0)=0.$$ Next the $\epsilon^1$ equation becomes, $$X_{1_{\tau \tau}} + 4X_1 = -X_0 \cos2\tau = -\frac{A}{2}\cos{4 \tau} -\frac{B}{2}\sin{4 \tau} -\frac{A}{2}.$$ This has solution $$X_1 = C(T)\cos{2\tau}+D(T)\sin{2\tau} + \frac{A(T)}{24}\cos{4\tau} + \frac{B(T)}{24}\sin{4\tau} - \frac{A(T)}{8}.$$ There are no secular terms growing with $\tau$, so, so far so good. Finally, I move onto the $\epsilon^2$ differential equation: \begin{align} X_{2_{\tau \tau}} + 4X_2 &= -KX_0 - X_1\cos{2\tau} - 2X_{0_{\tau T}} \\ &= -K[A\cos{2\tau} + B\sin{2 \tau}] - [C(T)\cos(2\tau)+D(T)\sin(2\tau) + \frac{A(T)}{24}\cos{4\tau} + \frac{B(T)}{24}\sin{4\tau} - \frac{A(T)}{8}]\cos{2\tau} -2[2B'\cos{2 \tau} -2A' \sin{2 \tau}] \\ &= [(\frac{5}{48}-K)A-4B']\cos{2\tau} + [-(\frac{1}{48}+K)B+4A']\sin{2 \tau} + \text{other terms}. \end{align} Now, it is my understanding that the coefficients of the terms I've left displayed need to be set equal to zero, that is the secularity condition. This is as far as I have gotten.
I have a few questions:
The question asks to find the leading order solution, is this just $X_0$?
I'm not sure where to go from here for solving it, if I set the coefficients to $0$ and solve for A and B, surely there isn't enough conditions on A and B to determine them fully? Also, I feel as if this solution would be way more complicated than it should be.
Thank you for any help.
I would say yes to your last observation. This leads to $$ 16A''=(\tfrac1{48}+K)(\tfrac5{48}-K)A,~~A(0)=1,~A'(0)=0, $$ which gives a bounded oscillation with frequency $\approx\frac{|K|}4$ for $K$ outside $[-\frac1{48},\frac5{48}]$ and an exponentially growing solution for $K$ inside this interval.