DGS Studio

Equation Solving

Exponential and Logarithmic Inverses

Solve an exponential for its exponent, or invert a logarithm. Exact integers stay integers. A positive base never equals a negative number or zero.

2^x = 8 has the exact solution x = 3, and 3^x = 81 has x = 4. e^x = 5 has the exact solution x = ln(5), about 1.60943791243. (0.5)^x = 8 has the exact integer x = -3. Solving y = e^x for x gives x = ln(y) with y > 0, and solving y = 2^x for x gives x = ln(y)/ln(2) with y > 0.

Solving y = ln(x) for x gives x = e^y. Solving y = log_4(x) for x gives x = 4^y. The common logarithm is base 10, so y = log(x) solves as x = 10^y, and y = log(x^2-1) solves as x = ±sqrt(10^y+1). 2^x = -4 and 2^x = 0 have no real solution because a positive base to a real power is never negative or zero.

Equation

2^x = 8

How to read this example

An exponential function has a positive constant base and a variable exponent. y = 2^x, y = 2**x, and y = exp(x*ln(2)) are the same growth curve. It passes through (0, 1) and doubles when x increases by 1. y = e^x and y = exp(x) are the natural exponential. A base between 0 and 1, such as (0.5)^x, decreases toward the horizontal line y = 0. A vertical shift such as 3*2^(x-1)+4 approaches the horizontal line y = 4 as x goes to negative infinity.

The inverse of an exponential is a logarithm. 2^x = 8 gives the integer x = 3, and (0.5)^x = 8 gives x = -3. e^x = 5 gives x = ln(5). Solving y = 2^x for x gives ln(y)/ln(2) for y > 0. Solving y = ln(x) for x gives e^y, and solving y = log_4(x) for x gives 4^y. A one-argument log is base 10, so y = log(x) solves as x = 10^y, and y = log(x^2-1) solves as x = ±sqrt(10^y+1). A positive base raised to a real power is never negative or zero, so 2^x = -4 and 2^x = 0 have no real solution. An exponential is not replaced by the straight line y = 2*x.

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.

Power of two

This line is part of the example input and is sent to DGS unchanged.

2^x = 8

Natural exponential

This line is part of the example input and is sent to DGS unchanged.

e^x = 5

Power of three

This line is part of the example input and is sent to DGS unchanged.

3^x = 81

Fractional base

This is a command. The name selects the routine, and the items inside the parentheses are its arguments.

(0.5)^x = 8

Solve y = e^x for x

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

y = e^x, solve for x

Solve y = 2^x for x

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

y = 2^x, solve for x

Solve y = ln(x) for x

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), solve for x

Solve y = log_4(x) for x

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), solve for x

Common log inverse

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), solve for x

Compound logarithm

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^2-1), solve for x

Negative right side

This line is part of the example input and is sent to DGS unchanged.

2^x = -4

Zero right side

This line is part of the example input and is sent to DGS unchanged.

2^x = 0

Try a change

Solve Equation keeps an integer power exact, writes a natural exponential inverse with ln, and writes a general positive base with the change-of-base quotient ln(y)/ln(base). A one-argument log inverts as base 10. A positive base equal to a negative number or zero is reported as no real solution.

Edit and generate

Solve Equation 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