Series expansion for $x$, when $x$ is small Suppose that we are given the series expansion of $y$ in terms of $x$, where $|x|\ll 1$. For example, consider $$y=x+x^2+x^3+\cdots\qquad\qquad\qquad (1).$$ From this I would like to derive the series expansion of $x$ in terms $y$. Given that $|x|\ll 1$ we can take $y=x+O(x^2)$ such that $x\sim y$. 
It then follows from $(1)$ that $$x=y-(x^{2}+x^{3}+\cdots)\qquad\qquad\qquad (2).$$ Given that $x\sim y$, $(2)$ becomes $$x=y-y^2-y^3+\cdots\qquad\qquad\qquad (3).$$
While the first two terms of $(3)$ are correct I suspect that the remaining terms are incorrect. 
For instance given that $y=x+O(x^2)$ implies that $y^2=x^2+2xO(x^{2})+(O(x^{2}))^{2}$. Therefore, $2xO(x^{2})$ will yield a $y^{3}$ term in $(3)$ when computing $x^{2}$ in $(2)$. 
How do I find the correct term containing $y^{3}$ in $(3)$, and so on.

If we assume that the series continues as $y=\sum\limits_{k=1}^\infty x^k$, we have
$$
y=\frac{x}{1-x}\tag{1}
$$
then we can compute
$$
x=\frac{y}{1+y}=\sum_{k=1}^\infty(-1)^{k-1}y^k\tag{2}
$$
However, if we don't make this assumption, we can invert the series using Lagrange Inversion:
$$
\begin{align}
\left[\,y^k\,\right]x
&=\frac1k\left[\,x^{-1}\,\right]y^{-k}\\
&=\frac1k\left[\,x^{-1}\,\right]\left(x+x^2+x^3+\dots\right)^{-k}\tag{3}
\end{align}
$$
where $\left[x^k\right]f$ is the coefficient of $x^k$ in the power series expansion for $f$.
Since
$$
\begin{align}
\left(x+x^2+x^3+\dots\right)^{-1}&=\frac{\color{#C00000}{1}}x-1+0x+\dots\\
\left(x+x^2+x^3+\dots\right)^{-2}&=\frac1{x^2}\color{#C00000}{-}\frac{\color{#C00000}{2}}x+1+\dots\\
\left(x+x^2+x^3+\dots\right)^{-3}&=\frac1{x^3}-\frac3{x^2}\color{#C00000}{+}\frac{\color{#C00000}{3}}x+\dots
\end{align}\tag{4}
$$
$(3)$ gives
$$
x=y-y^2+y^3+\dots\tag{5}
$$
