Scalar-Valued Function — Definition & Example
A scalar-valued function (also called a scalar function) is a function that returns a single real number as its output, even when it takes several inputs. Examples include a temperature at a point in a room, the height of a hill above a spot on a map, or the cost of a production plan.
A scalar-valued function is a function whose domain is a subset of . It assigns to each point exactly one real number . When , it is also called a multivariable function or, in physics, a scalar field. Its codomain is , not with . That is what separates it from a vector-valued function.
Worked Example
Problem: The temperature in a workshop, in degrees Fahrenheit, is modeled by . Here , , and are distances in feet from one corner of the room. Find the temperature at the points and , and decide which point is warmer.
Step 1: Substitute the coordinates of . All three numbers go in, and one number comes out.
Step 2: Substitute the coordinates of in the same way.
Step 3: Both outputs are single real numbers, so you can compare them directly. Vector outputs could not be ranked this way.
Answer: and . Point is warmer by . Each input point in 3D space produced one number. That single-number output is what makes scalar-valued.
Why It Matters
Most of Calculus III is built on scalar-valued functions. You take their gradients, maximize them with Lagrange multipliers, and integrate them over regions with double and triple integrals. Outside the classroom, the same idea appears in physics as potential energy and pressure fields. In machine learning, a loss function is a scalar-valued function of thousands of model weights.
Common Mistakes
Mistake: Calling vector-valued because its input is a point or vector.
Correction: Classify a function by its output, not its input. If returns one real number, it is scalar-valued, no matter how many inputs it has. A function is vector-valued only when its output has two or more components, such as .
