# Logarithmic function

It may be shown, by Mathematical Induction, that the Geometric series has the indicated value:

1 + x + x^2 + x^3 + ... + x^i + ... + x^n = (1 - x^(n + 1)) / (1 - x)

The limit, as n increases without bound, is 1 / (1 - x) provided that x is inside of its circle of convergence: abs(x) < 1.

We define the logarithmic function as the inverse of the exponential function; hence, the derivative of the logarithmic function is d ln(x) / dx = 1 / x. Thus, the indefinite iintegral of 1/x is ln(abs(x)) + C. In passing, we observe that, for real a and b, the logarithm of the complex number a + ib may be expressed as ln(a + ib) = (1 / 2) ln(a^2 + b^2) + iArctan(b / a).

Let us integrate the infinite Geometric series to obtain:

- ln(1 - x) = x + x^2 / 2 + x^3 / 3 + x^4 / 4 + ... + x^i / i + .... provided abs(x) < 1

Replace x by its additive inverse (that is, by -x):

ln(1 + x) = x - x^2 / 2 + x^3 / 3 - x^4 / 4 + ... - (-x)^i / i + .... provided abs(x) < 1

Take half the sum:

(1 / 2) ln((1 + x) / (1 - x)) = x + x^3 / 3 + x^5 / 5 + x ^7 / 7 + ... + x^(2i + 1) / (2i + 1) + .... provided abs(x) < 1

Let y = (1 + x) / (1 - x); then x = (y + 1) / (y - 1). This transformation is called "bilinear"; because it is the quotient of two linear expressions. It has many interesting properties: for instance, it maps conic sections into conic sections. We may employ this transformation in the foregoing to obtain the logarithm of y provided that the real-part of y is strictly positive, which we write Re(y) > 0:

ln(y) = 2 x (1 + x^2 / 3 + x^4 / 5 + x^6 / 7 + ... + x^(2i) / (2i + 1) + ....) provided Re(y) > 0

Of course, we would square x once, then employ that value in the series. The ratio of the i-th term to the (i- 1) term is x^2 2i / (2i + 1). See the evaluation of a power series, for a practical method of evaluation of a power series.

In passing, we observe that the logarithmic function has an essential singularity at the origin.That means that the limit of the logarithmic function, as x approaches zero, depends upon the angular direction of the approach.

## Inverse Tangent

In the infinite Geometric series, replace x by - x^2 to obtain:

1 - x^2 + x^4 - x^6 + ... + (-1)^i x^(2i) + .... = 1 / (1 + x^2) provided that abs(x) < 1

Integrate to yield

Arctan(x) = x - x^3 / 3 + x^5 / 5 - x^7 / 7 + ... + (-1)^i x^(2i + 1) / (2i + 1) + .... provided that abs(x) < 1

We would prefare to factor-out the x to yield the formula for the Inverse circular tangent:

Arctan(x) = x ( 1 - x^2 / 3 + x^4 / 5 - x^6 / 7 + ... + (-1)^i x^(2i) / (2i + 1) + ....) provided that abs(x) < 1

The ratio of the i-th to the (i - 1)-th term is - x^2 (2 i - 1) / (2 i + 1).

Replace x by ix to yield

Arctanh(x) = x + x^3 / 3 + x^5 / 5 + x^7 / 7 + ... + x^(2i + 1) / (2i + 1) + .... provided that abs(x) < 1

Again, factoring-out the x yields the formula for the Inverse hyperbolic tangent:

Arctanh(x) = x ( 1 + x^2 / 3 + x^4 / 5 + x^6 / 7 + ... + x^(2i) / (2i + 1) + ....) provided that abs(x) < 1

The ratio of the i-th to the (i - 1)-th term is x^2 (2 i - 1) / (2 i + 1). See the evaluation of a power series, for a practical method of evaluation of a power series

In each of these factored series, it would be expedicious to pre-compute the square of x.

Employ the cotan(x) = 1 / tan(x), cotanh(x) = 1 / tanh(x), and the addition theorems to confine abs(x) < 1 and to obtain the desired quadrant.

While, of course, the Taylor series for each of the inverse trigonometric functions exists, only these two are feasible for computation. The other inverse trigonometric functions have to be obtained from these by solving a quadratic equation; thus, involving square roots.

## Logarithm of a complex number

Each of the foregoing formulae holds for any complex number (within its region of convergence). However is is both easier and faster to compute if the arguments are real-complex and near their respective optimum values.

First observe that for a complex x = a + i b (where a and b are real-complex numbers), we have the principal value of the logarithm of x

ln(x) = ln(a + i b) = (1 / 2) ln(a^2 + b^2) + i Arctan(b / a)

where this inverse tangent is to be taken in the semi-closed interval (- pi, pi], such that if a is the abscissa and b is the ordinate (in a Cartesian coordinate system), they determinte the quadrant of the inverse tangent. Aribrarily, we take this inverse tangent to be zero, if both a and b are zero. Of course, any integral multiple of 2 pi i may be added for the general value.

Copywrite (c) 1997 R. I. 'Sciibor-Marchocki last modified on Tuesday 20-th May 1997.