# Question on differentiation.

1. Oct 26, 2013

### yungman

$r^2=x^2+y^2\;\Rightarrow \; 2r\frac{dr}{dx}=2x\;\Rightarrow\; \frac{dr}{dx}=\frac{x}{r}$

Then is it true $\frac{dx}{dr}=\frac{r}{x}$?

I am not sure this is correct as
$$r^2=x^2+y^2\;\Rightarrow \; 2r=2x\frac{dx}{dr}+2y\frac{dy}{dr}$$

2. Oct 26, 2013

### UltrafastPED

If you take the differential of both sides you get:

2r dr = 2x dx + 2y dy which can be rewritten as:

dr = x/r dx + y/r dy

Converting this to derivative form we get:

dr/dx = x/r + y/r dy/dx

dr/dy = x/r dx/dy + y/r

So your first result is missing the dependence of y upon x.

3. Oct 26, 2013

### yungman

I forgot to say this is x,y coordinates and r is the radius. So x and y are independent.

4. Oct 26, 2013

### UltrafastPED

Are they? You seem to have created a functional relationship between them! It looks like a circle to me, but with a variable radius.

Perhaps you could describe the meaning of your starting equation, and what you are planning to accomplish.

5. Oct 27, 2013

### yungman

This is just polar coordinates where $r^2=x^2+y^2$. So x and y are independent variables.

So, from what you show:$2rdr=2xdx+2ydy$
$$\Rightarrow\; 2r=2x\frac{dx}{dr}+2y\frac{dy}{dr}$$
$$\Rightarrow\;\frac{dx}{dr}=\frac{r}{z}-\frac{y}{x}\frac{dy}{dr}$$

$$2rdr=2xdx+2ydy\;\Rightarrow r\frac{dr}{dx}=2x+2y\frac{dy}{dx}=2x\;\Rightarrow\;\frac{dr}{dx}=\frac {x}{r}$$
BUT
$$\frac{dx}{dr}\neq\frac{r}{x}$$

Am I correct?

6. Oct 27, 2013

### UltrafastPED

But x = r cos(theta), y = r sin(theta) ... you have not included these relationships!

Thus x and y are no longer independent ... try plugging these into the differential dr = x/r dx + y/r dy, and see what you get.

7. Oct 27, 2013

### yungman

I am confused. This is the second questionable thing in this book. I have a questionable formula of this book in another thread right now!!! Here is the scanned page of what I have been asking:

#### Attached Files:

• ###### PDE2.jpg
File size:
34.2 KB
Views:
63
8. Oct 27, 2013

### vanhees71

What's the problem with the scanned page, except the equation
$$\theta=\arctan(y/x),$$
which has to be used with very much care. Better is (for $y \neq 0$)
$$\theta=\mathrm{sign} y \arccos \left(\frac{x}{\sqrt{x^2+y^2}} \right )$$
For $y=0$ you can set
$$\theta=\begin{cases} 0 & \text{for} \quad x=r>0,\\ \pi &\text{for} \quad x=-r<0. \end{cases}$$
The polar coordinates are indetermined at the origin (coordinate singularity).

So, what is considered here is the transformation between cartesian and polar coordinates of the Euclidean plane,
$$x=r \cos \theta, \quad y=r \sin \theta.$$
It's also important to distinguish partial and total derivatives. You have to decide which two variables you take as the independent ones, i.e., $\frac{\partial}{\partial x} \equiv \partial_x$ means to take the partial derivative with respect to $x$ while $y$ is kept constant, i.e., indeed
$$r=\sqrt{x^2+y^2} \; \Rightarrow \; \partial_x r=\frac{x}{\sqrt{x^2+y^2}}=\frac{x}{r}$$
etc.
For $\theta$ I'd rather use
$$\cos \theta=\frac{x}{r}.$$
Then you get
$$-\sin \theta \partial_x \theta=\frac{1}{r}-\frac{x}{r^2} \partial_x r=\frac{1}{r}-\frac{x^2}{r^3}=\frac{r^2-x^2}{r^3}=\frac{y^2}{r^3}=\frac{r^2 \sin^2 \theta}{r^3}.$$
From this
$$\partial_x \theta = -\frac{y}{r^2},$$
etc.

I've not checked the other formulae from your book, but at least these to examples are perfectly fine.

9. Oct 27, 2013

### UltrafastPED

You can type ∂ instead of d by using the Quick Symbols of Advance editing mode.

This certainly makes a difference in how to interpret a statement!

10. Oct 27, 2013

### yungman

Yes, my bad to use "d" instead of $\partial$.

So $\frac{\partial y}{\partial x}=0$?

So back to my original question:

