Effect of variable mass density on the kinematics of scalar gradient