Gradient of spherical co-ords/ differentiation help

Click For Summary

Homework Help Overview

The discussion revolves around finding the gradient of a function expressed in spherical coordinates, specifically the function h(sph)=exp(r²sin²(θ)sin²(φ)+r²cos²(θ)). Participants are exploring the differentiation with respect to the angle φ and questioning why certain derivatives yield zero in their calculations.

Discussion Character

  • Exploratory, Assumption checking, Conceptual clarification

Approaches and Questions Raised

  • Participants are attempting to differentiate the function with respect to φ and are confused by the output from Maple, which indicates that the derivative equals zero. They are questioning the conventions used for the angles θ and φ in their calculations and how these might affect the results.

Discussion Status

The discussion is active, with participants sharing their attempts at differentiation and expressing confusion over the conventions of spherical coordinates. Some have suggested that the issue may lie in the definitions of θ and φ as used in their resources versus those used by Maple. There is a recognition of the need to clarify these conventions to resolve the discrepancies in their results.

Contextual Notes

Participants mention that their homework requires them to work in spherical coordinates, and there is a discussion about the definitions of r, θ, and φ as provided in their textbook. The potential for differing conventions between mathematical and physics contexts is also highlighted.

fredrick08
Messages
374
Reaction score
0

Homework Statement


h(sph)=exp(r2sin2([tex]\theta[/tex])sin2([tex]\phi[/tex])+r2cos2([tex]\theta[/tex]))

need to find gradient of this function, i have er and etheta... but can someone please tel me why when maple differentiates with respect to phi, why does it say it equals zero?

coz i get (2r2sin2([tex]\theta[/tex])sin([tex]\phi[/tex])cos([tex]\phi[/tex])*h)ephi

it probably some trig identity... can someone please help. ty
 
Last edited:
Physics news on Phys.org
MY ORIGINAL cartesian function was h(x,y,z)=exp(y2+z2) then i converted it... i know once i get dh/dphi i have to multiply it by 1/rsin(theta) but maple says that dh/dphi=0? how can that be since dh/dtheta works?
 
if anyone doesn't know I am trying to find dh/dphi... to get (1/rsin(theta))(dh/dphi)... and apparently it equals 0... and i can't found out y...
 
I think the problem lies with what [itex]\theta[/itex] and [itex]\phi[/itex] are. In physics the azimuth and zenith are often reversed. So what convention does your book use? In this case differentiation with respect to [itex]\phi[/itex] does not yield 0 where as differentiation with respect to [itex]\theta[/itex] does yield 0. So I am pretty sure you're using the wrong convention.

Secondly why do you even bother to transform that function into spherical coordinates?
 
Last edited:
i don't know, its what my homework said sheet said to do...

and my book states that r=root(x^2+y^2+z^2) theta=arccos(z/r) and phi=arctan(y/x)... something like that?? sorry I am unsure what you mean by convention... and what do mean the diff with respect to theta equals 0? how did you get that?
 
and the gradh in cart co-ords is (0,2y*exp(y^2+z^2),2z*exp(y^2+z^2)) can just apply spherical co-ords straight from gradh?
 
There are two different conventions.

1) The mathematics convention where the azimuth, the angle between the x-axis and the radius in the x-y plane, is called [itex]\theta[/itex] and the zenith, the angle between the z axis and the radius is called [itex]\phi[/itex]

2)The physics convention where the azimuth, the angle between the x-axis and the radius in the x-y plane, is called [itex]\phi[/itex] and the zenith, the angle between the z axis and the radius is called [itex]\theta[/itex]

Read this carefully, draw a picture perhaps so that you fully understand the difference.

The definition in your book has [itex]\theta[/itex] as the zenith. Where as seeing as maple gives 0, has [itex]\phi[/itex] as the zenith. Do you understand why maple gets zero and you get a non-zero value now?

