An analytic determination of the (A, B)-invariant and controllability subspaces