Matri strikes twice to rejuvenate Juventus
Substitute Luca Toni headed a third goal to lift Juve out of their rut after Italy's best supported and most successful club failed to win their previous four games in all competitions.
Matri had scored 11 goals for Cagliari this season but, despite being jeered by the home fans from the outset, needed only 20 minutes to score against them, wrong-footing goalkeeper Michael Agazzi after being picked out by Milo Krasic's pass.
Cagliari levelled six minutes after the restart when Robert Acquafresca side-footed home Andrea Cossu's cross at the far post after being left unmarked by the Juve rearguard.
The hosts put Juve on the rack and looked more likely winners until Matri struck again in the 75th minute, volleying in from Giorgio Chiellini's cross at the far post.
Toni completed the win when Alessandro del Piero picked him out on the edge of the area and he scored with a brilliant, looping header from 15 metres.
Udinese striker Antonio Di Natale had earlier scored his 100th Serie A goal for the club as they climbed to fifth on 40 points with a 2-0 home win over struggling Sampdoria.
Udinese's Chile forward Alexis Sanchez, in fine form after the north-eastern club fought off the advances of Inter Milan in January, got the opener after 18 minutes before strike partner Di Natale sealed the win five minutes before the break.
Sampdoria again looked toothless having let main forwards Antonio Cassano and Giampaolo Pazzini leave last month and they are now 13th, a long way from a targeted European spot after a third straight defeat.