The hosts began the game without John Souttar after the defender picked up a knock in training. That meant Taylor Moore kept his place in the side, despite the return of Smith.
As expected Hearts saw plenty of the ball during the early exchanges but came up against a well-drilled Livingston defensive wall that was difficult to penetrate.
The home side had a chance to test Max Stryjek in the 24th minute when Barrie McKay earned a free-kick just outside the box but Stephen Kingsley – who notched a stunning set-piece in last weekend's draw at Ross County – hit the wall with his effort.
But Hearts stormed ahead a minute later when Smith finished off a flowing move. McKay spun away from Adam Lewis and crossed for Cochrane, who laid a first-time pass back to the defender.
Smith then curled a first-time left-footed drive high into the corner of the net from 12 yards.
Hearts had their tails up and went searching for a second. It arrived in the 33rd minute from Boyce from the penalty spot.
Stryjek at least made a morale-boosting save before the half was out, palming a fizzed half-volley from Smith over his bar.
And after Stryjek pulled off an excellent save to keep out a Kingsley free-kick, Cochrane made it three in the 65th minute.
McKay fired a low cross straight across the box and the on-loan Brighton man was left with a simple tap-in at the back post.