Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I define a scalar function which has a vector-valued argument?

For example, let $U$ be a potential function in 3-D, and its variable is $\vec{r}=x\hat{\mathrm{i}}+y\hat{\mathrm{j}}+z\hat{\mathrm{k}}$.

Then $U$ will have the form of $U(\vec{r})$.

Is there any problem?

share|cite|improve this question

migrated from Apr 12 '12 at 17:20

This question came from our site for active researchers, academics and students of physics.

That's perfectly okay. – kηives Apr 12 '12 at 0:23
I think this might be more suitable on math.SE... thoughts from anyone else? – David Z Apr 12 '12 at 4:13
@DavidZaslavsky: Yeah, makes more sense on math.SE – Manishearth Apr 12 '12 at 4:48
up vote 2 down vote accepted

That depends on what exactly you mean by scalar.

Do you mean a function that's just a number? Then of course you can think up any function you want that turns three input numbers $x, y$ and $z$ into one output number $U(\vec{r}) = U(x,y,z)$. Examples would be $U(\vec{r}) = |\vec{r}| = \sqrt{x^2 + y^2 + z^2}$ or $U(\vec{r}) = x + y - 2z$, or just general definitions such as $U(\vec{r}) = $ temperature at location $\vec{r}$, or $\varrho(\vec{r}) = $ Charge density at location $\vec{r}$.

If, however, by scalar you mean an object that's not only a number, but also rotationally invariant, then your options are a tiny bit limited. An object that's invariant under rotation cannot depend on the specific direction of $\vec{r}$ but only on its magnitude, so the first example above would be a scalar, but the second example would not.

EDIT: Since this was migrated from the physics SE, let me note that there are some subtle differences in nomenclature. In physics, the term "scalar" can have more meaning than "element of $\mathbb{R}$ or $\mathbb{C}$. It can mean: "Something that is invariant under rotation". Or, in the case of a Lorentz scalar, "something that is invariant under a certain transformation".

share|cite|improve this answer

That's a perfectly fine thing to do. The classic example of such a field is the temperature in a room: the temperature $T$ at each point $(x,y,z)$ is a function of a $3$-vector, but the output of the function is just a scalar ($T$). $\phi^4$ scalar fields are also an example, as are utility functions in economics.

share|cite|improve this answer

The (more or less) canonical example is the divergence, here the divergence is of a vector valued function $\mathbf{F} = U(x,y,z)\hat{i} + V(x,y,z)]\hat{j} + W(x,y,z)\hat{k}$

$$\operatorname{div}\,\mathbf{F} = \nabla\cdot\mathbf{F} =\frac{\partial U}{\partial x} +\frac{\partial V}{\partial y} +\frac{\partial W}{\partial z }$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.