The differential operator method is an effective Monte Carlo technique developed for calculating derivatives and perturbations. It has often been applied to eigenvalue problems. This paper extends applicability of the method to inhomogeneous problems with internal and external neutron sources. Two issues associated with these problems were considered. First of all, it was necessary to use a special technique that treats inhomogeneous problems within the framework of the neutron generation method with a constant number of neutrons per generation. This technique optimizes Monte Carlo calculations and eliminates difficulties that appear in the classical technique as the effective multiplication factor approaches unity. Furthermore, use of the technique facilitated solving the usual issue of the differential operator method associated with fission source, or more exactly total neutron source, perturbations because some modification of the approach recently proposed for eigenvalue problems could be employed. The proposed technique can be used for calculating derivatives of reaction rates with respect to neutron cross sections or material densities. Perturbations of external source and geometrical parameters were outside the scope of this work.