I am a first year undergraduate student planning to major in physics and I am taking a first year course in basic mathematics. We are currently studying partial differentiation.
While going through the course materials, there is something which I was not totally comfortable with.
We have a function $x = r\cos\theta$ where $x$, $r$, and $\theta$ are all variables with $x$ as the dependent variable. What we want to find is $\partial r/\partial x$ and $\partial\theta /\partial x$.
What the lecturer has done is to simply partially differentiate the entire thing with respect to $x$ itself:
$$x = r \cos\theta$$
$$\frac{\partial x}{\partial x}= \frac{\partial}{\partial x}(r\cos\theta)$$
This is where my problem arises. When we take a partial derivative don't we treat everything other than our differentiating variable as constant? Why do we end up with what's below?
$$1 = r\frac{\partial}{\partial x}(\cos\theta) + \cos\theta \frac{\partial r}{\partial x}$$
$$1 = -r\sin\theta\frac{\partial\theta}{\partial x} + \cos\theta\frac{\partial r}{\partial x}$$
Thank you in advance.