You are asking about substitution of one power series into another. This can be interpreted in two ways, which ultimately amount to the same thing (like two different ways of thinking about *anything*) but one method is elementary and rather clunky while the other takes longer to set up but ultimately is more slick and better for actually proving properties in a non-tedious way. **Method 1**: the combinatorial method (using finitely many terms at a time). If $f(x) = a_0 + a_1x + a_2x^2 + \cdots$ is an element of $A[[x]]$, where $A$ is a commutative ring, and $g(x) = b_1x + b_2x^2 + \cdots$ is another element of $A[[x]]$ with constant term $0$, then $f(g(x))$ makes sense as $$ a_0 + a_1g(x) + a_2g(x)^2 + \cdots $$ because $g(x)^n = b_1^nx^n + \cdots$ has no terms in degree below $n$, so to find the coefficient of $x^d$ in $f(g(x))$ you only need to work with the finite sum $a_0 + a_1g(x) + \cdots + a_{d-1}g(x)^{d-1}$ and extract the coefficient of $x^d$ in that sum. It "doesn't make sense" to compose $f(g(x))$ if $g(x) = b_0 + b_1x + b_2x^2 + \cdots$ has a nonzero constant term because the constant term of $f(g(x))$ would then be $f(g(0)) = f(b_0) = a_0 + a_1b_0 + a_2b_0^2 + \cdots$ and this is an infinite series that doesn't make *algebraic* sense unless $b_0$ is nilpotent or some other reason causes all but finitely many terms to be $0$. Example: if $f(x) \in \mathbf Z_p[[x]]$ then $f((1+x)^a - 1)$ makes sense since $(1+x)^a - 1 = \sum_{n \geq 1} \binom{a}{n}x^n$ is a power series with constant term $0$. I call this the combinatorial method because I have seen combinatorialists introduce formal power series in this way, which is purely algebraic and emphasizes the finitely many calculations needed to work out any particular coefficient. It seems like a clunky way of setting up formal power series if you want to prove properties of them beyond the simplest ones, but it has the advantage of being intuitive and getting to the point of things in a direct way. Now let's try something more in the $p$-adic spirit. **Method 2**: the $x$-adic topology. For a commutative ring $A$, define the $x$-adic absolute value on $A[[x]]$ by $|f(x)|_x = (1/2)^n$ when $f(x) = c_nx^n + \cdots$ is nonzero with its first nonzero term occurring in degree $n$, and $|0|_x = 0$. For example, all nonzero $a \in A$ have $|a|_x = 1$ when we view $a$ in $A[[x]]$ as a constant power series. For all $f$ and $g$ in $A[[x]]$, $|f+g|_x \leq \max(|f|_x,|g|_x)$ and $|fg|_x \leq |f|_x|g|_x$. If $A$ is an integral domain, such as $A = \mathbf Z_p$ or $\mathbf Q_p$, then $|fg|_x = |f|_x|g|_x$. From $|\cdot|_x$ we get a topology on $A[[x]]$ in which $x^n \to 0$ as $n \to \infty$, and $|f|_x < 1$ if and only if $f$ has constant term $0$. The $x$-adic distance between $f$ and $g$ is defined to be $|f-g|_x$, which is a non-Archimedean metric on $A[[x]]$ that makes it complete. Just as in the $p$-adic numbers, an sequence $\{f_n\}$ in $A[[x]]$ is $x$-adically convergent if and and only if $|f_{n+1} - f_n|_x \to 0$ as $n \to \infty$, so an infinite series of elements in $A[[x]]$ is $x$-adically convergent if and only if its general term tends to $0$. Now let's talk about the composition $f(g(x))$ for $f(x) \in A[[x]]$ and $g(x) \in A[[x]]$. What does it mean and when does it make sense? To take advantage of $x$-adic convergence, let's view $f(x)$ as a power series in a different indeterminate, say $f(y) \in R[[y]]$ where $R = A[[x]]$ is a non-Archimedean complete ring and $f(y)$ happens to have all "constant" coefficients (lying in $A$, not just in $R$). For example, if $f(x) = 1 + x + x^2 + x^3 + \cdots$ then we view it as $1 + y + y^2 + y^3 + \cdots$ in $R[[y]]$ whose coefficients are all $1 \in A$. Asking about the meaning of $f(g(x))$ is asking about where a power series in $R[[y]]$ converges on $R$. Just like a $p$-adic power series in $\mathbf Z_p[[y]]$ has a $p$-adic disc of convergence, a power series $f(y)$ in $R[[y]]$ has a disc of convergence in $R$: if $f(y) = \sum_{n \geq 0} c_ny^n$, then $f(r)$ converges if and only if $|c_nr^n|_x \to 0$ as $n \to \infty$. Since $|c_nr^n|_x \leq |c_n|_x|r|_x^n \leq |r|_x^n$, $f(r)$ converges *if* $|r|_x < 1$. Since $r^n - s^n$ is divisible by $r-s$ for all $n \geq 0$, $|f(r) - f(s)|_x \leq |r-s|_x$ when $f(r)$ and $f(s)$ converge, so the power series $f(y)$ is $x$-adically uniformly continuous on its disc of convergence. Writing $r \in R = A[[x]]$ as $g(x)$, saying $|r|_x < 1$ means $g(x)$ has constant term $0$. This shows $f(g(x))$ converges $x$-adically in $A[[x]]$ when $g(x)$ has constant term $0$. It's left to you to check, using the $x$-adic uniform continuity estimate $|f(g(x)) - f(h(x))|_x \leq |g(x) - h(x)|_x$ when $g(x)$ and $h(x)$ have constant term $0$, that the calculation of the coefficients of $f(g(x))$ as an $x$-adic limit (finding each of its coefficients as an element of $A[[x]]$) can be done by the combinatorial method ("finitely many terms at a time") because $g(x) \equiv g_d(x) \bmod x^d$ where $g_d(x)$ is the truncation of $g(x)$ to the sum of its first $d$ terms (those below degree $d$). Example: if $f(y) \in \mathbf Z_p[[y]] \subset (\mathbf Z_p[[x]])[[y]]$ then $f((1+x)^a - 1)$ makes sense in $\mathbf Z_p[[x]]$ since $|(1+x)^a - 1|_x < 1$, and that's because $(1+x)^a - 1 = \sum_{n \geq 1} \binom{a}{n}x^n$ has constant term $0$. If $A$ is an integral domain (like $\mathbf Z_p$ or $\mathbf Q_p$) and $f(y) = \sum_{n \geq 0} c_ny^n$ is a genuine power series in $A[[y]]$ -- it has infinitely many nonzero coefficients in $A$ -- then $|c_nr^n|_x = |c_n|_x|r|_x^n = |r|_x^n$ infinitely often (whenever $c_n \not= 0$), and this tends to $0$ only if $|r|_x < 1$, so $f(r)$ converges *if and only if* $|r|_x < 1$. That means $f(g(x))$ converges $x$-adically in $A[[x]]$ if and only if $g(x) \in A[[x]]$ has constant term $0$. I am *not* saying $f(g(x))$ can never make sense in $A[[x]]$ if $f(x)$ is a genuine power series (not a polynomial) and $g(x)$ has a nonzero constant term, but only that it does not make $x$-adic sense (if $A$ is an integral domain). If $A = \mathbf Z_p$, so $A$ itself has a nontrivial notion of convergence, then you may be able to evaluate $f(g(x))$ when $g(x)$ has a nonzero constant term $b_0$ such that $f(b_0)$ converges in $A$. For example, if $f(y) = 1 + y + y^2 + y^3 + \cdots$ has all coefficients equal to $1$ then $f(p+x)$ makes sense in $\mathbf Z_p[[x]]$ but *not* with the $x$-adic topology since $|p+x|_x = 1$. You'd have to use something like the $(p,x)$-adic topology instead, where elements of $\mathbf Z_p[[x]]$ are small not just if they start off with a large power of $x$, but if they are in a high power of the ideal $(p,x)$, meaning below some high power of $x$ the coefficients are very divisible by $p$.