Let x be the initial amount of cards that Michael had.
Since he bought 8 new Pokémon cards, the total number of cards that he had at that moment was x+8.
After his dog ate half the amount of cards that Michael had, the number of cards was reduced to:
[tex]\frac{x+8}{2}[/tex]Since he has 40 cards left, then:
[tex]\frac{x+8}{2}=40[/tex]Solve for x to find the amount of cards that Michael had at the beginning. Multiply both members by 2:
[tex]\begin{gathered} 2\times\frac{x+8}{2}=2\times40 \\ \Rightarrow x+8=80 \end{gathered}[/tex]Substract 8 from both members of the equation:
[tex]\begin{gathered} x+8-8=80-8 \\ \Rightarrow x=72 \end{gathered}[/tex]Therefore, the amount of cards Michael started with, was:
[tex]72[/tex]