How to determine the pH range at which maximum hydrate is present?

**Question:**



> 
> Find the $\mathrm{pH}$ range at which maximum hydrate is present in a solution of oxaloacetic acid (given $\mathrm{pK\_a}$ of $\ce{-COOH}$ in the left is $=2.2$ and on the right is $=3.98$):
> 
> 
> [![enter image description here](https://i.stack.imgur.com/SKBVP.png)](https://i.stack.imgur.com/SKBVP.png)
> 
> 
> 


I understand that the hydrate will be formed at the carbonyl group position, resulting in a product like this:


[![enter image description here](https://i.stack.imgur.com/DhkEw.png)](https://i.stack.imgur.com/DhkEw.png)


I know that the gem-diols are usually stablized by H-bonding, as is the case here as well (between the lower hydroxy and left acid group). I can also see that loss of the $\ce{H+}$ ion from the carboxylic acid group on the left will create an $\ce{O-}$ ion which will have an even stronger H-bonding. However, I am not sure how I can use this fact to relate the given $\mathrm{pK\_a}$ values and the expected $\mathrm{pH}$ range.


I need help completing my train of thought. Thank you!


