DGS Studio

Logarithmic Functions

Logarithmic Functions

ln is the natural logarithm, log is base 10, and log_b is an arbitrary base. The five ways of writing log base 4 are the same curve. The domain is x > 0, and the base must be positive and not 1.

y=log_4(x), y=log₄(x), y=log(x, 4), y=ln(x)/ln(4), and y=log(x)/log(4) are one curve. At x=1/16, 1/4, 1, 2, 4, 16, and 64 the values are -2, -1, 0, 1/2, 1, 2, and 3. y=log(x) passes through (10, 1), and y=ln(x) passes through (e, 1).

The curve is drawn only for x>0. A base between 0 and 1, such as log base 1/2, decreases through the same kind of points with the signs reversed. The caption writes the base as a subscript. A base of 1 is an error instead of the line y=x.

Equation

y = log_4(x)

Graph preview

Graph preview of y = log_4(x)
A static sample of this expression. The studio draws the full interactive result.

How a real logarithm is read

ln(x) is the natural logarithm, base e. log(x) in a graph or a high-school equation is the common logarithm, base 10. log_b(x), a subscript such as log_4(x), and log(x, b) are the logarithm of x in base b. The change-of-base identities ln(x)/ln(b) and log(x)/log(b) are the same function. A base greater than 1 increases, and a base between 0 and 1 decreases.

The real logarithm requires x > 0, a positive base, and a base other than 1. Samples outside that domain are left undefined and are not joined by a straight line. An unreadable logarithm or a forbidden base is an error. It is not replaced by the line y = x. Calculus expressions keep the historical one-argument natural logarithm unless a base is written explicitly.

Reading the input

Other versions of this example

These stay on this page so each version keeps the same explanation. Choose Try example to run a version in its Studio workflow, or copy it into the editable field below.

log base 4

This line defines an explicit function. The left side is the vertical coordinate, and the right side is evaluated for each x.

y = log_4(x)

Unicode subscript

This line defines an explicit function. The left side is the vertical coordinate, and the right side is evaluated for each x.

y = log₄(x)

Two-argument log

This line defines an explicit function. The left side is the vertical coordinate, and the right side is evaluated for each x.

y = log(x, 4)

Change of base, natural

This line defines an explicit function. The left side is the vertical coordinate, and the right side is evaluated for each x.

y = ln(x)/ln(4)

Change of base, common

This line defines an explicit function. The left side is the vertical coordinate, and the right side is evaluated for each x.

y = log(x)/log(4)

Common log

This line defines an explicit function. The left side is the vertical coordinate, and the right side is evaluated for each x.

y = log(x)

Natural log

This line defines an explicit function. The left side is the vertical coordinate, and the right side is evaluated for each x.

y = ln(x)

Decreasing log

This line defines an explicit function. The left side is the vertical coordinate, and the right side is evaluated for each x.

y = log_(1/2)(x)

Try a change

Generate Graph draws log_b(x), subscript bases, log(x, b), and both change-of-base quotients as the same curve when the base matches. The caption uses a logarithmic subscript. Undefined samples are omitted, including x ≤ 0, and a decreasing base still follows the real branch. A failed logarithm is an error rather than y = x.

Edit and generate

Generate Graph opens the studio homepage and runs this field. Open in DGS Studio loads the same text and waits for you to generate it. The equation is sent once, as a query parameter.

Related examples