I'm looking at the solution someone gave to me and I'm having a bit of trouble following one of the steps. This step in particular,
$\frac{1}{k}\frac{1}{v^2-\frac{mg}{k}}=\frac{1}{2k\sqrt{mg/k}}(\frac{1}{v-\sqrt{mg/k}}- \frac{1}{v+\sqrt{mg/k}})$. All letters are constants except for $v$. Any help is appreciated.
Note that $$v^2 - \frac{mg}{k} = (v-\sqrt{mg/k})(v+\sqrt{mg/k})$$ So we can use partial fraction decomposition, which will result in the formula you posted.
$$\frac{1}{k}\frac{1}{v^2-\frac{mg}{k}}=\frac{1}{k}\left(\frac{A}{v-\sqrt{mg/k}}+ \frac{B}{v+\sqrt{mg/k}}\right)$$
If you solve for $A, B$ as one does in partial fraction decomposition, you'll find that $$A =\frac 1{2\sqrt{(mg)/k}},\;B = -A$$
This gives us, as desired,
$$\frac{1}{k}\frac{1}{v^2-\frac{mg}{k}}=\frac{1}{2k\sqrt{\frac{mg}{k}}}\left(\frac{1}{v-\sqrt{\frac{mg}{k}}}-\frac{1}{v+\sqrt{\frac{mg}{k}}}\right)$$