  For any unitary representation $(\pi,\mathcal{H})$ of $G=SL(n,\RR)$, $n\geq
3$ without non-trivial $G$-invariant vectors, we study smooth solutions of the
cohomological equation $\mathfrak{u}f=g$ where $\mathfrak{u}$ is a vector in
the root space of $\mathfrak{sl}(n,\RR)$ and $g$ is a given vector in
$\mathcal{H}$. We characterize the obstructions to solving the cohomological
equation, construct smooth solutions of the cohomological equation and obtain
tame Sobolev estimates for $f$.
  We also study common solutions to (the infinitesimal version of) the cocycle
equation $\mathfrak{u}h=\mathfrak{v}g$, where $\mathfrak{u}$ and $\mathfrak{v}$
are commutative vectors in different root spaces of $\mathfrak{sl}(n,\RR)$ and
$g$ and $h$ are given vectors in $\mathcal{H}$. We give precisely the condition
under which the cocycle equation has common solutions: $(*)$ if $\mathfrak{u}$
and $\mathfrak{v}$ embed in $\mathfrak{sl}(2,\RR)\times \RR$, then the common
solution exists. Otherwise, we show counter examples in each $SL(n,\RR)$,
$n\geq 3$. As an application, we obtain smooth cocycle rigidity for higher rank
parabolic actions over $SL(n,\RR)/\Gamma$, $n\geq 4$ if the Lie algebra of the
acting parabolic subgroup contains a pair $\mathfrak{u}$ and $\mathfrak{v}$
satisfying property $(*)$ and prove that the cocycle rigidity fails otherwise.
Especially, the cocycle rigidity always fails for $SL(3,\RR)$.
  The main new ingredient in the proof is making use of unitary duals of
various subgroup in $SL(n,\RR)$ isomorphic to $SL(2,\RR)\ltimes\RR^2$ or
$(SL(2,\RR)\ltimes\RR^2)\ltimes\RR^3$ obtained by Mackey theory.
