Two methods of computing molecular dipole and quadrupole derivatives