Exponential equation solver
Find the exponent that turns a base into a value: in 2ˣ = 8 the answer is 3, shown as a decimal and in exact form, with a check that 2³ really gives 8. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- B
- 2
- Y
- 8
- Equation
- 2^x = 8
- X
- 3
- X decimal
- 3
- Exact
- 3
An exponential equation of the form b raised to the power x equals y asks for the real exponent that turns a fixed positive base into a fixed positive value. The unique real solution, when it exists, is the logarithm of y in base b, which every scientific calculator evaluates through the change-of-base identity: x equals the natural log of y divided by the natural log of b, or equivalently the common log of y divided by the common log of b. This solver accepts two finite numbers, enforces the classical domain that the base is positive and different from one and that the value is positive, then returns both a cleaned decimal approximation and an exact string—an integer when the answer is a whole number, a simple rational when it is a small fraction, or an explicit log ratio otherwise. Invalid bases and non-positive values fail with a clear validation error instead of a silent NaN.
How logarithms solve b to the x equals y
Start from the real exponential statement base b raised to the power x equals value y. Taking the logarithm of both sides in any fixed base greater than zero and different from one yields x times the log of b equals the log of y, so x equals log of y over log of b. Choosing the natural logarithm is the usual machine path: x equals ln of y divided by ln of b.
The same identity with common log or with the explicit base-b log is algebraically equivalent; only the intermediate function call changes. The domain is strict. The base must be positive so that real powers stay continuous for every real exponent, and it must not equal one because one raised to any real power is always one, which either has no solution when y is not one or infinitely many solutions when y is one.
The value y must be positive because the real logarithm is undefined for zero and for negative numbers. Within that open set the map x maps to b to the x is bijective from the reals onto the positive reals, so exactly one real solution always exists.
This implementation evaluates the change-of-base formula with ordinary floating-point logs, then classifies the numeric result: if it is within a tight tolerance of an integer the exact field is that integer; if it is within tolerance of a reduced fraction with denominator at most thirty-two the exact field is that fraction; otherwise the exact field is the ratio log of y over log of b.
A small check block recomputes b to the reported x and reports whether it recovers y within relative noise, which catches domain mistakes early when clients build pipelines.
Where exponential equation solvers show up in real work
Secondary-school and college algebra courses constantly assign change-of-base drills, compound-interest rearrangements, and half-life questions that reduce to base raised to time equals a ratio; a single trusted oracle that returns both exact and decimal forms speeds grading and demo setup. Programming contest problems and interview warm-ups often hide an exponential under doubling times, bit-depth counts, or growth models, and engineers need an honest rejection when the base is one or the value is non-positive rather than a silent NaN from an unchecked logarithm.
Finance and science notebooks invert exponential growth and decay formulas—principal times one plus rate to the n, or initial mass times e to the negative k t—and must report a clean exponent without inventing complex logs for negative mass. If you later need quadratic or cubic closed forms, systems of two exponential equations, or symbolic rewriting of a times b to the x plus c equals zero, treat those as separate search intents and landings rather than overloading this single-base exponential solver page.
What you can do with it
Homework and exam answer keys
Generate exact and decimal solutions for textbook b^x = y sets so teachers and auto-graders share one ground truth for integer, rational, and log-form answers.
Growth, decay, and half-life inverses
Invert exponential growth or decay models to recover time or exponent from a measured ratio without silent NaN when the base or value is invalid.
FAQ
How does this exponential equation solver find x?
The decimal field is the floating-point evaluation; the exact field prefers an integer or simple rational when recognizable.
Why must the base be positive and not equal to one?
Real continuous exponentiation with a free real exponent needs b > 0.
Why must y be positive?
The real logarithm is only defined for positive arguments.
What does it cost?
The browser tool is free and runs locally.
Does it matter whether I use ln or log to solve it?
No. Dividing ln(y) by ln(b) and dividing log(y) by log(b) give the same exponent. Only the intermediate step changes, and the solver shows both forms.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/algebra/exponential-equation \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"b":2,"y":8}'const res = await fetch("https://api.kit.forhosting.com/algebra/exponential-equation", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"b": 2,
"y": 8
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/exponential-equation",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"b": 2,
"y": 8
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/exponential-equation", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"b":2,"y":8}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"b":2,"y":8}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/exponential-equation", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"b": 2,
"y": 8
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.exponential_equation",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Classic drills such as two to the x equals eight, four to the x equals two, and e to the x equals ten all share one deterministic JSON contract.
How logarithms solve b to the x equals y
Parallel exact_forms always restate the log-base, common-log, and natural-log writings so worksheets can show multiple textbook styles without a second tool. The entire path is deterministic—no random seeds, no wall-clock timestamps, no network calls, and no model drift—so identical coefficients always produce identical JSON.
What you send and what you get back
Send two finite numbers under the fields b and y representing the base and the value in b raised to x equals y. Both fields are required. Formula and domain strings restate the closed form and the open set for UI labels. Classic textbook checks include b equals two and y equals eight with exact three; b equals four and y equals two with exact one half; b equals ten and y equals one thousand with exact three; and b equals two and y equals ten with a non-integer logarithmic exact form near three point three two. Missing fields, non-numeric strings, NaN, and Infinity fail with invalid_input and are not charged. When b is not positive, when b is essentially one, or when y is not positive, the request fails with an English message that names the domain rule, so clients can fix the form instead of guessing. On success the response echoes cleaned b and y, a printable equation string such as two caret x equals eight, the decimal solution under both x and x_decimal, the preferred exact string, exact_kind as one of integer, rational, or logarithmic, and exact_forms with log_base, change_of_base_log, and change_of_base_ln. The check object reports b_to_x and a boolean matches_y. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where exponential equation solvers show up in real work
Data teams generating synthetic labels for classification of integer versus non-integer exponents benefit from the exact_kind field. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.
Integration use cases
Contest fixtures and notebook checks
Bulk-build regression fixtures for change-of-base problems and classify exact_kind for integer versus logarithmic cases in automated pipelines.
Technical questions
What is the difference between exact and x_decimal?
x and x_decimal are the same cleaned floating-point solution. exact is a human string: an integer like "3", a rational like "1/2", or a log ratio like "log(10)/log(2)" when no simple rational is detected.