Solution (source code)

= Solution
{c}

Matching powers of $\epsilon$ gives $u_0''+u_0=0$, $u_1''+u_1=u_0^2$, and $u_2''+u_2=2u_0u_1$, with $u_0(0)=2$ and homogeneous initial data for every higher correction. Thus
$$
u_0=2\cos t,\qquad u_1=2-\tfrac43\cos t-\tfrac23\cos2t.
$$
There is no resonant fundamental forcing at first order. At second order,
$$
2u_0u_1=\tfrac{20}3\cos t-\tfrac83-\tfrac83\cos2t-\tfrac43\cos3t.
$$
The first term resonates with the homogeneous oscillator. Solving with the initial data gives
$$
u_2=\tfrac{10}3t\sin t-\tfrac83+\tfrac{29}{18}\cos t+\tfrac89\cos2t+\tfrac16\cos3t.
$$
Consequently the regular perturbation approximation is $u=u_0+\epsilon u_1+\epsilon^2u_2+O(\epsilon^3)$ for fixed $t$. \b[The first <secular term> is $(10/3)\epsilon^2t\sin t$, at order $\epsilon^2$]. It makes the regular expansion nonuniform on times of order $\epsilon^{-2}$.