How to represent the "power of" symbol in context free grammar? I have to find the CFG for the following langage 
$$L={w|w=a^ib^ja^{i+j},i,j∈N}$$
Her is my solution but I am not completely sure about it :
\begin{align*}
K &-> ε\\
K &-> bK\\
S &-> ε\\
S &-> aS\\
S &-> aSbKa\\
\end{align*}
I don't know how to manage the power of, can someone explain please ?
 A: Your rules don't seem to work as they should, you are not counting in the end. For example from $S$ I could construct the word $a$, which is not of the form $a^ib^ja^{i+j}$ (you would need $i = 1, j = 0$, but then the word would be $aa$). 
By the way, $a^i$ stands for $aaaaaa\ldots$ repeated $i$ times, that is why I said we are counting in this language.
So now let's see how to construct the language $\{a^ib^ja^{i+j} \mid i,j \in \mathbb{N}\}$:
Whenever you have an $a$ or a $b$ in the beginning, you also need one in the end. To make sure that something like the above example does not happen, you would need a rule of the form
$$S \to aSa.$$
This makes sure that whenever you have an $a$ in the beginning, you also have one in the end.
Now we $\textbf{could}$ do the same for $b$, adding a rule $S \to bSa$. Then the counting would be correct, but the order (first $a$, then $b$, then $a$) would not, we could construct something like $baaa$. Thus we need a second non determinate, like your $K$, to take care of the $b$. 
I think you can take it from here. :)
