How to calculate it depends on what you are told in the question – there is no standard way.
The benefit of synergy is the difference between the market value of the combined company, and the total of the current market value of the individual companies before the takeover.