Optical tweezers and colloid probe atomic force microscopies have been used for measurement of the force curve between a sample surface and a probe. In the measurement, the force curve is mainly obtained by using both the spring constant and the displacement of the probe (we call it the general method). However, when there is a viscosity gradient in the interfacial liquid, the general method cannot predict the force curve accurately. In this study, we compared the force curves calculated from the general method and a method considering both the viscosity gradient and the acceleration of the probe. From the comparison, we found a problem in the general method and use of both the viscosity gradient and the acceleration is important for measurement of an accurate force curve. However, the viscosity gradient in the interfacial liquid is unknown in general. Applying statistical mechanics and Brownian motion simulation, we found a fact that the force curve can be accurately determined without information of the viscosity gradient. In addition, we propose an inverse calculation method of the viscosity distribution with use of the force curve obtained from the statistical mechanics method.