During the initial phases of glycolysis and the TCA cycle, cofactors such as NAD+ donate and accept electrons that aid in the electron transport chain's ability to produce a proton gradient across the inner mitochondrial membrane. The ATP synthase complex exists within the mitochondrial membrane (F portion) and protrudes into the matrix (F portion).  The energy derived as a result of the chemical gradient is then used to synthesize ATP by coupling the reaction of inorganic phosphate to ADP in the active site of the ATP synthase enzyme; the equation for this can be written as ADP + P → ATP.