In this paper, the vibration of an atomic force microscope (AFM) cantilever in tapping mode with two whole piezoelectric layers submerged in liquid medium is investigated. In the performed modeling, the sample surface has been considered as rough, and to show these surface asperities, two models of Rumpf and Rabinovich have been employed for analyzing the attractive Van der Waals force. This paper has been organized in two sections. The first section deals with the functioning of cantilever over rough surfaces, which accompanies the changes of the attractive Van der Waals force, and the second section involves the changes in the Van der Waals force which lead to a change in the liquid medium. The cantilever is totally submerged in the liquid. To show the effect of liquid on cantilever, first, only the cantilever tip is immersed in the liquid and it is dynamically analyzed. Then, the cantilever is totally submerged and then taken out of the liquid, so that the additional mass and damping of the cantilever could be calculated. In these two manners of cantilever immersion in liquid, the effects of the added mass and damping on the cantilever can be measured. When a cantilever vibrates totally in liquid, since the mass and damping of the liquid that is present on the cantilever cannot be determined, first, the cantilever's natural frequency in liquid is estimated in the laboratory and then by using this frequency and the cantilever stiffness (which is not medium-dependent and is always considered as constant), the additional mass and damping of the cantilever are determined.