# How do I calculate how much sodium hydroxide I need to add to get a new pH?

A 100 ml $\ce{HCl}$ solution has a pH of $3.7$. You want the solution to be of pH 4.5. You have a solution of $10\ \mathrm M$ $\ce{NaOH}$. How much $\ce{NaOH}$ do you need to add to to the $100\ \mathrm{ml}$ solution of $\ce{HCl}$ to get a pH of 4.5?

I firstly calculated the concentration $\ce{HCl}$ in $100\ \mathrm{ml}$ solution = $10^{-3.7}$ = $2.0\times10^{-5}\ \mathrm{mol}$ $\ce{HCl}$ per $100\ \mathrm{ml}$. After this I calculated the $\left[\ce{HCl}\right]$ of the new solution: $10^{-4.5}=3.16\times10^{-6}\ \mathrm{mol}$ $\ce{HCl}$ per $100\ \mathrm{ml}$ of new solution. Now I'm stuck.

At the beginning, the amount of substance of hydronium ions is: $$n(\ce{H3O+})=10^{-3.7} \times 100 \times10^{-3}=10^{-4.7} \mathrm {mol}$$ After adding sodium hydroxide, the amount of substance of hydronium ions is: $$n(\ce{H3O+})=10^{-4.5} \times 100 \times10^{-3}=10^{-5.5} \mathrm {mol}$$
The difference represents the amount of substance of hydronium ions that have reacted with hydroxide ions. $$n(\ce{H3O+})=10^{-4.7}-10^{-5.5}= n(\ce{OH-})$$ The volume of sodium hydroxide to add is: $$v(\ce{OH-})=\frac {10^{-4.7}-10^{-5.5}}{10}= 1.68\times10^{-6}\mathrm{L}=1.68\,\mu \mathrm{L}$$
$$\pu{pH}_{(\text{before adding}~\ce{NaOH})} =-\log[\ce{H3O+}]_{(\text{before adding}~\ce{NaOH})}=3.7$$ $$[\ce{H3O+}]_{(\text{before adding}~\ce{NaOH})} =\pu{1\times{10^{-3.7}}~M}= [\ce{HCl}]_\text{(initial)}$$ $$\pu{pH}_{(\text{after adding}~\ce{NaOH})} =-\log[\ce{H3O+}]_{(\text{after adding}~\ce{NaOH})}=4.5$$ $$[\ce{H3O+}]_{(\text{after adding}~\ce{NaOH})} =\pu{1\times{10^{-4.5}}~M}$$ $$\mathrm{V}_\ce{(HCl)} = \pu{100ml}=\pu{0.1L}$$ $$\color{red}{ [\ce{H3O+}]_{(\text{after adding}~\ce{NaOH})} =\frac{\mathrm{V}_\ce{(HCl)}\times[\ce{HCl}]_\text{(initial)}-\mathrm{V}_\ce{(NaOH)_\text{added}}\times[\ce{NaOH}]}{\mathrm{V}_\ce{(HCl)}+\mathrm{V}_\ce{(NaOH)_\text{added}}}}$$ $$1\times{10^{-4.5}} =\frac{0.1\times{10^{-3.7}}-\mathrm{V}_\ce{(NaOH)_\text{added}}\times{10}}{0.1+\mathrm{V}_\ce{(NaOH)_\text{added}}}$$ $$\mathrm{V}_\ce{(NaOH)_\text{added}}=\pu{1.679\times{10^{-6}}~L}$$