1. Sep 19, 2011

### timsea81

1. The problem statement, all variables and given/known data

Consider scalar functions u = u(x). Compute the gradients ∇u for:

u(x) = (x, y, z)
u(x) = (y, z, x)
u(x) = (x^2y, 10, z + x)

2. Relevant equations

This is a question on my homework for undergraduate Fluid Mechanics. The teacher has been assigning math problems in topics covered in prerequisite courses for homework at the beginning of the semester. He has not explained any of these concepts, and whenever anyone asks he says "Calculus is a prerequisite for this class, you should know this already". Sorry if it sounds like I'm just complaining about my instructor's teaching style, but the point I'm trying to make is that I don't have any examples to look at to help me understand this notation.

I took Calc III about 7 years ago, so I clearly don't remember everything. Through internet research I found out that a gradient is the set of partial derivatives of each variable in a multi-variable function. For example I think I understand (please correct me if I'm wrong) that if
F(x,y,z)=x+3y+z^2
the gradient of F(x,y,z) is (1, 3, 2z)

However, I do not understand this question. It may just be that I do not understand his notation. Is u(x)=(x,y,z) just another way of writing u(x) = x+y+z? Why isn't it u(x,y,z) = (x,y,z), since there are 3 variables? Has anyone seen this notation before?

3. The attempt at a solution

Last edited: Sep 19, 2011
2. Sep 19, 2011

### timsea81

I just realized that it is u(x), not u(x). The x is bold, which I guess indicates it is a vector? In that case, my previous guess that
u(x) = (x, y, z)
is another way of writing
u(x,y,z) = x+y+z
makes a little more sense.

So is it
u(x) = (x, y, z)

u(x) = (y, z, x)

u(x) = (x^2y, 10, z + x)
grad u(x) = (2xy, 0, 1)

?

3. Sep 19, 2011

### Staff: Mentor

Not to me it doesn't. What you seem to have here are vector-valued functions that map R3 to R3. IOW, the input values are vectors in 3-space, and the output values are also vectors in 3-space.

Another way to write this is
u(x) = xi + yj + zk, where the bolded letters on the right are unit vectors.

4. Sep 19, 2011

### timsea81

Yes, that makes more sense. I actually realized I should have used i,j and k after I typed that up. So I am on the right track then?

5. Sep 19, 2011

### Staff: Mentor

Yes, what you have in post #2 looks OK, if you add the unit vectors.

6. Sep 19, 2011

### timsea81

7. Sep 19, 2011

### Staff: Mentor

After some thought, and realizing that I misunderstood what you were asking, I'm going to change my answer. What you were describing as scalar functions are in fact vector-valued functions, or vector fields. The problem is probably asking you to find the Jacobian matrix for u.

Here's a quote from the page I linked to:

Last edited: Sep 19, 2011
8. Sep 19, 2011

### timsea81

The link you posted also says the following:

"In a sense, both the gradient and Jacobian are "first derivatives" — the former the first derivative of a scalar function of several variables, the latter the first derivative of a vector function of several variables."

So the gradient is used for scalar functions and the Jacobian is used for vector functions.

I think I need to remind myself exactly what a "scalar function" is. At first I was confused about how it was stated in the question that u(x) is a "scalar function" because I thought that meant that the solution should be a scalar, as in a quantity of magnitude only without direction, as in a 1-dimensional result. For example f(x,y,z) = x^2+5y-z is a scalar function because it takes a three dimensional input and transforms it into a single dimension result. If it were to input (1,1,1), f(1,1,1) = 1+5-1 = 5, so input (1,1,1) output 5.

On the other hand, the functions given in the problem take a 3-dimensional vector input and return a 3-dimensional vector output (like you said, a map of R3 to R3) . For example f(x,y,z) = (x,5y,-z) would input (1,1,1) and output (1,5,-1)

I must be wrong about this, if the question is correct to describe these functions as scalar. Is it really that any function with 1-dimensional variables is called scalar? Where a vector function might look like

f(x, y) = (xXc, yXb)

where [x], [y], [a], and are all vectors??

9. Sep 19, 2011

### Staff: Mentor

Yes, a scalar function has an output that is a single number. This type of function can have multiple variables, so your example of f(x, y, z) = x^2 + 5y - z is an example of a scalar function.

On the other hand, if a function produces a vector result, such as the one you give -- f(x, y, z) = <x, 5y, -z> -- it's called a vector function.

The vector vs. scalar business doesn't have anything to do with the number of variables in an input. It concerns only whether the output is a number (scalar) or a vector.