Is $L = \{a^jb^ia^{j-i}\mid i,j \ge 0\ , j > i\}$ context-free? I'm exercising for an upcoming exam and I find this exercise:


  Say whether or not the language 
  $$L = \{a^jb^ia^{j-i}\mid i,j \ge 0\ , j &gt; i\}$$
  is a context-free language. Justify your answer.


I have already tried (using the pumping lemma for CFL) with two different words:
$$w1 = \  a^pb^{p-1}a$$
$$w2 = \  a^{2p}b^pa^p$$

but I'm stuck when the case is that $vwx$ (considering $uvwxy = w$) take letters from both the first group of $\bf{a}$ and the group of $\bf{b}$.
Have I chosen a wrong format for the word or am I simple missing some trivial condition?
You are trying the wrong way. It is context-free.

(added.) The structure of the language (to guide the grammar construction) is better seen by setting $k = j-i$, so $j=k+i$. Then the language becomes $\{ a^ka^ib^ia^k \mid i\ge 0, k&gt;0 \}$.