Given two cyclic codes $C_1$ and $C_2$ of length $n$ with generator polynomials $g_1(X)$ and $g_2(X)$ respectively, I have to find the generator polynomial of $C_1+C_2$, which I already know that is a cyclic code.
I've thought of $g(X)=\gcd(g_1(X),g_2(X))$ as an answer due to the fact that $C_i\subset C_1+C_2$, and therefore the answer should generate both codes. It's obvious that any element of $C_1+C_2$ is spanned by linear combinations of $X^ig(X)$, but I need to show that this does not generate anything else.
My idea is to build the basis $\{g(X), Xg(X),\dots, X^{n-r-1}g(X)\}$ where $r=\deg(g(X))$ and show that it is indeed a basis. Would it be the right way?
Every codeword in $C_1+C_2$ can be expressed as $a_1(x)g_1(x) + a_2(x)g_2(x)$. Now think of Bezout's theorem. What is the polynomial of least degree that can be expressed in this form?