solve equation by LU decomposition