We show that given a nonvanishing particular solution of the equation (div p grad +q)u = 0,the corresponding differential operator can be factorized into a product of two first order operators. The factorization allows us to reduce the equation (1) to a first order equation which in a two-dimensional case is the Vekua equation of a special form. Under quite general conditions on the coefficients p and q we obtain an algorithm which allows us to construct in explicit form the positive formal powers (solutions of the Vekua equation generalizing the usual powers (z − z0) n , n = 0, 1, . . .). This result means that under quite general conditions one can construct an infinite system of exact solutions of (1) explicitly, and moreover, at least when p and q are real valued this system will be complete in ker(div p grad +q) in the sense that any solution of (1) in a simply connected domain Ω can be represented as an infinite series of obtained exact solutions which converges uniformly on any compact subset of Ω. Finally we give a similar factorization of the operator (div p grad +q) in a multidimensional case and obtain a natural generalization of the Vekua equation which is related to second order operators in a similar way as its two-dimensional prototype does.