In my school's lecture notes on International Trade, a numerical example of how the Theory of Comparative Advantage is featured. It is a simplified 2-country, 2-goods model and features constant opportunity costs.
The US is able to produce either 200 kg of wheat or 120 m of cloth while China is able to produce either 10 kg of wheat or 20 m of cloth. That means, the US has an absolute advantage over China in the production of bosth wheat and cloth. However, the US has a comparative advantage in the production of wheat, sacrificing only 0.6 m of cloth for each 1 kg, while China has a comparative advantage in the production of cloth, sacrificing only 0.5 kg of wheat for each 1 m. Initially, each country allocates equal amounts of resources to the production of each commodity: US produces 100 kg of wheat and 60 m of cloth while China produces 5 kg of wheat and 20 m of cloth. However, this arrangement is not optimal. China specialises completely in the production of cloth, producing 20 m of cloth while the US engages in partial specialisation, producing 110 kg of wheat and 54 m of cloth. They then engage in trade with an exchange ratio of 1 kg of wheat to 1 m of cloth. China gives the US 10 m of cloth while the US gives China 10 kg of wheat. The outcome of specialisation and exchange is that China is able to enjoy more wheat while the US is able to enjoy more cloth.
However, I would like to find out what is the optimal production and trading arrangement such that both countries stand to gain the greatest amount of output overall for consumption. I am not sure how the numbers were chosen and why certain decisions were made (e.g. China completely specialising in cloth production, US diverting a tenth of its resources from cloth production to wheat production). Can calculus be used to find out what is indeed the most optimal arrangement?