Why is a titration necessary? Why can't we just compare the moles of the acid and base? For the following question:

$\mathrm{1g}$ of $\ce{Mg(OH)2}$  is completely dissolved in $\mathrm{25}$ mL of $\mathrm{0.5}$ M $\ce{HCl}$. This solution is then titrated with $\mathrm{0.1}$ M $\ce{NaOH}$, and it takes $\mathrm{40}$ mL of $\ce{NaOH}$ to reach the end point. What volume of $\mathrm{0.5}$ M $\ce{H2SO4}$ would neutralise 1g of $\ce{Mg(OH)2}$ ?

This is solved by the following steps:


moles=concentration*volume=$\mathrm{0.5}$ M * $\mathrm{25 mL}$ $\ce{HCl}$=$\mathrm{12.5}$ mmol $\ce{HCl}$ which is equivalent to $\mathrm{12.5}$ mmol  $\ce{H+}$.
moles=concentration*volume=$\mathrm{0.1}$ M * $\mathrm{40 mL}$ $\ce{NaOH}$=$\mathrm{4}$ mmol $\ce{HCl}$ which is equivalent to $\mathrm{4}$ mmol  $\ce{OH-}$.
Difference = $\mathrm{12.5-4=8.5 }$ mmol of $\ce{H+}$. That is, $\mathrm{8.5}$ mmol of $\ce{H+}$ was used in the reaction with the $\ce{Mg(OH)2}$.
Finding out how much $\mathrm{0.5}$ M $\ce{H2SO4}$ is required to give $\mathrm{8.5}$ mmol of $\ce{H+}$ :  $\mathrm{1}$ mole of $\ce{H2SO4}$ gives $\mathrm{2}$ mole of $\ce{H+}$, so we need $\mathrm{8.5/2=4.25}$ moles of $\ce{H2SO4}$. Concentration=moles/volume. Volume = moles/concentration=$\mathrm{4.25}$ mmol/$\mathrm{0.5}$ M=8.5 ml $\ce{H2SO4}$ required.




Why are all these steps necessary? Can't we directly compare the number of moles of $\ce{Mg(OH)2}$ and $\ce{H2SO4}$? I.e. as follows:


Molar mass of $\ce{Mg(OH)2}$=$\mathrm{24.3+16*2=56.3}$
moles=mass/molar mass=1g of $\ce{Mg(OH)2}$/$\mathrm{56.3}$=$\mathrm{0.018}$ moles of $\ce{Mg(OH)2}$, which is equivalent to $\mathrm{0.018*2=0.036}$ or $\mathrm{36}$ mmol of $\ce{OH-}$. 
So we need $\mathrm{36}$ mmol of $\ce{H+}$ to neutralise $\mathrm{36}$ mmol of $\ce{OH-}$. $\mathrm{1}$ mol of $\ce{H2SO4}$ contains  $\mathrm{2}$ mol of $\ce{H+}$. So we need $\mathrm{36/2=18}$ mmol of $\ce{H2SO4}$.  
Concentration = moles/volume = $\mathrm{0.5}$ M = $\mathrm{18}$ mmol/Volume. So Volume = $\mathrm{18/0.5=36}$ mL of  $\ce{H2SO4}$.




My second attempt yields the wrong answer. So why can't the problem be solved by comparing the number of moles of hydrogen ions and hydroxide ions? Why is the titration with other molecules required to solve this problem?



Note: I have attempted to summarise the question here. But if you prefer to read it in its original form:
Man! you must have got impure sample of Mg(OH)2
Moreover, Mg(OH)2 being sparingly soluble may not be finding a way for direct titration, so the method suggested in the problem is a process we call as BACK-TITRATION. This you have to follow i all such situations, where direct titration might not, for any of the reasons, be possible.

Because all 1 g Mg(OH)2 is not pure, you can expect incorrect answer if you are directly comparing the moles of H+ &amp; OH- ions.

Would this be fine?