$y=w^tx$ (1)

$J(w)=\frac{m_y}{S_y}$ (2)

$m_y=m^{*}_1-m^{*}_2$ (3)

$S_y=S^{*}_1-S^{*}_2$ (4)

$J(w)=\frac{w^{t}m_xw}{w^{t}S_xw}$ (5)

$J(w)=2w^{t}m_x-2\lambda{w^t}S_x$