Derivative with respect to a unit vector: is my computation right?

In summary, the author is looking for a way to invert a partial derivative. They found that the polar to cartesian functions are explicitly defining x,y in terms of r,θ but if they regard x,y as the independent variables, they are implicitly defining r,θ. The author has decided they want x,y to be independent and r,θ will be the functions they are after. They will use the Jacobian to compute the inverted partials.
  • #1
fairy._.queen
47
0
Hi all!
I must compute a derivative with respect to the components of a unit vector [itex]\hat{p}^{i}[/itex]. In spherical coordinates,
[itex]\hat{p}^{1}=\hat{p}^{1}(\theta,\phi)=\cos\theta \sin\phi[/itex]

I want to express the derivative [itex]\frac{\partial}{\partial\hat{p}^1}[/itex] as a combination of [itex]\frac{\partial}{\partial\theta}[/itex] and [itex]\frac{\partial}{\partial\phi}[/itex].
What I did is:
[itex]\frac{\partial f}{\partial\hat{p}^1}=\frac{\partial f}{\partial\theta}\frac{\partial\theta}{\partial \hat{p}^1}+\frac{\partial f}{\partial\phi}\frac{\partial\phi}{\partial\hat{p}^1}[/itex]

Since [itex]\frac{\partial\hat{p}^1}{\partial\theta}=-\sin\theta\sin\phi[/itex] and [itex]\frac{\partial\hat{p}^i}{\partial\phi}=\cos\theta \cos\phi[/itex] I thought
[itex]\frac{\partial\theta}{\partial\hat{p}^1}=-\frac{1}{\sin\theta\sin\phi}[/itex] and [itex]\frac{\partial\phi}{\partial\hat{p}^1}=\frac{1}{ \cos\theta\cos\phi}[/itex]

so that the final derivative is
[itex]\frac{\partial f}{\partial\hat{p}^1}=-\frac{1}{\sin\theta\sin\phi}\frac{\partial f}{\partial\theta}+\frac{1}{\cos\theta\cos\phi} \frac{\partial f}{\partial\phi}[/itex]

I would like to know if all this is correct. Thanks in advance!
 
Physics news on Phys.org
  • #2
Anybody?
 
  • #3
Your unit vector looks like a scalar with magnitude that isn't 1. It could be I am not familiar with the notation.

But what I spotted was the inverting of a partial derivative. In functions of one variable, it is valid to invert dy/dx to get dx/dy but this is not generally true of partial differentials. Lookup Jacobians to find out how to do it.
 
  • #4
Thanks for replying!

[itex]\hat{p}^1[/itex] is the first component of a unit vector, the other two are
[itex]\hat{p}^2=\sin\theta\sin\phi[/itex]
[itex]\hat{p}^3=\cos\phi[/itex]

Could you please explain further what you mean by looking up the Jacobian to find out how to invert partial derivatives?
Thanks again!
 
  • #5
fairy._.queen said:
Could you please explain further what you mean by looking up the Jacobian to find out how to invert partial derivatives?
Thanks again!

I saw above you did ∂p/∂θ => ∂θ/∂p . This is not true.

Just for an easy example, consider cartesian and polar in 2d. We have this:

x=r cosθ
y=r sinθ

This tells how to convert from polar to cartesian coordinates and we can use these functions to find all partial derivatives of x or y with respect to r,θ in a straightforward manner. Finding partials of r,θ with respect to x,y would involve first solving for r,θ in terms of x,y and then taking the partials.

Let's do one.

∂x/∂r = cosθ

r=√(x2+y2)
∂r/∂x = x/√(x2+y2) = cosθ
(above I used tanθ = y/x)

Notice ∂x/∂r ≠ (∂r/∂x)-1


So the intuitive guess didn't work, take a closer look at what is happening. The polar to cartesian functions are explicitly defining x,y in terms of r,θ but if we regard x,y as the independent variables, they are also implicity defining r,θ. So rewrite the equations like so:

f1(x,y,r(x,y),θ(x,y)) = 0 = x -rcosθ
f2(x,y,r(x,y),θ(x,y)) = 0 = y -rsinθ

I have decided I want x,y to be independent and r,θ will be the functions I am after; this is like solving the above equations for r,θ in terms of x,y as I did with r=√(x2+y2)

I'm after ∂r/∂x so let's take partial derivatives of those two equations wrt x:

∂f1/∂x = 1 + rsinθ ∂θ/∂x - cosθ ∂r/∂x = 0
∂f2/∂x = -rcosθ ∂θ/∂x - sinθ ∂r/∂x = 0

Arrange this into a matrix with ∂θ/∂x and ∂r/∂x being the unknowns and solve for ∂r/∂x using Cramer's Rule. You'll find ∂r/∂x = cosθ


This prodecure can be generalized and the matrix you get (as I found above) is called the Jacobian. You can then use the Jacobian to compute the inverted partials.
 
  • #6
Thank you very much!
 

FAQ: Derivative with respect to a unit vector: is my computation right?

1. What is a unit vector and why is it important in computing derivatives?

A unit vector is a vector with a magnitude of 1, which is used to represent direction in a coordinate system. In computing derivatives, unit vectors are important because they help to define the direction in which the derivative is being taken, allowing for a more accurate calculation of the rate of change.

2. How do I compute a derivative with respect to a unit vector?

To compute a derivative with respect to a unit vector, you can use the chain rule. This involves taking the derivative of the function with respect to the components of the unit vector, and then multiplying it by the corresponding component of the unit vector.

3. Can I use any unit vector to compute a derivative?

No, the unit vector chosen must be in the direction of the derivative being taken. If the unit vector is not in the direction of the derivative, the result will not be accurate.

4. Is there a difference between computing a derivative with respect to a unit vector and a regular derivative?

Yes, there is a difference. When computing a derivative with respect to a unit vector, you are calculating the rate of change in a specific direction, whereas a regular derivative calculates the overall rate of change.

5. How do I know if my computation of a derivative with respect to a unit vector is correct?

You can check your computation by comparing it to previous calculations or by using mathematical software to verify the result. Additionally, you can also check if the unit vector is in the direction of the derivative being taken, as this is a crucial factor in computing an accurate result.

Back
Top