Confused about notation for computing gradients

In summary, the conversation discussed the concept of finding gradients for scalar functions u = u(x) and provided examples for u(x) = (x, y, z), u(x) = (y, z, x), and u(x) = (x^2y, 10, z + x). The conversation also clarified the difference between scalar and vector functions, with scalar functions having a single number as the output and vector functions having a vector as the output. The conversation also mentioned the use of Jacobian matrices for vector functions.
  • #1
timsea81
89
1

Homework Statement



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)

Homework 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?

The Attempt at a Solution

 
Last edited:
Physics news on Phys.org
  • #2
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)
grad u(x) = (1,1,1)

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

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

?
 
  • #3
timsea81 said:
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.
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.
timsea81 said:
So is it
u(x) = (x, y, z)
grad u(x) = (1,1,1)

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

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

?
 
  • #4
Mark44 said:
Another way to write this is
u(x) = xi + yj + zk, where the bolded letters on the right are unit vectors.

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
Yes, what you have in post #2 looks OK, if you add the unit vectors.
 
  • #6
excellent, thanks for your help
 
  • #7
timsea81 said:
Consider scalar functions u = u(x).
u(x) = (x, y, z)
u(x) = (y, z, x)
u(x) = (x^2y, 10, z + x)
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:
In this way, the Jacobian generalizes the gradient of a scalar valued function of multiple variables which itself generalizes the derivative of a scalar-valued function of a scalar.
 
Last edited:
  • #8
Mark44 said:
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:

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
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.
 

What is the purpose of computing gradients in scientific research?

The purpose of computing gradients is to determine the rate of change of a function with respect to its parameters. This information is crucial in many scientific fields, such as machine learning, optimization, and physics, where understanding the behavior of a system is dependent on its underlying variables.

What notation is commonly used for computing gradients?

The most commonly used notation for computing gradients is the gradient symbol, denoted by the upside-down triangle (∇), followed by the function whose gradient is being calculated. For example, if we want to compute the gradient of a function f(x,y), we would write ∇f(x,y).

How do you calculate the gradient of a multivariate function?

To calculate the gradient of a multivariate function, we take the partial derivative of the function with respect to each of its independent variables. This results in a vector of partial derivatives, also known as the gradient vector, which represents the direction and magnitude of the steepest ascent of the function at a given point.

What is the difference between a gradient and a derivative?

A derivative is the rate of change of a single-variable function, while a gradient is the rate of change of a multivariate function. In other words, a derivative measures the slope of a curve at a specific point, while a gradient measures the slope of a surface at a specific point.

What are some common applications of computing gradients?

Computing gradients has many applications in scientific research, such as optimization algorithms, machine learning models, and physical systems. For example, gradient descent is a popular optimization technique that uses the gradient to find the minimum of a function, and backpropagation in neural networks uses the gradient to update the model's parameters during training. In physics, gradients are used to calculate the force and direction of a particle moving in a potential field.

Similar threads

  • Calculus and Beyond Homework Help
Replies
8
Views
452
  • Calculus and Beyond Homework Help
Replies
13
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
865
  • Calculus and Beyond Homework Help
Replies
1
Views
597
  • Calculus and Beyond Homework Help
Replies
26
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
913
  • Calculus and Beyond Homework Help
Replies
1
Views
913
  • Calculus and Beyond Homework Help
Replies
24
Views
3K
  • Calculus and Beyond Homework Help
Replies
11
Views
727
  • Calculus and Beyond Homework Help
Replies
3
Views
930
Back
Top