What Is a Function Argument in Math and Programming?

An argument of a function is the input value you give it. In mathematics, when you write f(3), the number 3 is the argument. In programming, when you call a function like multiply(5, 10), the values 5 and 10 are the arguments. The concept is the same in both fields: an argument is what you feed into a function so it can produce a result.

Arguments in Mathematics

A function is a rule that takes every element from one set (called the domain) and assigns it to exactly one element in another set (called the codomain). The argument is whatever value you plug into that rule. If you have a function f(x) = x + 2, then x is the variable that represents the argument. When you evaluate f(5), the argument is 5, and the output is 7.

The argument is also called the input value or independent variable. The result, written as f(x) or y, is the output or dependent variable, because its value depends on what you chose as the argument. The notation f(x) is read as “f of x,” meaning “the function f evaluated at the argument x.” Importantly, f(2) does not mean f multiplied by 2. It means the function f with 2 as its argument.

Most introductory math deals with functions of a single argument, like f(x) = 3x. But functions can take multiple arguments. A function like f(x, y) = x² + y² takes two independent variables as arguments and maps them to a single output. These are called multivariate functions, and they show up constantly in physics, engineering, and finance, where real systems depend on more than one variable.

Arguments in Programming

In programming, an argument is a value you pass to a function when you call it. If you define a function def multiply(x, y) and then call multiply(3, 4), the values 3 and 4 are arguments. The function uses them to do its work and (usually) return a result.

You’ll often hear “argument” and “parameter” used interchangeably, but they technically mean different things. A parameter is the placeholder defined in the function’s signature. An argument is the actual value supplied when the function is called. In def multiply(x, y), x and y are parameters. In multiply(3, 4), 3 and 4 are arguments. Each argument corresponds to the parameter in the same position.

Types of Arguments

Most programming languages support several ways to pass arguments into a function:

  • Positional arguments are matched to parameters based on their order. Calling multiply(3, 4) assigns 3 to the first parameter and 4 to the second. The order matters: swapping them could change the result entirely.
  • Keyword arguments are matched by name rather than position. You could write multiply(y=4, x=3) and get the same result regardless of order, because you’ve explicitly told the function which value goes where.
  • Default arguments let a function work even when you don’t supply every value. If a parameter has a default defined, omitting that argument simply uses the preset value instead.

How Arguments Are Passed to Functions

When you hand an argument to a function in code, the language has to decide what exactly it’s handing over. There are two main approaches, and they affect whether the function can change your original data.

With pass by value, the function receives a copy of the argument. Any changes the function makes to that copy don’t affect the original. If you pass a variable containing 10 into a function and the function changes it to 50 internally, your original variable still holds 10 after the function finishes.

With pass by reference, the function receives the memory address of the original data. Changes inside the function do affect the original. This is useful when you actually want the function to modify something, like swapping two values or updating a list. It’s also more efficient for large data, since the program doesn’t need to duplicate everything in memory. Some languages let you pass by reference but mark the argument as constant, giving you the efficiency benefit without the risk of accidental changes.

Which mechanism a language uses depends on the language itself and sometimes the data type. Understanding the distinction helps you predict whether a function will leave your data untouched or alter it in place.

Arguments vs. Other Terms

The word “argument” overlaps with several related terms, which can get confusing. In math, the argument of a function is the same thing as the input, the independent variable, and the value from the domain. These all describe the same concept from slightly different angles. “Independent variable” emphasizes that you choose it freely. “Input” emphasizes that it goes into the function. “Argument” emphasizes that it’s what the function acts on.

In programming, the key distinction is argument vs. parameter. Parameters belong to the function’s definition. Arguments belong to the function call. One way to remember: parameters are placeholders, arguments are actual values. Beyond that, arguments also differ from return values (what comes out of a function) and from variables defined inside the function body (local variables that the caller never sees).

Whether you encounter the term in a calculus textbook or a Python tutorial, the core idea stays the same. A function is a machine that transforms inputs into outputs. The argument is what you put in.