Yeah it's basicly trial and error, you can see all the existing potions name and the number of ingredient needed in the cookbook which can help you deduce the recipe (but you will ultimately still need trial and error)