ForHosting KIT · Finance & money

Marginal cost from cost function calculator

Get marginal cost straight from a quadratic cost function: with a fixed cost of 100, coefficients of 20 and 2, and an output of 10, marginal cost is 60, total cost 500 and variable cost 400. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Fixed cost
100
Linear coef
20
Quadratic coef
2
Quantity
10
You get
Total cost
500
Variable cost
400
Marginal cost
60
Cost function
TC(Q)=100+20Q+2Q^2

Marginal cost is the extra cost of producing one more unit of output. In intermediate microeconomics the usual short-run total cost function is quadratic, TC(Q) = a + bQ + cQ², where a is fixed cost and the remaining terms are variable cost. Differentiating those variable-cost terms with respect to Q gives the analytic marginal-cost schedule MC(Q) = b + 2cQ. This calculator accepts the three coefficients of that cost function and a chosen output level, then returns MC evaluated at that Q together with the implied total and variable cost so you can check the arithmetic against a textbook table. Fixed cost does not appear in the derivative, which is why two plants that share the same variable-cost coefficients share the same MC curve even when their rents differ. Students use the identity to sketch MC next to AVC and ATC; operators use it when a fitted quadratic cost curve must become a unit-cost figure at a planned run size.

What marginal cost is and why a quadratic TC differentiates so cleanly

In the short run a firm’s total cost is the sum of a fixed bill that does not change with output and a variable bill that does. Textbook problems almost always write that split as a quadratic polynomial: TC of Q equals a plus b times Q plus c times Q squared. The constant a is total fixed cost—rent, certain insurance, and other outlays that stay put while Q varies.

The terms bQ and cQ squared together are total variable cost. Marginal cost is defined as the derivative of total cost with respect to output, or equivalently as the derivative of variable cost, because the derivative of a constant is zero. Applying the power rule term by term yields MC of Q equals b plus two c times Q.

That schedule is a straight line: its intercept is the linear coefficient b and its slope is twice the quadratic coefficient. When c is positive the line slopes up, which is the usual diminishing-returns story; when c is zero the line is flat at b, a constant-MC special case; when c is negative the line slopes down, which some problem sets use to illustrate an unstable region.

Average variable cost is TVC divided by Q, not the derivative, so AVC and MC coincide only at specific points, typically the minimum of AVC. This calculator never approximates the derivative with a finite difference of nearby totals: it evaluates the exact analytic expression, which is what exam keys and LMS oracles expect when the cost function is given in closed form rather than as a table of discrete Q values.

Where a marginal-cost-from-cost-function calculator earns its keep

Introductory and intermediate microeconomics courses assign this exact move—write TC as a quadratic, differentiate the variable terms, evaluate MC at a listed Q—because it is the bridge from a cost function to the supply decision of a competitive firm. Tutoring platforms and LMS plugins need a deterministic oracle that rejects negative output instead of silently returning a slope that a buggy grader might accept.

Analysts who have already fitted a quadratic cost curve to plant data want the same closed-form MC at a planned run size without reopening a spreadsheet and risking an off-by-one finite difference. Pair this capability with average-variable-cost or market-equilibrium tools when you need AVC or a clearing price; keep this surface focused on the derivative of the quadratic cost function at a chosen output.

Homework MC from a given TC(Q)

Students enter a, b, c, and Q from a quadratic total cost function and verify MC = b + 2cQ against textbook cost tables.

Plant cost-curve evaluation

Turn a fitted quadratic cost function into marginal cost at a planned run size without approximating the derivative from a table.

How do you get marginal cost from a quadratic cost function?

Write TC(Q) = a + bQ + cQ² and differentiate the variable-cost terms: MC(Q) = b + 2cQ. This calculator evaluates that closed form at your chosen Q.

Why does fixed cost not appear in marginal cost?

Fixed cost is the constant a. The derivative of a constant is zero, so MC depends only on the variable-cost coefficients b and c and on Q.

How is this different from average variable cost?

AVC is TVC divided by Q. MC is the derivative dTC/dQ. They are equal only at specific points (typically the minimum of AVC), not at every output.

What does the slope of the marginal cost line tell me?

The slope is twice the coefficient on output squared. A positive coefficient makes marginal cost rise with output, zero keeps it flat at the linear coefficient, and a negative one makes it fall.

Can I calculate marginal cost at zero output?

Yes. At zero output, marginal cost equals the linear coefficient, 20 in the example, because the second term disappears. Output cannot be negative, and the fixed cost must be zero or more.

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.

POSThttps://api.kit.forhosting.com/econ/marginal-cost-from-cost-function

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.

curl -X POST https://api.kit.forhosting.com/econ/marginal-cost-from-cost-function \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fixed_cost":100,"linear_coef":20,"quadratic_coef":2,"quantity":10}'
{
  "fixed_cost": 100,
  "linear_coef": 20,
  "quadratic_coef": 2,
  "quantity": 10
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "econ.marginal_cost_from_cost_function",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Inputs, the closed-form derivative, outputs, and validation

Quantity must be non-negative—output cannot be negative—and zero is allowed because MC at the origin is simply the intercept b. Example: a equals one hundred, b equals twenty, c equals two, Q equals ten yields TC of five hundred, TVC of four hundred, and MC of sixty, because twenty plus two times two times ten is sixty. POST a JSON body with four required finite numbers. The field fixed_cost is the constant a in TC of Q equals a plus bQ plus cQ squared; it must be non-negative and is echoed so you can rebuild the original function, but it does not enter the derivative. The field linear_coef is the coefficient b of the first variable-cost term; quadratic_coef is the coefficient c of Q squared; quantity is the output Q at which you want MC. Textbook aliases a, b, c, and q are accepted as well. On success the response echoes the four inputs (rounded for stable goldens), returns total_cost and variable_cost evaluated at Q, and returns marginal_cost as b plus two c times Q. Display strings cost_function and marginal_cost_function rewrite TC and MC with the numeric coefficients, and formula restates the derivative identity. Missing, empty, or non-finite fields fail naming the field; a negative fixed cost or a negative quantity fails with invalid_input. Failed validation is not billed; successful parse calls use the published $0.002 base price.

Where a marginal-cost-from-cost-function calculator earns its keep

Pin the rounded marginal_cost in tests, keep fixed cost and quantity non-negative, and you get reproducible MC figures for homework, exam generators, and lightweight cost notebooks without standing up a computer-algebra system.

LMS and tutoring auto-grading

Score “find MC at Q from TC(Q)=a+bQ+cQ²” items with a deterministic oracle that rejects negative output as invalid_input.

What inputs does the calculator need?

Four finite numbers: fixed_cost (a, non-negative), linear_coef (b), quadratic_coef (c), and quantity (Q, non-negative). Textbook aliases a, b, c, and q are accepted.

What does the marginal cost from cost function calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →