An elliptic equation in a rectangle with coefficients depending on a fast variable and with its period being a small parameter is considered. An asymptotic expansion of the solution up to an arbitrary degree of the small parameter is constructed and substantiated by applying the two-scale expansion method.