ODE half-life from decay constant calculator
This ODE half-life calculator converts an exponential decay constant into the time required for a quantity to fall to one half of its initial value.
Run — free
It applies the exact relation t½ = ln(2) / λ for the differential equation dQ/dt = -λQ, where λ is positive. Enter a decay constant in any reciprocal time unit and receive the half-life in the matching time unit, together with the constant and formula used. The calculation is deterministic, validates invalid or nonphysical inputs, runs without network access, and costs $0.002 per successful API request.
Connect the decay differential equation to half-life
Exponential decay begins with the ordinary differential equation dQ/dt = -λQ. Its solution is Q(t) = Q(0)e^(-λt), so the fraction remaining after time t is e^(-λt). Half-life is defined as the time when that fraction equals one half. Setting e^(-λt) = 1/2, taking natural logarithms, and solving for time gives t½ = ln(2)/λ. This calculator performs that final conversion when the decay constant is already known. The initial quantity is unnecessary because it cancels from the ratio Q(t)/Q(0); ten atoms, ten grams, and ten thousand simulated particles all have the same half-life when governed by the same constant. Supply decay_constant as a positive finite number. The aliases lambda and decay_rate are accepted for integrations that already use those field names. A zero constant describes no decay and would imply an infinite half-life, while a negative constant represents exponential growth under this sign convention, so both are rejected. Missing, nonnumeric, and non-finite values are rejected as invalid input instead of producing a misleading result. This narrow contract keeps the result auditable and directly tied to the standard decay ODE.
Choose consistent units and interpret the returned fields
The decay constant has dimensions of inverse time, and the half-life has dimensions of time. If λ is measured per second, the returned half_life is in seconds; if λ is per day, the result is in days. The calculator deliberately does not guess or convert units because a bare number cannot reveal whether its source used seconds, hours, years, or another interval. Keep the unit beside the input in your application and label the result with its reciprocal unit. The response echoes decay_constant, reports half_life, includes the numerical value ln2, identifies the formula, and provides a units_note. These fields make it easy to display a concise answer while preserving enough context for an audit log or automated worksheet. Results use stable significant-digit formatting so ordinary floating-point noise does not create changing fixtures, yet very large or very small valid answers retain their scale. For a quick reasonableness check, doubling the decay constant must halve the computed half-life, and halving the decay constant must double it. The output describes the characteristic halving time only; it does not calculate a remaining quantity at an arbitrary time, infer λ from measurements, or attach a physical unit that the caller did not provide.
Use the calculator in models, lessons, and data pipelines
Use the browser calculator when checking an ODE exercise, reviewing a fitted decay parameter, or comparing scenarios without setting up a spreadsheet. Use the API when a simulation pipeline, scientific notebook exporter, educational platform, or monitoring model needs the same deterministic conversion repeatedly. A successful API item costs $0.002; validation failures identify the input problem so the caller can correct it. Because the implementation performs only bounded arithmetic and makes no network request, the same input always produces the same structured output. In an ODE workflow, first establish that the model really is dQ/dt = -λQ with constant positive λ. Then ensure λ and any downstream time values share a consistent unit system, call this capability, and use half_life as a readable summary of the modeled rate. Do not apply the formula unchanged to time-varying decay constants, multi-compartment systems, non-exponential survival curves, or reaction orders whose half-life depends on initial concentration. Those models may still have a time at which half remains, but it must be found from their own solution rather than ln(2)/λ. This capability is intentionally focused on the canonical constant-coefficient exponential-decay equation, making it useful as a transparent building block rather than an opaque general-purpose curve fitter.
What you can do with it
Check an ODE solution
Convert the positive coefficient in dQ/dt = -λQ into its characteristic halving time and compare it with a worked solution.
Summarize a fitted decay model
Turn a decay constant produced by an upstream model into a more intuitive time value for a report or dashboard.
Generate deterministic lesson answers
Create stable structured results for calculus exercises, automated graders, and examples that teach exponential decay.
FAQ
What formula does the calculator use?
It uses half_life = ln(2) / decay_constant, derived by setting the exponential solution Q(t)/Q(0) equal to one half.
What units will the half-life have?
The result uses the reciprocal time unit of the decay constant. A constant per hour produces a half-life in hours.
Why must the decay constant be positive?
A positive constant represents decay in dQ/dt = -λQ. Zero does not decay, and a negative value represents growth under that convention.
Do I need to provide the initial quantity?
No. The initial quantity cancels when the exponential solution is set equal to one half of its starting value.
How much does an API calculation cost?
Each successful API item costs $0.002. The browser calculation can be used directly for quick interactive checks.
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/calculus/half-life-from-decay-constant \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"decay_constant":0.05}'const res = await fetch("https://api.kit.forhosting.com/calculus/half-life-from-decay-constant", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"decay_constant": 0.05
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/calculus/half-life-from-decay-constant",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"decay_constant": 0.05
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/calculus/half-life-from-decay-constant", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"decay_constant":0.05}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"decay_constant":0.05}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/calculus/half-life-from-decay-constant", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"decay_constant": 0.05
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "calculus.half_life_from_decay_constant",
"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. |