We compare two different derivations of the gyrokinetic equation: the Hamiltonian approach in Dubin D H E et al (1983 Phys. Fluids26 3524) and the recursive methodology in Parra F I and Catto P J (2008 Plasma Phys. Control. Fusion50 065014). We prove that both approaches yield the same result at least to second order in a Larmor radius over macroscopic length expansion. There are subtle differences in the definitions of some of the functions that need to be taken into account to prove the equivalence.