Last Saturday's unexpected defeat at Norwich and injury to John Stones, leaving City with just one fit specialist centre-back in Nicolas Otamendi, had threatened to unsettle Pep Guardiola's men ahead of the game.
Yet Guardiola had said his players would rise to the challenge and find a solution, and they did just that with midfielder Fernandinho looking comfortable in an emergency defensive role.
City were also at ease in what is now a familiar venue. This is the third successive season they have been paired with the exiled Ukrainian champions and the scoreline was a repeat of their victory in last year's corresponding fixture.
They could have been ahead inside a minute after Raheem Sterling was fouled and Kevin De Bruyne lobbed a free-kick into the box but Rodri headed well wide.
As usual, City dominated possession but the Ukrainian double winners were a threat on the break and Marlos had a shot charged down by Sterling before firing well over.
City went close again when a Sterling cross was headed clear by Mykola Matviyenko and Jesus, preferred to Sergio Aguero up front, had an effort deflected wide.
City were rewarded for their control when they grabbed the lead after 24 minutes. Jesus opted not to shoot when well placed, laying off instead to Gundogan, who curled a low effort against a post. Mahrez was the quickest to react to the rebound and calmly tucked home.
Shakhtar almost claimed an equaliser when Taison fed Junior Moraes in the area but Ederson blocked.
City doubled their lead before the break following more good work by Mahrez. The Algerian cut inside from the right and played inside to Gundogan, who timed his run perfectly to beat Andriy Pyatov with a first-time shot.
De Bruyne could have had a third soon after when he shot into the side netting from a fine through ball by Jesus.
City were almost caught out early in the second half when Ederson was beaten to the ball by Moraes but the opportunity came to nothing.
The visitors were soon back in control and Gundogan tested Pyatov before Alan Patrick mishit a clearance and Sterling slammed a shot straight at a post from a tight angle.
Gundogan had another chance stopped by Pyatov, De Bruyne missed the target and an offside flag prevented an acrobatic effort from Otamendi from counting.
City's third came 14 minutes from time as De Bruyne stretched the Shakhtar defence with a strong run. The Belgian then picked out Jesus with a well-timed pass and the striker finished coolly.
With the job done, City introduced Benjamin Mendy off the bench for his first appearance of the season in the closing minutes.