When two formal power series commutes ?
Algorithm:
Let $f = \sum a_n x^n$ and $g = \sum b_n x^n$ be two formal series without constant term. Then $$ f \circ g = \sum a_n g(x)^n = \sum a_n \left(\sum b_k x^k \right)^n $$ Now, since $$ \left(\sum b_k x^k \right)^n = \sum_{i_1 + \dotsm + i_k = n} b_{i_1} \dotsm b_{i_k} x^n $$ one gets $$ f \circ g = \sum a_n \left(\sum_{i_1 + \dotsm + i_k = n} b_{i_1} \dotsm b_{i_k}\right)x^n $$ Therefore $f$ and $g$ commute in the sense of composition of functions if and only if, for all $n$, $$ a_n \left(\sum_{i_1 + \dotsm + i_k = n} b_{i_1} \dotsm b_{i_k}\right) = b_n \left(\sum_{i_1 + \dotsm + i_k = n} a_{i_1} \dotsm a_{i_k}\right) $$ This is the general criteria of commuting two formal power series.
My question is about computer programming. That is, suppose we are given a formal power series $f_1(x)$ without constant term, knowing its first $10$ terms or first $10$ coefficients of any finite number of coefficients. Is it possible to write a computer programming like $PARI/GP$ $C++$, Matlab etc. using above algorithm in order to get a formal power series $f_2(x)$ without constant term such that $f_1 \circ f_2=f_2 \circ f_1$ ? At least, can we get the first $10$ terms of coefficients of $f_2(x)$?
Actually I need some example of formal power series which commute each other in the sense of composition of functions.
You are aware that your formal series must start at $n=1$ for the composition to be well-defined ? If $f \in xk^*+x^2 k[[x]]$ then why not take $ g=f^{-1}$ ? Please clarify.