Step 1: Calculate the initial pH of the weak acid solution.
A weak acid \( HA \) has a dissociation constant \( K_a = 5 \times 10^{-4} \) and an initial concentration of \( 0.2 \, \text{M} \). The ionization of the weak acid in water is represented as:
\[
HA \rightleftharpoons H^+ + A^-
\]
The equilibrium expression for the dissociation constant is:
\[
K_a = \frac{[H^+][A^-]}{[HA]}
\]
Let the concentration of \( H^+ \) formed at equilibrium be \( x \). Then:
\[
K_a = \frac{x^2}{0.2 - x}
\]
Since the value of \( K_a \) is relatively small, we assume \( x \ll 0.2 \), so:
\[
0.2 - x \approx 0.2
\]
Thus, the equation simplifies to:
\[
K_a = \frac{x^2}{0.2}
\]
Substituting the value of \( K_a \):
\[
5 \times 10^{-4} = \frac{x^2}{0.2}
\]
\[
x^2 = 1 \times 10^{-4}
\]
\[
x = 1 \times 10^{-2} \, \text{M}
\]
Therefore, the hydrogen ion concentration is \( 10^{-2} \, \text{M} \), and the initial pH is:
\[
\text{pH} = -\log [H^+] = -\log (10^{-2}) = 2
\]
Step 2: Determine the pH after partial neutralization with NaOH.
When sodium hydroxide (NaOH) is added, it reacts with the weak acid according to:
\[
HA + OH^- \rightarrow A^- + H_2O
\]
First, calculate the initial moles of the acid:
\[
\text{Moles of } HA = 0.2 \times 0.02 = 4 \times 10^{-3} \, \text{mol}
\]
Next, calculate the moles of NaOH added:
\[
\text{Moles of NaOH} = 0.2 \times 0.01 = 2 \times 10^{-3} \, \text{mol}
\]
After neutralization:
\[
\text{Remaining moles of } HA = 4 \times 10^{-3} - 2 \times 10^{-3}
= 2 \times 10^{-3} \, \text{mol}
\]
\[
\text{Moles of } A^- \text{ formed} = 2 \times 10^{-3} \, \text{mol}
\]
The total volume of the solution becomes:
\[
20 \, \text{mL} + 10 \, \text{mL} = 30 \, \text{mL}
= 0.03 \, \text{L}
\]
Since both \( HA \) and \( A^- \) are present in equal amounts, the solution forms a buffer. Therefore, we use the Henderson–Hasselbalch equation:
\[
\text{pH} = \text{p}K_a + \log \frac{[A^-]}{[HA]}
\]
Here,
\[
\text{p}K_a = -\log (5 \times 10^{-4}) \approx 3.3
\]
\[
\frac{[A^-]}{[HA]} = 1
\]
Thus,
\[
\text{pH} = 3.3 + \log (1)
\]
\[
\text{pH} = 3.3
\]
Step 3: Conclusion.
The weak acid initially has a low pH due to partial ionization. After adding NaOH, a buffer solution is formed with equal concentrations of acid and its conjugate base, resulting in a higher pH.
Final Answer: Initial pH \( = 2 \), Final pH \( = 3.3 \).