# The inverse of a series: revert

### 5.36.3 The inverse of a series: revert

The revert command finds the beginning of the power series of a function given the beginning of the series of the function.

- revert takes one mandatory and one optional argument:
  - series, the beginning of a power series centered at 0 for a function f.
  - Optionally x, the name of the variable (by default x).
- revert(series ⟨,x⟩) 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.

#### Examples.

- Input:
  revert (x + x^2 + x^4)
  Output:

  x−x2+2 x3−6 x4

  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.
- Input:
  revert(1 + x + x^2/2 + x^3/6 + x^4/24)
  Note that the argument is the beginning of the power series for exp(x), so the output is the beginning of the power series for ln(1+x). Output:

  x−

  x2
  2

  +

  x3
  3

  −

  x4
  4