$L=\{a^ib^ja^k \mid j \text{ is odd, then } k=i^2+j ;\ j \text{ is even, then } k =i+j\}$
I tried writing $L$ as the union of the language created with $j$ odd and the one with $j$ even.
When $j$ is odd, I can prove using the pumping lemma that it is not a cfl.
When $j$ is even, I can prove that it is a cfl by writing a context-free grammar for it.
But then the union of a cfl and a non-cfl doesn't really help me prove $L$ is a cfl or not.
How do I proceed?