We're going to find the price of each bag per kilogram. To do this, we divide the price Bob paid by the ammount of food he bought.
So, the price per kilogram of the first bag of dog food would be
and the price per kilogram of the second bag is
In other words, the price per kilogram of the first bag is $2.12 and the price per kilogram of the second bag is $7.63. As a result, it is more economic to buy the first bag.