Calculating ratio of conjugate base and acid when pH and pKa are given Buffer solutions are used by biological mammalian systems to maintain the $\mathrm{pH}$ of blood plasma within a narrow range. In these systems, the compound from which this solution is obtained is $\ce{CO2}$, produced in cell respiration, which is converted into $\ce{HCO3-}$ and $\ce{H2CO3}$ inside the red blood cells. Using the Henderson-Hasselbalch equation, answer: $\mathrm{p}K_\mathrm{a} = 6.35$. What is the ratio between $\ce{HCO3-}$ and $\ce{H2CO3}$ in a blood sample with $\mathrm{pH} = 7.4$?


The problem is I try to make the exercise in this way: 

$$\mathrm{pH}= \mathrm{p}K_\mathrm{a} + \log \left(\frac{\ce{[HCO3-]}}{\ce{[H2CO3]}} \right)$$

BUT in the solution they make $$\mathrm{pH} =\mathrm{p}K_\mathrm{a} - \log \dfrac{[\ce{HCO3-}]}{[\ce{H2CO3}]}$$

They make the inverse of $$\mathrm{pH} = \mathrm{p}K_\mathrm{a} + \log \dfrac{[\ce{H2CO3}]}{[\ce{HCO3-}]}$$

And this don't make sense for me. I don't understand. 

The solution given is in the white box on the left side.
Recall the fundamental properties of the logarithm 
$$+\log \left(\frac{a}{b}\right)$$

is the same as

$$-\log \left(\frac{b}{a}\right)$$

so Henderson Hasselbach can have plus or minus signs. The correct equation is

$$\mathrm{pH} = \mathrm{p}K_\mathrm{a} + \log \left(\frac{\text{conjugate base}}{\text{acid}}\right)$$

or 

$$\mathrm{pH}  = \mathrm{p}K_\mathrm{a} - \log \left(\frac{\text{acid}}{\text{conjugate base}}\right)$$

Now sort out whether the textbook solution is right or not.