Step 1: Set up the start.
Take 1 mole of HI to begin with. The reaction is $2HI \rightleftharpoons H_2 + I_2$. Let $\alpha$ be the fraction of HI that breaks up.
Step 2: Find moles at equilibrium.
HI left is $1 - \alpha$. Since 2 HI give 1 $H_2$ and 1 $I_2$, the $H_2$ formed is $\alpha/2$ and the $I_2$ formed is $\alpha/2$.
Step 3: Find total moles.
Add them up: $(1 - \alpha) + \frac{\alpha}{2} + \frac{\alpha}{2} = 1$. The total stays 1, which makes the maths simple.
Step 4: Write the partial pressures.
Since total moles is 1, each partial pressure is just the mole fraction times total pressure $P$. So $p_{HI} = (1-\alpha)P$, $p_{H_2} = \frac{\alpha}{2}P$ and $p_{I_2} = \frac{\alpha}{2}P$.
Step 5: Build $K_p$.
Put these into the equilibrium expression. \[ K_p = \frac{p_{H_2}\,p_{I_2}}{(p_{HI})^2} = \frac{\left(\frac{\alpha}{2}P\right)\left(\frac{\alpha}{2}P\right)}{(1-\alpha)^2 P^2} = \frac{\alpha^2}{4(1-\alpha)^2} \] The pressure $P$ cancels out.
Step 6: Solve for $\alpha$.
Take the square root: $\sqrt{K_p} = \dfrac{\alpha}{2(1-\alpha)}$. Cross multiply and gather $\alpha$ terms to get \[ \boxed{\alpha = \frac{2\sqrt{K_p}}{1 + 2\sqrt{K_p}}} \]