Enter the fixed cost, variable cost per unit, and the total number of units produced into the calculator to determine the total cost using the cost function.
Cost Function Formula
The following is a common linear cost function used when variable cost per unit is assumed constant over the relevant output range.
C(x) = FC + x * VC
- Where C(x) is the total cost at x number of units
- FC is the fixed cost
- x is the total number of units
- VC is the variable cost per unit (average variable cost per unit)
To calculate the cost from the cost function, add the fixed costs to the product of the number of units times the variable costs per unit.
This is considered a standard linear cost function, but a cost function can be any function defined by a company that accurately predicts costs over a given range of output.
How Do You Define a Cost Function?
The cost function is a formula used to describe how total production costs change as output (quantity) changes.
In other words, the cost function is used to estimate the relationship between the cost and the output.
The cost, in this case, is the expenses needed to manufacture a particular product or offer a service.
The output is the number of units produced or services provided during the period being analyzed.
What Is the Cost Function Used For?
The cost function helps predict total costs at different production levels and can be used to compute cost measures like average cost (total cost divided by units produced). Combined with selling price information, it can also support break-even and target-profit analysis.
How Do You Create a Cost Function?
There are three main steps to create a cost function, those are:
- Find the fixed costs.
- Find the variable cost per unit.
- Multiply the variable cost per unit by the number of produced items, then add the fixed costs.
How to Find Fixed Costs
Fixed costs can be tracked automatically using accounting software. If youโd like to calculate them manually, sum up all costs that do not vary with output (over the time period youโre analyzing). If you want a per-unit value, divide total fixed cost by quantity to get average fixed cost.
Fixed costs are not limited to produced units. In most cases, they also include rent and administration costs.
How to Find Variable Costs
In short, variable costs are costs that change with the level of output (production volume). Examples of variable costs include raw materials, fuel, supplies, and labor hours.
To calculate the variable cost per unit, divide the total variable costs by the number of units produced. In the case of services or labor, split the total variable cost by the number of services provided.
What Are the Types of Cost Functions?
There are many types of cost functions. Common examples include:
- Linear cost function
- Quadratic cost function
- Cubic cost function
What Is the Cost Function in Optimization?
In optimization and machine learning, cost functions are used to measure the progress of a model during training.
This is done by comparing the predicted values the machine is believed to achieve with the actual values that the machine achieves.
Cost Function Example
For example, a non-linear cost function could look something like this: C(x) = FC + VCยทx + kยทx 2. In this case, k is an additional coefficient (in $/unit2) that makes total cost increase faster as output increases.
That means the total cost increases at an increasing (quadratic) rate with units produced. This is not necessarily realistic for all businesses, but it gives you an idea of how different functions can be used to map total cost.
Let's look at an example using the standard linear cost function, where the fixed costs are $50, the total number of units is 500, and the variable costs per unit are $30.
Using the formula above, the cost is found to be:
C(x) = FC + x * VC
C(x) = $50 + 500*$30
C(x) =$15,050.00
FAQ
A cost function is any variable function that can be used to predict the total costs of a good or service at any number of units desired.
A cost function is created similarly to the example above. After taking a time period of data of total units and total costs, a line of best fit can be mapped to the data and a function can be created to equal that line.

