Understanding gradient concept

In summary, the different answers to the problem may be due to the different directions that the derivatives were taken in.
  • #1
PainterGuy
940
70
<Moderator's note: Moved from a technical forum and thus no template.>

Hi

I was trying to understand the concept of gradient. I'm using Thomas's Calculus 12th Ed.

Please have a look here. Using the Definition 1, the answer came to be 3.54.

Then, I tried to attempt the same problem using Theorem 1 shown here. My attempt is shown below and the answer is 4.123. For some reason there are few mistakes in my code. For clarity you can refer to this image too.

I'm getting different answers using Definition 1 and Theorem 1. In my opinion, the answers should have been the same. Could you please guide me? Thank you.

##f(x,y)=z=x^{2}+(x\cdot y)##

##\frac{\partial z}{\partial x}=2x+y##

##\frac{\partial z}{\partial y}=x##

##\nabla f=\frac{\partial z}{\partial x}i+\frac{\partial z}{\partial y}j##

##\nabla f=\left( 2x+y\right) i+\left( x\right) j##

At point ##P_{0}=(1,2)##

##\nabla f=\left( 2x+y\right) i+\left( x\right) j=\left[ 2(1)+2\right] i+j=4i+j##

##\left( \frac{df}{ds}\right) _{u,P_{0}}=\left( \nabla f\right) _{P_{0}}\cdot u =\left\Vert \nabla f\right\Vert \left\Vert u\right\Vert \cos \theta ##

Unit vector in the direction ##4i+j##:

##\frac{4i}{4.123}+\frac{j}{4.123}=0.97i+0.243j##

##\left\Vert \nabla f\right\Vert \left\Vert u\right\Vert \cos \theta =0.97(4)+0.243(1)=3.88+0.243=4.123##

##\left( 4i+j\right) \left( \frac{1}{\root{2}\of{2}}i+\frac{1}{\root{2}\of{2}}j\right) =2.83+0.707=3.54##
 

Attachments

  • grad11.jpg
    grad11.jpg
    32.5 KB · Views: 619
  • grad22.jpg
    grad22.jpg
    14.4 KB · Views: 522
  • grad33.jpg
    grad33.jpg
    25.4 KB · Views: 550
Last edited by a moderator:
Physics news on Phys.org
  • #2
Your Tex is unreadable, but anyway, why are you making a unit vector out of 4i + j? The unit vector u is made from i + j.
 
  • Like
Likes Orodruin
  • #3
Why are you surprised that you get different directional derivatives when using different directions?
 
  • #4
Thank you.

There is only error in my code and that is \QTRbfu. I was just trying to boldface unit vector u. I also attached a copy of my code in a picture form so that there is no confusion. Please check the attachment grad33.

LCKurtz said:
why are you making a unit vector out of 4i + j? The unit vector u is made from i + j.

According to Theorem 9 the unit vector should be in the direction of ∇f and ∇f=4i + j.

Orodruin said:
Why are you surprised that you get different directional derivatives when using different directions?

I think that I understand it now. Definition 1 is for a directional derivative but Theorem 9 is particularly about gradient always points in the direction of maximum increase. The unit vector 1/√2 i + 1/√2 j does not point in the direction of maximum increase or in the direction of 4i + j. Please let me know that if I'm wrong.

Thanks a lot for your help.
 
  • #5
LaTeX code corrected.
 
  • #6
PainterGuy said:
According to Theorem 9 the unit vector should be in the direction of ∇f and ∇f=4i + j.
No, there is nothing in the theorem that states this.
 
  • #7
PainterGuy said:
The unit vector 1/√2 i + 1/√2 j does not point in the direction of maximum increase or in the direction of 4i + j.
There is nothing in the theorem you quote that restricts the derivative to the maximal increase. It is a theorem about the relation between the directional derivative in an arbitrary direction and the gradient.
 
  • #8
Thank you. I might have misinterpreted it. But to get maximum increase, you need a unit vector in the direction of 4i+j because it gives you cos(theta)=0.

I was thinking that Definition 1 and Theorem 9 stand for the same thing. I think that they do mean the same thing. Theorem 9 will give you a maximum value only if unit vector is the direction of nabla(f).
 

Related to Understanding gradient concept

1. What is a gradient?

A gradient is a mathematical concept that represents the rate of change of a function with respect to one or more variables. It is often visualized as a slope or a vector that indicates the direction and magnitude of the change.

2. Why is understanding gradient important?

Understanding gradient is important because it is a fundamental concept in calculus and is used in many fields of science and engineering. It allows us to analyze and optimize functions, and is essential for understanding concepts such as derivatives and integrals.

3. How is gradient calculated?

The gradient is calculated by taking the partial derivatives of a multivariable function with respect to each of its variables. For example, if a function has two variables x and y, the gradient would be represented as (∂f/∂x, ∂f/∂y), where ∂ stands for "partial".

4. What is the relationship between gradient and slope?

The gradient and slope are related concepts, but they are not exactly the same. The gradient represents the rate of change of a function in any direction, while the slope only represents the rate of change in the vertical direction. However, when a function is plotted on a 2D graph, the gradient at any point is equal to the slope of the tangent line at that point.

5. How is gradient used in machine learning?

In machine learning, gradient descent is a popular optimization algorithm that uses the gradient to find the minimum of a function. This is important because many machine learning models involve optimizing a cost function to find the best parameters for the model. The gradient descent algorithm uses the gradient to update the parameters in the direction of steepest descent, gradually minimizing the cost function.

Similar threads

Back
Top