Partial derivative in polar coordinates I'm following a proof where they define in polar coordinates
$$\ v(r, \theta) = a(r\cos\theta, r\sin\theta) 
\quad\text{where}\quad a \in C^\infty(B, \Bbb R)$$
Then we have
$$\ v_r = a_x\cos\theta + a_y\sin\theta,$$
$$\ v_\theta = -a_xr\sin\theta + a_yr\cos\theta$$
I'm not sure how we got here. What I got was 
$$\ v_r =  (a_rr\cos\theta + a\cos\theta, a_rr\sin\theta + a\sin\theta)$$ by chain rule.
With $$\ a_r = a_xx_r + a_yy_r = a_x\cos\theta + a_y\sin\theta $$
So I end up with a vector valued function while they have a scalar. Where did I go wrong?
 A: I cannot add a comment due to low reputation, so, I'll write this as an answer.
What they did was just writing arguments of the function explicitly in brackets.
Let's follow the example $v(r, \theta) = r \cos (\theta)$. When you change your basis to $x = r \cos(\theta), y = r\sin(\theta)$, you get a new function $a(x, y)= a(r \cos(\theta), r \sin(\theta)) = x$. Then you shall just use the formulae for $x_r$, $x_\theta$, $y_r$, $y_\theta$, which you seem to know.
A: It is very unclear what you mean by
$$\ v_r =  (a_rr\cos\theta + a\cos\theta, a_rr\sin\theta + a\sin\theta)$$
There is a red flag here as the left hand side is a scalar, and the right hand side is not. Hopefully the following makes more sense to you.
If we take the derivative with respect to $r$ of$$v(r, \theta) = a(r\cos\theta, r\sin\theta)$$
On the left side we clearly get $v_r$, and on the right side, if we call the partial derivatives of $a(x,y)$, $a_x$ and $a_y$, we get by the chain rule
$$\frac{d a}{dr} = \frac{d a}{ dx} \cdot \frac{d x}{dr} + \frac{d a}{dy} \cdot \frac{d y}{ dr}$$
$$v_r =a_x \cdot\left(\frac{d}{dr}r\cos\theta\right) +a_y \cdot\left(\frac{d}{dr} r\sin\theta\right) = a_x\cos\theta+a_y\sin\theta$$
