Averaging for nonlinear systems I am trying to figure out how the following result has been obtained.
Consider a function $J:\mathbb{R} \longrightarrow \mathbb{R}$ and a dynamical system:
$$ \dot{ \hat{x} }(t) = k a \sin ( \omega t ) J( \hat{x}(t) + a \sin ( \omega t) ) $$
with constant parameters $k, a, \omega$.
Consider Taylor series expansion:
$$ J( \hat{x}(t) + a \sin ( \omega t) ) =  J( \hat{x}(t) ) + \frac{ \partial J }{ \partial \hat{x}  } \Bigg|_{ \hat{x} = \hat{x}(t) } a \sin ( \omega t ) + o(a^2) $$
Now since
$$ \dot{ \hat{x} }(t) = k a \sin ( \omega t ) \left( J( \hat{x}(t) ) + \frac{ \partial J }{ \partial \hat{x}  } \Bigg|_{ \hat{x} = \hat{x}(t) } a \sin ( \omega t )+ o(a^2) \right) $$
is a periodic ( ??? ) time-varying system, averaging may be applied:
$$ \dot{ \hat{x } }(t) = \frac{1}{T} \int_{0}^{T} k a \sin ( \omega t ) \left(   J( \hat{x}(t) ) + \frac{ \partial J }{ \partial \hat{x}  } \Bigg|_{ \hat{x} = \hat{x}(t) }a \sin ( \omega t ) + o(a^2) \right) dt $$
where $T = \frac{2 \pi}{ \omega }$.
And then:
$$ \frac{1}{T} \int_{0}^{T} k a \sin ( \omega t ) \left( J( \hat{x}(t) ) + \frac{ \partial J }{ \partial \hat{x}  } \Bigg|_{ \hat{x} = \hat{x}(t) }a \sin ( \omega t ) + o(a^2) \right) dt = \frac{ka^2}{2} \frac{ \partial J }{ \partial \hat{x}  } \Bigg|_{ \hat{x} = \hat{x}(t) } + o(a^4) $$
How was this integral computed?
I can only see a reason if $J$ is periodic as well or even constant in $[0, T]$. Otherwise, I can't see how the integrand is periodic and how $o(a^4)$ appears.
I found this result here on page 7.
Remark: I didn't denote the $ \hat{x} $ in the averaged system with another symbol, but I feel that it would have been more correct to use something like $ \hat{x}_{ \text{av} } $ to avoid ambiguity.
 A: I looked through the paper you referenced and even the book they reference within $[17]$.  I too cannot see why the above is true unless $J$ is periodic or constant.  So I think there is a heavy abuse of notation here ("By fixing $\hat{x}(t)$ to a dummy variable $z$") and what they are really saying is as follows:
Instead of using this expression:
$$ \dot{ \hat{x} }(t) = k a \sin ( \omega t ) \left( J( \hat{x}(t) ) + \frac{ \partial J }{ \partial \hat{x}  } \Bigg|_{ \hat{x} = \hat{x}(t) }a \sin ( \omega t ) + O(a^2) \right) $$
Define $y(s)$ to be the solution of the following differential equation
$$ \frac{d}{ds}(y(s)) = k a \sin ( \omega (s+t) ) \left( J( \hat{x}(t) ) + \frac{ \partial J }{ \partial \hat{x}  } \Bigg|_{ \hat{x} = \hat{x}(t) }a \sin ( \omega (s+t) ) + O(a^2) \right) $$
Here we have taken the Taylor series in $x$ of $J(x)$, expanded about $\hat{x}(t)$, and evaluated at $\hat{x}(t) + a \sin ( \omega ( s + t ) )$. From that point of view, $y(0) = \hat{x}(t)$ and $y$ as a function of $s$ is periodic with period $T$.
The integration that comes next then makes sense.  Note the integral is $O(a^4)$ because 
$$\int_0^T a \sin (\omega (s + t)) a^k \sin^k(\omega(s + t)) ds$$ is zero iff $k$ is even.
