What specifically do you want explained? The formula is easy to derive geometrically using the phasor diagram. Or you can do it algebraically: since only the phase difference matters, let the complex amplitude from slit one be just A (a real number). Then the complex amplitude from slit two will be Aeiφ. The sum is therefore A(1 + eiφ) = A(1 + cosφ + isinφ), and the magnitude squared is A²(1 + cos²φ + 2cosφ + sin²φ) = A²(2 + 2cosφ) = 2A²(2cos²(φ/2)) = 4A²cos²(φ/2).