Find the derivative of $T$ where $T:\mathbb{R}^{d}\times \mathbb{R}\rightarrow \mathbb{R}$ given by $T(x,y):=(y-\beta^{t}x)^{2}.$ Let $\beta\in\mathbb{R}^{d}$, we consider of function $T:\mathbb{R}^{d}\times \mathbb{R}\rightarrow \mathbb{R}$  given by
$$T(x,y):=(y-\beta^{t}x)^{2}.$$
Find the derivative of $T$.
My attempt: If we consider $(h,g)\in \mathbb{R}^{d}\times \mathbb{R}$, we know that
$$T((x,y)+(h,g))=T(x,y)+T'(h,g)+R(h,g)$$
where $\frac{R(h,g)}{\left\|(h,g)\right\|}\rightarrow 0$ when $\left\|(h,g)\right\|\rightarrow 0$. In this sense, we have
$$T((x,y)+(h,g))=(y-\beta^{t}x)^{2}+2(y-\beta^{t}x)(g-\beta^{t}h)+(g-\beta^{t}h)^{2}.$$
 I have not been able to identify $T'$ and $R$.
 A: You are on the right track.  You have $$T((x,y)+(h,g))=(y−\beta^t x)^2+2(y−\beta^tx)(g−\beta^th)+(g−\beta^th)^2,$$ which contains the answer.  You expand the quadratic expression, and regroup into the form $T(x,y)$ plus something linear in $(h,g)$ plus higher order (in this case, quadratic) terms.  The linear part (linear in $h$ and $g$, mind you) is your $T'$ and the higher order terms is your $R$.  You should be able to take it from there.
A: The map is simply a composition of $f:\Bbb R^d\times\Bbb R\to\Bbb R,f(x,y)=y-\beta^tx$ and $g:\Bbb R\to\Bbb R,g(x)=x^2$. Apply chain rule.
A: We are looking for a linear fonction $\ell_{(x,y)}$ depending on $(x,y)$:
$$\mathbb{R}^{d}\times \mathbb{R}\rightarrow \mathbb{R}$$ 
In concrete terms, we are looking for a matrix $L_{(x,y)}$ which is $1 \times (d+1)$.
And here is how your identity can be re-organized in order to exhibit this matrix:
$$T((x,y)+(h,g))=T(x,y)+\underbrace{2\left((y-\beta^{t}x)\beta^{t},(y-\beta^{t}x)\right)}_{matrix L}\binom{h}{g}+\underbrace{(g-\beta^{t}h)^{2}}_{\text{terms of degree 2}}.$$
