Over the years, I've noticed a problem with students writing hydroxide in a formula.
It seems that they do not recognize OH as a polyatomic ion.
They (meaning you, the student) seem to want to treat it as an element.
That means, using magnesium hydoxide as an example, the student writes the formula as MgOH2.
As you can see, there are no parenthesis. The correct answer is Mg(OH)2.
The weird thing is, the same students have no problems with aluminum nitrate and corectly write Al(NO3)3. I don't know where the block is.
These students have been instructed in using parenthesis and can use them in other situations, but when presented with barium hydroxide, almost invariably they write BaOH2. Even aluminun hydroxide is written AlOH3.
It appears that students (not all, but a significant number) simply do not recognize OH a a polyatomic. Even after instruction and practice.
I don't know why.