~ためには ('in order to / for the purpose of') combines ~ために with は for topic emphasis — 'as for how to do X.' ~ばよい ('it's enough to do X / just do X') is a fixed pattern giving minimal sufficient instructions. 掛ける ('multiply,' in this mathematical sense).