I want to figure out how to find periodic solutions of ODE via the small parameter method. I will provide couple of examples of what I mean.
Consider equation $\ddot x + 3x = 2 \sin t + \mu \dot x^2$. The solution I want to get is $x(t, \mu) = \sin t + \mu (\frac16 - \frac12 \cos 2t) + \mu^2(-\frac16 \sin 3t + \frac12 \sin t)) + ...$.
Consider equation $\ddot x + 3x + x^3= 2 \mu \cos t$. The solution I want to get is $x(t, \mu) = \mu \cos t + \frac{\mu^3}{8} (\frac13 \cos t - 3 \cos t) + ...$.
I am interested in small numbers of first coefficients, namely 3-4 first terms.
This must be implemented in Mathematica, but I was not able to find anything relevant.
Please help me to do it. Thanks a lot for you help!
Update:
bbgodfrey, thanks a lot for your answer! I will post my answer to your answer here since comments are limited. Your answer is wrong, unfortunately, but it is almost correct. I can solve this kind of problems manually and I see the errors just in first two lines, but I can not fix them, since I am Mathematica newbie. I can also explain how to solve this kind of problems and what you should get. I hope that as long as first two lines are correct, everything will work correct. Anyway I can find any error in the code, but I can not fix it. Let us consider the first example. What your are doing is you trying to find the solution in the form $$x(t, \mu)=x_0(t)+\mu x_1(t)+\mu^2x_2(t)+...$$ You just plug first terms of this series into the equation and make the coefficients of $\mu$ with the same degree equal. What you should get in first equation is $$\ddot x_0 + 3x_0 = 2 \sin t, \ddot x_1 + 3x_1 = \dot x_0^2,\ddot x_2 + 3x_2 = 2\dot x_0\dot x_1.$$ But what your code gives in last condition is $$\ddot x_2 + 3x_2 = 4\dot x_0\dot x_1.$$ This $4$ is incorrect, it must be 2. You can check it manually within $3$ mins.
Can you please fix your code? Thanks a lot!