# Asymptotics: replacing all arguments in a trig function with dummy variable after manipulation

I'm doing manipulations on functions of the form

$$\phi(x,z,t) = \sum_n a_n(\epsilon x,\epsilon t,z)e^{in( k_ox -\omega_o t + \epsilon \theta(\epsilon x,\epsilon t)))} e^{(k_o+\epsilon k(\epsilon x,\epsilon t) z)},$$ and $$\eta(x,t) =\sum_n b_n(\epsilon x,\epsilon t)e^{in( k_ox -\omega_o t + \epsilon \theta(\epsilon x,\epsilon t)))}$$

for constants $k_o,\omega_o$ and $\epsilon << 1$.

In particular, I'm calculating things like $\phi_t+\frac{1}{2}( \nabla \phi)^2+gz=0$ evaluated at $z=\eta$.

First, I'd like to apply the operators (i.e. the derivatives), and then evaluate that function at $z=\eta$. This I can do using, eg

Derivative[0,0,1][phi][x,eta[x,t],t]+1/2(Derivative[0,2,0][phi][x,eta[x,t],
t]+Derivative[2,0,0][phi][x,eta[x,t],t])+g*eta[x,t]


Now, my problem is that I want to satisfy the equation given above to a certain order. For simpler 1d problems I've used things like "Series" to expand these asymptotic series about $\epsilon=0$. This won't work here, as I need to keep the phases in tact, because of an averaging process I do later on. So, explicitly, my question is, how do I calculate, eg, the derivative written above, and then redefine the phases $n( k_ox -\omega_o t + \epsilon \theta(\epsilon x,\epsilon t)))$ as some constant dummy variable, say $\tau$, and then expand the resulting equation about $\epsilon =0$ to a prescribed order?

Any tips are appreciated,

Nick

EDIT: Since I haven't generated much attention, I'll tell you what I'm currently doing, and perhaps someone can suggest a way to automate/improve the procedure.

Currently, I'm calculating the desired equation, evaluating it at the desired place, and then doing a manual search (command+f) to replace all terms $(\epsilon x, \epsilon t) \to (x,t)$, and then doing the same thing to replace the phase with $\tau$, before using the Series function to the desired order. I cannot find relevant resources on how to automate this process. But that's essentially what I'm looking to do.

• The "code" above does not parse. Hard to do much absent a working example. – Daniel Lichtblau Oct 7 '14 at 13:41
• @DanielLichtblau Thanks for pointing this out. It should now parse. – Nick P Oct 7 '14 at 17:48