The reason why it's 38 is because that's based on the premise that
NADH = 3 ATP
FADH2 = 2 ATP
When in fact it's argued to be
NADH = 2.5 ATP
FADH2 = 1.5 ATP
There's still some discrepancy in the amount of ATP each coenzyme produces. For OCR's sake, I think you should stick with NADH = 2.6 ATP
If there's also a value for FADH2 too, use it.
From one molecule of glucose, you'll find:
2 NADH from Glycolysis
2 NADH from Link Reaction (remember, two pyruvate from one glucose)
6 NADH from Krebs Cycle (again same reason)
Therefore, a total of 10 NADH reaches the Electron Transport Chain.
2 FADH2 from Krebs Cycle
Therefore a total of 2 FADH2 reaches the Electron Transport Chain.
Thus, the amount of ATP produced from the Electron Transport Chain via Oxidative Phosphorylation is:
(10 x 2.6) + (2 x 1.5) = 29
If you're actually wondering about the amount of ATP produced in the entire of cellular respiration, add the ATP produced from Glycolysis and the Krebs Cycle.
Therefore the total amount is:
29 + 2 + 2 = 33.
The reason why your book says 30 is probably because of the fact that it takes into account of the actual ATP gained from NADH in glycolysis.
Glycolysis happens in the cytoplasm and the mitochondrial membrane is impermeable to NADH. So the electrons have to be transported to the electron transport chain by means of another pathway called a shuttle. There are two different shuttles. One of them shuttles the electrons to the first complex which means 1 NADH = 2.6 ATP
But the other one shuttles the electrons to the third complex which means 1 NADH = 1.5 ATP (or 1.6 ATP by OCR standards)
As for which shuttle is used when, I don't know; I just know both are used.
If we account for this, then the total amount could also be:
(2 x 1.5) + (8 x 2.6) + (2 x 1.5) + 2 + 2 = 30.8
Or (2 x 1.6) + (8 x 2.6) + (2 x 1.5) + 2 + 2 = 31
Either way, there's this range of 30 to 32 ATP produced per glucose in the entirety of cellular respiration. Again that depends on how much ATP is produced per NADH. I feel like saying 30 would be enough by OCR standards.
As for your query on what happens with FADH2, when the coenzyme binds to the second complex, it donates the electrons directly to the electron carrier molecule (which is called Q). The energy released is insufficient to pump protons at this complex. Q then passes the electrons to the third complex (I believe by another electron carrier), which pumps protons into the intermembrane space. This is how FADH2 is responsible for some ATP.
There's some more information I believe. I remember reading that despite being told it's 3 protons = 1 ATP, sometimes there's actually a ratio of 4 protons = 1 ATP, that's beyond my level and knowledge sorry.