Consider a sparingly soluble salt $M_{x}X_{y}$ with solubility $S \ mol \ L^{-1}$.
The dissociation equilibrium is given by:
$M_{x}X_{y(s)} \rightleftharpoons x M_{(aq)}^{y+} + y X_{(aq)}^{x-}$
At equilibrium,the concentrations of the ions are:
$[M^{y+}] = xS$
$[X^{x-}] = yS$
The solubility product constant $(K_{sp})$ is defined as:
$K_{sp} = [M^{y+}]^{x} [X^{x-}]^{y}$
Substituting the values of concentrations in terms of $S$:
$K_{sp} = (xS)^{x} (yS)^{y}$
$K_{sp} = x^{x} \cdot y^{y} \cdot S^{(x+y)}$
Rearranging to solve for $S$:
$S^{(x+y)} = \frac{K_{sp}}{x^{x} \cdot y^{y}}$
$S = \left( \frac{K_{sp}}{x^{x} \cdot y^{y}} \right)^{\frac{1}{x+y}}$