Proving a language with $(ab)^n$ is not regular with pumping lemma?
Let's suppose, for concreteness, that $p = 3$.
You choose the word $z = (ab)^3a^k(ba)^3$. How does this word look like? It is impossible to tell, since we don't know what the value of $k$ is. Let's therefore take $k = 3$, that is, we are looking at the word $z = (ab)^3(ba)^3 = abababbababa$.
Next, we are given a decomposition $abababbababa = uvw$, where $|uv| \leq 3$ and $v \neq \epsilon$. There are six possibilities:

$u = \epsilon$, $v = a$, $w = bababbababa$.
$u = \epsilon$, $v = ab$, $w = ababbababa$.
$u = \epsilon$, $v = aba$, $w = babbababa$.
$u = a$, $v = b$, $w = ababbababa$.
$u = a$, $v = ba$, $w = babbababa$.
$u = ab$, $v = a$, $w = babbababa$.

You need to be able to handle all of them. There are four different cases: $v \in (ab)^*$, $v \in (ba)^*$, $v \in a(ba)^*$, $v \in b(ab)^*$. For each of them, you need to find a value of $i$ so that $uv^iw \notin L_2$. When showing that $uv^iw \notin L_2$, you have to show that there are no $n \geq 0$ and $k &lt; 3$ such that $uv^iw = (ab)^n a^k (ba)^n$.