A non-Hookian spring has force $F = -kx^2$ where $k$ is the spring constant and $x$ is the displacement from its unstretched position. For the system shown of a mass $m$ connected to an unstretched spring initially at rest, how far does the spring extend before the system momentarily comes to rest? Assume that all surfaces are frictionless and that the pulley is frictionless as well.

[asy]
size(250);
pen dps = linewidth(0.7) + fontsize(10); defaultpen(dps);
draw((0,0)--(0,-1)--(2,-1)--(2+sqrt(3),-2));
draw((2.5,-2)--(4.5,-2),dashed);
draw(circle((2.2,-0.8),0.2));
draw((2.2,-0.8)--(1.8,-1.2));
draw((0,-0.6)--(0.6,-0.6)--(0.75,-0.4)--(0.9,-0.8)--(1.05,-0.4)--(1.2,-0.8)--(1.35,-0.4)--(1.5,-0.8)--(1.65,-0.4)--(1.8,-0.8)--(1.95,-0.6)--(2.2,-0.6));
draw((2+0.3*sqrt(3),-1.3)--(2+0.3*sqrt(3)+0.6/2,-1.3+sqrt(3)*0.6/2)--(2+0.3*sqrt(3)+0.6/2+0.2*sqrt(3),-1.3+sqrt(3)*0.6/2-0.2)--(2+0.3*sqrt(3)+0.2*sqrt(3),-1.3-0.2)); //super complex Asymptote code gg
draw((2+0.3*sqrt(3)+0.3/2,-1.3+sqrt(3)*0.3/2)--(2.35,-0.6677));
draw(anglemark((2,-1),(2+sqrt(3),-2),(2.5,-2)));
label("$30^\circ$",(3.5,-2),NW);
[/asy]

$ \textbf{(A)}\ \left(\frac{3mg}{2k}\right)^{1/2} $

$ \textbf{(B)}\ \left(\frac{mg}{k}\right)^{1/2} $

$ \textbf{(C)}\ \left(\frac{2mg}{k}\right)^{1/2} $

$ \textbf{(D)}\ \left(\frac{\sqrt{3}mg}{k}\right)^{1/3} $

$ \textbf{(E)}\ \left(\frac{3\sqrt{3}mg}{2k}\right)^{1/3} $
1. **Identify the forces and energy in the system:**
   - The force exerted by the spring is given by \( F = -kx^2 \).
   - The potential energy stored in the spring when it is stretched by a distance \( x \) is \( U = \int F \, dx = \int -kx^2 \, dx = -\frac{kx^3}{3} \).

2. **Set up the energy conservation equation:**
   - Initially, the system is at rest, so the initial kinetic energy is zero.
   - When the mass \( m \) is displaced by a distance \( x \), the gravitational potential energy change is \( mgx \sin(30^\circ) \).
   - The energy conservation equation is:
     \[
     \frac{kx^3}{3} = mgx \sin(30^\circ)
     \]

3. **Simplify the equation:**
   - Since \(\sin(30^\circ) = \frac{1}{2}\), the equation becomes:
     \[
     \frac{kx^3}{3} = mgx \cdot \frac{1}{2}
     \]
   - Simplify further:
     \[
     \frac{kx^3}{3} = \frac{mgx}{2}
     \]

4. **Solve for \( x \):**
   - Divide both sides by \( x \) (assuming \( x \neq 0 \)):
     \[
     \frac{kx^2}{3} = \frac{mg}{2}
     \]
   - Multiply both sides by 3:
     \[
     kx^2 = \frac{3mg}{2}
     \]
   - Divide both sides by \( k \):
     \[
     x^2 = \frac{3mg}{2k}
     \]
   - Take the square root of both sides:
     \[
     x = \sqrt{\frac{3mg}{2k}}
     \]

The final answer is \(\boxed{\left( \frac{3mg}{2k} \right)^{1/2}}\)