+5
Okay, with determining the oxidation states there are some rules. This would help you to not get confuse.
(1) The total charge of a stable compound is always equal to zero (meaning no charge).
For example, the ##H_2O## molecule exists as a neutrally charged substance.
(2) If the substance is an ion (either there is a positive or negative charge) the total oxidation state of the ion is the charge (i.e. oxidation state of ##NO_3^”-1″## ion is -1).
(3) All from Group 1A has an oxidation state of +1 (e.g. ##Na^”+1″##, ##Li^”+1″##). All Group 2A and 3A have an oxidation state of +2 and +3, respectively. (e.g. ##Ca^”2+”##, ##Mg^”2+”##, ##Al^”3+”##)
(4) Oxygen always have a charge -2 except for peroxide ion (##O_2^”2-“##) which has a charge of -1.
(5) Hydrogen always have a charge of +1 if it is bonded with a non-metal (as in the case of ##HCl##) and always have a -1 charge if it is bonded with a metal (as in ##AlH_3##).
So let’s try solving your problem, the oxidation state of ##P## in the substance ##KH_2PO_4##.
Based on rule 1, the whole substance has an oxidation state of zero.
##KH_2PO_4## = 0
Based on rules 3 and 5, the oxidation states of ##K## and ##H## atoms are both +1 (since there no metal atom in this substance).
(+1) + [(+1)(2)] + ##PO_4## = 0
Notice that since ##H## atoms have a subscript, I multiply its oxidation state by 2.
Next, based on rule 4 the ##O## atom has a charge of -2.
(+1) + [(+1)(2)] + ##color (red) x## + [(-2) (4)] = 0 where ##color (red) x## is the oxidation state of ##P## atom
Notice again that since ##O## atom has a subscript, I multiplied the oxidation state by 4. Now, we are ready to solve for ##x##.
(+1) + [(+1)(2)] + ##color (red) x## + [(-2) (4)] = 0
(+1) + (+2) + ##color (red) x## + (-8) = 0
(+3) + ##color (red) x## + (-8) = 0
##color (red) x## + (-5) = 0
##color (red) x## = +5
Therefore, the oxidation state of ##P## atom is +5 or ##P^”5+”##.