What is meant by a function that varies in only one direction? My professor mentioned in class today about a "function that varies in only one direction". To clarify, he said he meant a function which is a function of a linear combination of the variables.
That is, $$f(x_1,x_2,\ldots,x_n)$$ is a function that varies in only one direction provided that there are some constants $a_1,a_2,\ldots,a_n$ and a function $g$ such that $$f(x_1,x_2,\ldots,x_n) = g(\sum_{i=1}^n a_i x_i)$$
The problem I am having is I dont understand why the last equation implies a function that varies in one direction. Wouldn't a function that varies in only one direction be more like:
$$
f(x_1,x_2,\ldots,x_n) = f(a_1x_1)?
$$
Is someone able to give me a graphical idea of how to visualize it? Perhaps in one or two dimensions? Thank you!
 A: First of all, what you're thinking of is $$f(x_1, \dots, x_n) = g(a_1x_1).$$ If $n > 1$, $f$ can't be a function of $n$ variables and function one variable.
What you're thinking of is a function of $n$ variables which varies in one of the coordinate directions, namely the $x_1$-direction. What your professor was referring to is a function which varies along some line through the origin; it does not necessarily have to be one of the coordinate axes.
Note that 
$$f(x_1, \dots, x_n) = g\left(\sum_{i=1}^na_ix_i\right)$$ 
varies along the line $\{t(a_1, \dots, a_n) \mid t \in \mathbb{R}\}$.
A: You are right, a function like $f(x_1\ldots x_n)=g(a\cdot x_j)$ varies only in one direction, the $x_j$ one. When $j$ runs from $1$ to $n$ those functions exhaust all possible examples of functions varying along coordinate directions. What about functions varying along directions that are not coordinate? To understand them we just need to perform a linear change of coordinates to turn such a direction into a coordinate direction.
From a geometrical point of view the distinction between a coordinate direction and an arbitrary direction is rather artificial: the first ones are identified by the unit vectors $\mathbf{e}_j=(0\ldots 1 \ldots 0)$, all others by arbitrary unit vectors $\mathbf{n}$. So let $\mathbf{n}$ be fixed and consider an orthonormal basis $\tilde{\mathbf{e}}_1\ldots \tilde{\mathbf{e}}_n$ of $\mathbb{R}^n$ with the property that $$\tilde{\mathbf{e}}_1=\mathbf{n}.$$The resulting coordinate system $\tilde{x}_1\ldots \tilde{x}_n$, defined by the equations $$\tilde{x}_j(\mathbf{r})=\mathbf{r}\cdot \tilde{\mathbf{e}}_j, $$is such that the $\tilde{x}_1$ direction is exactly the one identified by $\mathbf{n}$. The general form of a function which varies only along the $\mathbf{n}$ direction is therefore:
$$\tilde{f}(\tilde{x}_1\ldots \tilde{x}_n)=g( \tilde{x}_1), $$ for some $g\colon \mathbb{R}\to \mathbb{R}$. To conclude we simply recover the functional form of $\tilde{f}$ in our original coordinate system $(x_1\ldots x_n)$, writing
$$
f(x_1\ldots x_n)=\tilde{f}(\tilde{x}_1\ldots \tilde{x}_n)=g(\tilde{x}_1), $$
and inserting the change of coordinate equations 
$$\tilde{x}_j=\phi_j(x_1\ldots x_n).$$
We thus obtain that $f$ must have the following form:
$$f(x_1\ldots x_n)=g(\phi_1(x_1\ldots x_n)),$$
where $\phi_1$ is the function that expresses the $\tilde{x}_1$ coordinate as a function of the $x_1\ldots x_n$ coordinates. Since we have only considered linear coordinate systems (with center at the origin of $\mathbb{R}^n$), this function must be linear, as so it must have the form 
$$\phi_1(x_1\ldots x_n)=a_1x_1+\dots + a_nx_n$$ for some coefficients $a_1\ldots a_n$. 
A: It is somewhat misleading to say that a function $f:\>{\mathbb R}^n\to{\mathbb R}$
of the form
$$f(x_1,\ldots, x_n)=g(a_1x_1+\ldots+a_n x_n)\tag{1}$$
"varies in only one direction", to wit: the direction of the vector $a=(a_1,\ldots, a_n)$. For most points $p$ the increment
$$f(p+X)-f(p)=g'(a\cdot p)\ a\cdot X+o(|X|)\qquad(X\to 0)$$
will be $\ne0$ for most increment vectors $X$, and this certainly implies that $f$ "varies in all directions".
However one can say the following: A "generic" function $f:\>{\mathbb R}^n\to{\mathbb R}$ depends on all $n$ variables independently in a most complicated way. But when a function of the form $(1)$ is at stake,  the variables $x_1$, $\ldots$, $x_n$ are  collected in the linear expression $\phi_a(x):=a_1x_1+\ldots a_n x_n$ and do not appear individually otherwise, and in a second step some function $g$ of a single variable $t$ does its work. In fact $(1)$ can be read as $f=g\circ\phi_a$.
As a consequence, the necessary data to set up such an $f$ consist of a single vector $a$ and a function $t\mapsto g(t)$ of one variable.
This $f$ will be constant on the hyperplanes $a\cdot x={\rm const.}$, which are orthogonal to $a$. Let $\ell$ be an arbitrary line line parallel to $a$. Then $\ell$ intersects all these hyperplanes, and investigating $f$ along $\ell$, which is the same thing as looking at the graph of $g$, tells us everything about $f$.