Write down the definition of the gradient in spherical coordinates (on the forum) and label each term with, radius, zenith, azimuth. Since you want to find the [itex]\phi[/itex] term you will need to use which term in the definition of the gradient given the convention used in the book? Since maple uses the other convention which term did maple use?

And no you can't just apply spherical coordinates straight after taking the Cartesian gradient.
 
ok then this is for maths, and r is length, theta is angle measured down form z axis, and phi is angle measured from x axis. ok i think i understand, what you are saying but if maple is opposite to my book, then does that mean that etheta is 0?? then definition of grad in sperical in my book is

f(r,[tex]\theta[/tex],[tex]\phi[/tex]) then graf=([tex]\partial[/tex]f/[tex]\partial[/tex]r)er+(1/r)([tex]\partial[/tex]f/[tex]\partial[/tex][tex]\theta[/tex])etheta+(1/r*sin[tex]\theta[/tex])([tex]\partial[/tex]f/[tex]\partial[/tex][tex]\phi[/tex])ephi

does that help?
 
so will my answer have a zero? or is just rigth to do what i did... or how do u change maple to do what i want?
 
  • #10
Even though this may be for maths the convention your book uses is the convention I labeled the physics convention. It doesn't really matter though feel free to call it anything you want as long as you always pay attention to how [itex]\phi[/itex] and [itex]\theta[/itex] are defined. This way you can use the appropriate convention.

So the gradient your book gives you is:

[tex]\nabla f=\frac{\partial f}{\partial r}e_r+\frac{1}{r} \frac{\partial f}{\partial \theta}e_\theta+\frac{1}{r \sin \theta} \frac{\partial f}{\partial \phi}e_\phi[/tex]

maple:
[tex]\nabla f=\frac{\partial f}{\partial r}e_r+\frac{1}{r} \frac{\partial f}{\partial \phi}e_\phi+\frac{1}{r \sin \phi} \frac{\partial f}{\partial \theta}e_\theta[/tex]

So if you want to know the [itex]\phi[/itex] component then you have to use the the [itex]\theta[/itex] component in maple while also switching all [itex]\theta s[/itex] and [itex]\phi s[/itex] in the definitions of x,y,z in spherical coordinates. Nice and confusing isn't it?

Just calculate all three terms and I will check if you got the correct answer or not.

I would really suggest you do it by hand instead of using some function in a program you don't now its definition of.
 
Last edited:
  • #11
ok yes, well for etheta i get

((2r2sin[tex]\theta[/tex]sin2[tex]\phi[/tex]cos[tex]\theta[/tex])-2r2cos[tex]\theta[/tex]sin[tex]\theta[/tex]*h)/r? which does not equal zero?
 
  • #12
I made an error in the last sentence of my previous post. I will fix it. If you include the exponent your answer is the correct one. You can simplify it a bit if you like.
 
Last edited:
  • #13
so all three should be...

(2rsin2[tex]\theta[/tex]sin2[tex]\phi[/tex]+2rcos2[tex]\theta[/tex])exp(...)er

((2r2sin[tex]\theta[/tex]sin2sin[tex]\phi[/tex]cos[tex]\theta[/tex]-2r2cos[tex]\theta[/tex]sin[tex]\theta[/tex])/r)exp(...)etheta

((2r2sin2[tex]\theta[/tex]sin[tex]\phi[/tex]cos[tex]\theta[/tex])/(rsin[tex]\theta[/tex]))exp(...)ephi


? idk, just doesn't look right
 
  • #14
In the third one the cosine should read [itex]\cos \phi[/itex]. The others seem correct. Try to simplify the second one by using [itex]\sin 2x=2 \sin x \cos x[/itex] and [itex]\sin^2x+\cos^2x=1[/itex].
 
  • #15
ok ty heaps for ur help = ) very much appreciated
 

Similar threads

Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 26 ·
Replies
26
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
Replies
7
Views
21K
  • · Replies 3 ·
Replies
3
Views
10K
  • · Replies 5 ·
Replies
5
Views
2K