Suppose I have the map $R^2\rightarrow R^3, (x,y)\mapsto (\cos x, \cos y, \sin y)$ and I want to compute the Jacobian matrix of the restriction of this map to $y=ax+b$, i.e., $(x,ax+b)\mapsto (\cos x, \cos (ax+b), \sin (ax+b))$. How do I do it? How to differentiate with respect to the variable $ax+b$?
Just compute the composition of the two maps.
The restriction is given by the map $\mathbb R \to \mathbb R^2$ defined by $x \mapsto (x,ax+b)$.
Then the composition is given by $$ x \mapsto (x,ax+b) \mapsto \left(\cos x , \cos (ax+b), \sin(ax+b)\right). $$