Dundee United booked their ticket for Monday's Scottish Cup semi-final draw with a deserved 2-1 victory over Dundee at Dens Park.