Consider the polynomial $f(x)=x^3+3x$ over $\mathbb{Z}$.
I am trying to find a polynomial $g(x)$ $(\neq f^{\circ n})$ of any degree (or series) without constant term which commutes with $f$ (or any iteration $f^{\circ n}, ~n \geq 1)$ under composition.
Trivially, any $g(x)=x$, is another polynomial (or series) commutes with $f(x)$.
By hand it seems to be laborious.
Suppose I start with an investigation if there are degree $2$ polynomial $g(x)=ax+bx^2$ such that $f \circ g=g\circ f$. Then \begin{align} &f(g(x))=f(ax+bx^2)=3(ax+bx^2)+(ax+bx^2)^3=3ax+3bx^2+a^3x^3+3a^2bx^4+3ab^2x^5+b^3x^6, \\ &g(f(x))=g(x^3+3x)=a(x^3+3x)+b(x^3+3x)^2=3ax+ax^3+bx^6+6bx^4+9bx^2 \end{align}
Comparing both equations, we get $b=0$ and $a=a^3 \Rightarrow a=\pm 1$. In this case $g(x)=\pm 1$, the trivial one.
Suppose I start with an investigation if there are degree $3$ polynomial $g(x)=ax+bx^2+cx^3$ such that $f \circ g=g\circ f$. Then \begin{align} &f(g(x))=f(ax+bx^2+cx^3)=3(ax+bx^2+cx^3)+(ax+bx^2+cx^3)^3=3ax+3bx^2+3cx^3+c^3x^9+3bc^2x^8 \hspace{3cm}+(3ac^2+3b^2c)x^7+(6abc + b^3)x^6 + (3a^2c + 3ab^2)x^5 + 3a^2bx^4 + a^3x^3, \\ &g(f(x))=g(x^3+3x)=a(x^3+3x)+b(x^3+3x)^2+c(x^3+3x)^3=3ax+ax^3+2bx^6+6bx^4+9bx^2+cx^9+9cx^7+27cx^5+27cx^3 \end{align} Comparing both sides we get $b=0$ and the following equations: \begin{align} a^3-a=24c, \\ a^2c=9c, \\ 3ac^2=9c,\\ c^3=c. \end{align} Solving these, we see $c^3=c$ and $3ac^2=a^2c$. These two gives us $c=0$ or $c=\pm 1$. If $c \neq 0$, then $a=\pm 3$. Thus $g(x)=\pm (3x+ x^3)$, which is equivalent to $f(x)$ upto signs.
Suppose I start with an investigation if there are degree $4$ polynomial $g(x)=ax+bx^2+cx^3+dx^4$ such that $f \circ g=g\circ f$. Then it becomes laborious.
Is there any way to find non-trivial $g$ with the help of PARI/GP or SAGE ?
Edit 1: According to the hints given by @achille hui, I have found that $g(x)=-5x-5x^3-x^5$ commutes with $x^3+3x$. However, I am looking for an polynomial whose first degree coefficient is $3$ or multiple of $3$. I would appreciate one such example.
Edit 2: But I need to find the polynomial with degree one coefficient, a multiple of $3$ and it is certainly possible as $f$ commutes with its iteration and each iteration has the degree one coefficient , a multiple of 3