I am studying a variation of regression model called segmented regression. For a response variable $y$ and covariate $x$, it is set that the first $m$ values of $x$ are less than threshold $z$ and the remaining are greater than $z$. Null hypothesis sets that given $x$, the responses $y_i$ follow a simple linear model $\alpha+\beta x_i$. Alternative hypothesis sets that response $y_i$ follows this scheme: $$E(y_i|x_i)=\alpha+\beta x_i,(i=1,\ldots,m)$$ $$E(y_i|x_i)=\alpha+\beta x_i+\delta(x_i-z),(i=m+1,\ldots,n)$$ Where $\alpha,\beta,\delta$ are unknown. The goal of this formulation is showing that expected response given $x$ does not change at $z$ but the slope $\beta$ does. I have tried to arrange the expectations in normal equations but I got large chains of values and I do not know how to show this. Could you please help me how to adress this question.