IUPAC definition
The IUPAC definition is the following:
- The complete, net removal of one or more electrons from a molecular entity (also called 'de-electronation').
- An increase in the oxidation number of any atom within any substrate.
- Gain of oxygen and/or loss of hydrogen of an organic substrate.
All oxidations meet criteria 1 and 2, and many meet criterion 3, but this is not always easy to demonstrate. Alternatively, an oxidation can be described as a transformation
of an organic substrate that can be rationally dissected into steps or primitive changes
. The latter consist in removal of one or several electrons from the substrate followed or preceded by gain or loss of water and/or hydrons
or hydroxide ions, or by nucleophilic
substitution by water or its reverse and/or by an intramolecular molecular
rearrangement
. This formal definition allows the original idea of oxidation (combination with oxygen), together with its extension to removal of hydrogen, as well as processes closely akin to this type of transformation
transformation (and generally regarded in current usage of the term in organic chemistry to be oxidations and to be effected by 'oxidizing agents') to be descriptively related to definition 1.
So that is the official definition, and it also gives multiple rules (and admits that the third rule does not always work). In order to use the second definition, you also need to look up their definition of oxidation state.
Definitions in your textbook
I can't understand why they are changing the definitions again and again.
They are changing the definition to apply the concept to more and more reactions.
In the explanation of the IUPAC definition I posted above, they mention "the original idea of oxidation (combination with oxygen)". That's where your first textbook definition comes from. So the following reaction is an oxidation because there is a reaction with dioxygen:
$$\ce{4Fe^2+(aq) + O2(g) + 4H+(aq) -> 4Fe^3+(aq) + 2 H2O}$$
If I want to call the similar reaction with fluorine an oxidation as well, I have to generalize the definition to loss of electrons (your second definition). So this would be an oxidation of iron(II) as well:
$$\ce{2Fe^2+(aq) + F2(g) -> 2Fe^3+(aq) + 2 F-}$$
Finally, if I want to generalize further to reactions where I want to discuss loss of electrons in atoms that are part of a covalent molecule, I need some accounting scheme to assign valence electrons to individual atoms (this is called oxidation number or oxidation state). Once that is in place, I can discuss reactions such as the following in terms of oxidation (and reduction):
$$\ce{H2C=CH2 + H2 -> H3C-CH3}$$
Here, your first definition does not apply (no oxygen) and your second definition is difficult to apply (how do we know which species lost electrons - they are all neutral, and they all have different composition?). So that is where you need some rule similar to your third rule ("decrease in electron density"). Usually, though, this is stated using oxidation states so that you are back to gaining or losing an integral number of electrons (i.e. oxidation state changed by +1 rather than "the electron density decreased slightly).
At this point, it becomes a bit fuzzy and there will be situations where the oxidation state is ambiguous. You gain clarity in the context of electrochemistry when you separate reactions into half reactions in electrochemical cells, and can actually measure the transfer of electrons that pass through the wire connecting the two cells.