Assuming linear momentum is conserved in an elastic collision between 2 objects ($\Delta K= 0$) the initial equations one can set up are:
$m_{1}v_{1i} + m_{2}v_{2i} = m_{1}v_{1f} + m_{2}v_{2f} $
$\frac 12m_{1}v_{1i}^2 + \frac 12m_{2}v_{2i}^2 =\frac 12m_{1}v_{1f}^2 + \frac 12m_{2}v_{2f}^2$
The first can be rewritten to $m_{1}(v_{1i} - v_{1f}) = -m_{2}(v_{2i} - v_{2f})$
And the second as $m_{1}(v_{1i} - v_{1f})(v_{1i} + v_{1f}) = -m_{2}(v_{2i} - v_{2f})(v_{2i} + v_{2f})$
When I divide these equations I get $v_{1i} + v_{1f} = v_{2i} + v_{2f}. $
Yet my textbook lists the equation for the final velocities as
$v_{1f} = \frac {m_{1}-m_{2}} {m_{1}+m_{2}}v_{1i} + \frac {2m_{2}}{m_{1}+m_{2}}v_{2i} $
$v_{2f} = \frac {2m_{1}}{m_{1}+m_{2}}v_{1i} + \frac {m_{2}-m_{1}} {m_{1}+m_{2}}v_{2i} $
How in the world are these equations derived?