The Scottish League Two side went in front through David Gold but three goals in five second-half minutes – including a brace from Osman Sow – dispelled any thoughts of an upset.
Martin Grehan did bag another for Arbroath from close range five minutes from time but Craig Wilson’s own goal ensured Hearts had the last word – and sent the bulk of the 6,240 crowd home in good spirits.
The visitors stunned the home fans when Gold (40) found space in the box and slotted the ball past goalkeeper Jack Hamilton.
The mis-firing hosts struck back when Jordan McGhee (57) found the bottom corner from eight yards and fans’ favourite Sow bagged two in quick succession, one of them from the spot after Sam Nicholson had been fouled.
Grehan’s close-range header (85) gave Arbroath fresh hope, but Wilson inadvertently gifted the Premiership side their fourth goal in injury time.
Hearts coach Robbie Neilson said: “We’re through but it was a disappointing performance. In the first half we passed it for the sake of passing it.
“When the opportunity arises to play forward you have to do it, and I thought there was a wee bit of passing the buck and waiting for someone else to make the key pass. The second half was a lot better.”