We want to obtain an formula for $p_i$ knowing that $p_i'=h_i$. Of course we use $$p_i(x)=p_i(x_0)+\int_{x_0}^x h_i(t)\,dt \tag1$$
where $x_0$ can be chosen as we wish (as long as we can find $p_i(x_0)$ easily). And we wish to choose $x_0$ to simplify integration: it's better not to have the transition point $\beta$ inside of the interval of integration.
So, when $x\in [\alpha,\beta)$, we pick $x_0=\alpha$ where $p_i(\alpha)=0$. But when $x\in [\beta,\gamma)$, we pick $x_0=\gamma$ where $p_i(\gamma)=\int_{\alpha}^\gamma h_i=0$. This simplifies integration: $p_i(x)=\int_{\gamma}^x -1\,dt = \gamma-x$.
When it comes to $q_i$, we have
$$q_i(x)=q_i(x_0)+\int_{x_0}^x p_i(t)\,dt \tag2$$
When $x\in [\alpha,\beta)$, we pick $x_0=\alpha$ where $q_i(\alpha)=0$. When $x\in [\beta,\gamma)$, we pick $x_0=\gamma$ where $q_i(\gamma)=\int_{\alpha}^\gamma p_i=\frac12((\alpha-\beta)^2+(\beta-\gamma)^2)$.
$p_i (x)$ = $\int_\gamma^x -1 \ dx =\gamma-x, for [\beta,\gamma)$,
$p_i (x)$=0 elsewhere
I understood these steps.
Now for $q_i (x)$
$q_i (x)$ = $\int_\alpha^x (x-\alpha) \ dx =(x-\alpha)^2 /2, for [\alpha,\beta)$,
$q_i (x)$ = $\int_\alpha^\beta (x-\alpha)+ \int_\beta^x (\gamma-x)\ dx =[(x-\alpha)^2 +(\gamma-x)^2-(\beta-\gamma)^2]/2, for [\beta,\gamma)$,
which is not same as calculated by the auther, means I am doing some mistake again in choosing the limits. – Intellectual_ Jun 27 '13 at 10:04
$q_i (x)$ = $\int_\alpha^\beta (x-\alpha)+ \int_\beta^\gamma (\gamma-x)\ dx + \int_\gamma^x (\gamma-x)\ dx=[(x-\alpha)^2 +(\gamma-x)^2+(\beta-\gamma)^2]/2, for [\gamma,1)$,
which is not same as required. please let me know where am I going wrong? – Intellectual_ Jun 27 '13 at 10:05