Answer
a. $$2HCl(aq) + Mg(OH)_2(aq) \longrightarrow 2H_2O(l) + MgCl_2(aq)$$
b. $$H_3PO_4(aq) + 3LiOH(aq) \longrightarrow 3H_2O(l) + Li_3PO_4(aq)$$
Work Step by Step
1. Balance the $H^+$ in the acid with the $OH^-$ in the base.
a. $Mg(OH)_2$ provides 2 $OH^-$, so we have to put a coefficient of 2 in front of the $HCl$, since it only provides 1 $H^+$
$$2HCl(aq) + Mg(OH)_2(aq) \longrightarrow H_2O(l) + MgCl_2(aq)$$
b. $H_3PO_4$ provides 3 $H^+$, so we have to put a coefficient of 3 in front of the $LiOH$, since it only provides 1 $OH^-$
$$H_3PO_4(aq) + 3LiOH(aq) \longrightarrow H_2O(l) + Li_3PO_4(aq)$$
2. Balance the $H_2O$ with the $H^+$ and $OH^-$.
a. The reaction uses 2 $H^+$ and 2 $OH^-$. Thus, there should be 2 $H_2O$ in the products.
$$2HCl(aq) + Mg(OH)_2(aq) \longrightarrow 2H_2O(l) + MgCl_2(aq)$$
b. The reaction uses 3 $H^+$ and 3 $OH^-$. Thus, there should be 3 $H_2O$ in the products.
$$H_3PO_4(aq) + 3LiOH(aq) \longrightarrow 3H_2O(l) + Li_3PO_4(aq)$$