I am currently working through some past exercises in polar coordinates $(r, \theta)$ and want to take the derivative of $r$ with respect to $x$, but I have hit a bit of a brick wall:

a) $x = r\cos(\theta)$


b) $r = \sqrt{x^2 +y^2}$,

right? How come then if I solve a) for $r$ and take $d/dx$ I get $\sec(\theta)$ but if I take b) $d/dx$ I get $\cos(\theta)$ ??? Can anybody help me out here, I have probably made some glaringly silly mistake that I am a bit too frustrated to see right now.

Sorry for not formatting the equations, I'm rather new to this forum and maths in general, so I would also really appreciate an answer that doesn't presume much more experience than Calc 1 or 2. Thanks in advance! :)

  • $\begingroup$ what do you mean by "I solve a) for r and take d/dx " ? $\endgroup$
    – Surb
    Oct 6 at 16:09
  • $\begingroup$ I mean to say x = rcos(theta) -> r = x/cos(theta), and then I take the derivative of r with respect to x. My bad if I wasn't clear enough about that. $\endgroup$ Oct 6 at 16:15
  • $\begingroup$ Can you update your question to show your work? $\endgroup$
    – DMcMor
    Oct 6 at 16:21
  • $\begingroup$ $\cos\theta = \frac{x}{\sqrt{x^2+y^2}}$ So the way you are finding $\partial_x r$ using $x = r \cos\theta$ is not correct. $\endgroup$
    – Math Lover
    Oct 6 at 16:32

The issue here, as I understand your question, is that you are forgetting that $\theta$ also depends on $x$ via $\theta = \arctan(y/x)$ for $x > 0$ (a similar argument will work for other cases). Here, then, we have $$\frac{d\theta}{dx} = \frac{1}{1+\left(\frac{y}{x}\right)^2}\cdot \frac{-y}{x^2} = -\frac{y}{x^2 + y^2} = -\frac{r\sin(\theta)}{r^2} = -\frac{\sin(\theta)}{r}.$$ So, differentiating $r = \frac{x}{\cos(\theta)}$ gives us \begin{align*}\frac{dr}{dx} &= \frac{\cos(\theta) + x\sin(\theta)\frac{d\theta}{dx}}{\cos^{2}(x)}\\ &= \frac{\cos(\theta) - x\sin(\theta)\frac{\sin(\theta)}{r}}{\cos^{2}(x)}\\ &= \frac{\cos(\theta) - x\sin(\theta)\frac{\sin(\theta)}{r}}{\cos^{2}(x)}\\ &= \frac{\cos(\theta) - r\cos(\theta)\sin(\theta)\frac{\sin(\theta)}{r}}{\cos^{2}(x)}\\ &=\frac{\cos(\theta)(1 - \sin^{2}(\theta))}{\cos^{2}(\theta)}\\ &=\frac{\cos(\theta)\cos^{2}(\theta)}{\cos^{2}(\theta)}\\ &=\cos(\theta). \end{align*} That matches with what you got in the second approach.

  • 1
    $\begingroup$ Thanks a million, your response has been super helpful! I see now what I did wrong. $\endgroup$ Oct 6 at 16:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.