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$.
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.