Borussia Dortmund have confirmed that Germany midfielder Mario Gotze will join Bundesliga rivals Bayern Munich in a £32million deal.