In a STEP problem I found this: the vector "$\vec r$" is given as below ($a$ and $L$ are constants) and then it said to perform direct differentation to get the second equation.
$$\vec r = a (\sin \theta, \cos \theta) + (L−a\theta)(\cos \theta,− \sin \theta)$$
$$d\vec r = a d\theta (\cos \theta,-\sin \theta) - ad \theta (\cos \theta,-\sin \theta) + (L-a\theta)(-\sin \theta,-\cos\theta)d\theta$$
Would someone explain me what direct differentation means and how did we get the second equation (e.g. where does the second term in the second equation come from)?
Starting with the vector $\vec r$ given as
$$\vec r = a (\sin \theta, \cos \theta) + (L−a\theta)(\cos \theta,− \sin \theta)$$
we directly differentiate to obtain the differential $d\vec r$ as
$$d\vec r = a \frac{d}{d \theta}(\sin \theta, \cos \theta)d\theta + \frac{d}{d\theta}\left((L−a\theta)(\cos \theta,− \sin \theta)\right)d\theta$$
Now, we use the product rule to differentiate the second term. This gives
$$d\vec r = a \frac{d}{d \theta}(\sin \theta, \cos \theta)d\theta + \left(\frac{d(L−a\theta)}{d\theta}(\cos \theta,− \sin \theta)+(L−a\theta)\frac{d(\cos \theta,− \sin \theta)}{d\theta}\right)d\theta$$
Carrying out the derivatives gives
$$\begin{align} d\vec r &= a (\cos \theta, -\sin \theta)d\theta + (-a(\cos \theta,− \sin \theta))d\theta+(L−a\theta)(-\sin \theta,− \cos \theta))d\theta\\\\ &=(L−a\theta)(-\sin \theta,− \cos \theta))d\theta \end{align}$$