Rewriting $1/(v^2-(mg/k))$ as two fractions 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.
 A: $$\frac{1}{k}\frac{1}{v^2-\frac{mg}{k}}=\frac{1}{k}\frac{1}{v+\sqrt\frac{mg}{k}}\frac{1}{v-\sqrt\frac{mg}{k}}=$$
$$\ =\frac{1}{k}(\frac{A}{v+\sqrt\frac{mg}{k}}+\frac{B}{v-\sqrt\frac{mg}{k}})$$
$$\text{now you bring every term in the brackets under a common denominator}$$
$$\text{so you get:}\begin{cases}
A+B=0\\
-A+B= \sqrt\frac{k}{mg}
\end{cases} \iff \begin{cases}
A=-\frac{1}{2\sqrt\frac{mg}{k}}\\
B= \frac{1}{2\sqrt\frac{mg}{k}}
\end{cases} $$
A: consider the right hand side we know that in general
$$\frac1a-\frac1b = \frac{b-a}{ab}$$
here $$a=v-\sqrt{mg/k} , b=v+\sqrt{mg/k}$$
therefore $$b-a = 2\sqrt{mg/k}$$
and since $$x^2-y^2=(x+y)(x-y)$$
therefore $$a*b = v^2-\frac{mg}k$$
and again $$\frac{b-a}{ab}=\frac{2\sqrt{mg/k}}{v^2-\frac{mg}k}$$
This value multiplied by $$\frac1{2k\sqrt{\frac{mg}k}}$$
provides you the left hand side.
A: 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)$$