$r^2=x^2+y^2\;\Rightarrow \; 2r\frac{\partial r}{\partial x}=2x\;\Rightarrow\; \frac{\partial r}{\partial x}=\frac{x}{r}$

Then is it true $\frac{\partial x}{\partial r}=\frac{r}{x}$?

I am not sure this is correct as
$$r^2=x^2+y^2\;\Rightarrow \; 2r=2x\frac{\partial x}{\partial r}+2y\frac{\partial y}{\partial r}$$

Can I look at it this way, $x=r\cos\theta$
$$\frac{\partial x}{\partial r}=\frac{\partial (r\cos\theta)}{\partial r}=\cos\theta= \frac {x}{r}$$

But then
$$\frac{\partial x}{\partial r}=\frac{\partial r}{\partial x}$$

I am confused.

Last edited: Oct 27, 2013
11. Oct 27, 2013

### UltrafastPED

Yes.

Yes.

See this old thread on Reciprocals of Derivatives:

12. Oct 27, 2013

### yungman

13. Oct 27, 2013

### UltrafastPED

For an analysis of the above, refer to the link given above ...

14. Oct 28, 2013

### yungman

I see that
$$\frac{\partial x}{\partial r}=\frac{1}{\left(\frac{\partial r}{\partial x}\right)}$$

So back to my original question:

$$r^2=x^2+y^2\;\Rightarrow \; 2r\frac{\partial r}{\partial x}=2x\;\Rightarrow\; \frac{\partial r}{\partial x}=\frac{x}{r}$$
$$\Rightarrow\;\frac{\partial x}{\partial r}=\frac{1}{\left(\frac{x}{r}\right)}=\frac{r}{x}$$

But if I let $x=r\cos\theta$
$$\frac{\partial x}{\partial r}=\frac{\partial (r\cos\theta)}{\partial r}=\cos\theta= \frac {x}{r}$$

15. Oct 28, 2013

### yungman

On top of the above question. Let's put in some real numbers. Let $\theta=60^0$
$$\Rightarrow \; \frac {r}{x}=\frac{1}{\cos 60}=2$$
This also to every change of x, the r change twice as much.
$$\Rightarrow\; \frac{\partial r}{\partial x}=\frac {r}{x}=2$$
and also, to every change of r, x only change half as much.
$$\Rightarrow \; \frac{\partial x}{\partial r}=\frac {x}{r}=0.5$$

but from the last post,

$$\Rightarrow\; \frac{\partial r}{\partial x}=\frac {x}{r}=\frac {1}{2}$$
and according to $\frac{\partial x}{\partial r}=\frac {1}{ \left(\frac{\partial r}{\partial x}\right)}$
$$\frac{\partial x}{\partial r}=\frac{r}{x}=2$$

The two is opposite. It just does not make sense.

16. Oct 28, 2013

### UltrafastPED

17. Oct 28, 2013

### D H

Staff Emeritus
No! It's a mistake to think of $\frac{\partial x}{\partial r}$ and $\frac{\partial r}{\partial x}$ as fractions. If they were fractions, then the product $\frac{\partial x}{\partial r}\frac{\partial r}{\partial x}$ would be one. But this is not true. Instead, with these variables $\frac{\partial x}{\partial r}\frac{\partial r}{\partial x} = \cos^2\theta = \bigl(\frac x r\bigr)^2$.

18. Oct 28, 2013

### vanhees71

That cannot be true! You again forgot that for any partial derivative you must tell which other variable is hold fixed. In the context of coordinate transformations you consider either the pair $(x,y)$ or the pair $(r,\theta)$ as independent variables, i.e., the expression $\partial r/\partial x$ means that you take the derivative of $r$ with respect to $x$ at a fixed value of $y$, while $\partial x/\partial r$ is the derivative of $x$ wrt. $r$ at a fixed value of $\theta$.

It may become more clear for you, when you think about the geometric meaning either fixing $y$ and varying $x$ or fixing $\theta$ and varying $r$ at a given point on the plane. You'll see that you get completely different curves (coordinate lines) or even tangent vectors on that coordinate lines!

19. Oct 28, 2013

### D H

Staff Emeritus
I don't know if you were addressing me or yungman, vanhees71.

This is very important, particularly if it's not clear from context. In this case it is better to write $\frac{\partial r}{\partial x}$ as $\left.\frac{\partial r}{\partial x}\right|_y$ and $\frac{\partial x}{\partial r}$ as $\left.\frac{\partial x}{\partial r}\right|_{\theta}$.

20. Oct 28, 2013

### yungman

Thanks, this really help. This answer a lot of my question. The normal Calculus III books do not get into this and the PDE book take for granted people should know this. I bet the instructor must go through this in class, problem is I am a self studier and never really link it up this good. But I still have question, I'm going to ask in a separate post.

Thanks