### 5.38.4 The inverse of a series: revert

The revert command takes as argument an expression which represents the beginning of a power series centered at 0 for a function f. By default, the variable is x, if a different variable is used, then that variable should be the second argument.
revert returns the beginning of the power series for the inverse of f, namely the beginning of the power series for g(f(0)+x) where the function g satisfies g(f(x))=x.
Input:

revert (x + x^2 + x^4)

Output:

x-x^2+2*x^3-6*x^4

Note that if the power series of a function f begins with x + x2 + x4, then f(0)=0, f′(0)=1, f″(0)=2, f‴(0)=0 and f(4)(0) = 24. The function g with g(f(x))=x will then satisfy g(0)=0, g′(0)=1/f′(0) = 1, g″(0) = −2, g‴(0) = 12 and g(4)(0) = −144. The power series for g will then begin x − x2 + 2x3 − 6x4.

Entering the beginning of the power series for exp(x),
Input:

revert(1 + x + x^2/2 + x^3/6 + x^4/24)

Output:

x-1/2*x^2+1/3*x^3-1/4*x^4

returns the beginning of the power series for ln(1+x).