[step:Derive the three-term recurrence with the correct boundary coefficients]
For each $j\geq 0$, the polynomial $t p_j(t)$ has degree $j+1$, so it has a unique expansion in the basis $p_0,\dots,p_{j+1}$. Orthogonality implies that all coefficients of $p_0,\dots,p_{j-2}$ vanish, because if $0\leq m\leq j-2$, then $t p_m(t)$ has degree at most $j-1$ and hence is a linear combination of $p_0,\dots,p_{j-1}$. Therefore
\begin{align*}
\int_I t p_j(t)p_m(t)w(t)\,d\mathcal{L}^1(t)=\int_I p_j(t)\bigl(t p_m(t)\bigr)w(t)\,d\mathcal{L}^1(t)=0.
\end{align*}
Thus there are [real numbers](/page/Real%20Numbers) $A_j,B_j,C_j$ such that
\begin{align*}
t p_j(t)=A_jp_{j+1}(t)+B_jp_j(t)+C_jp_{j-1}(t),
\end{align*}
where $p_{-1}$ denotes the zero polynomial and hence $C_0p_{-1}=0$.
Comparing leading coefficients gives
\begin{align*}
A_j=\frac{k_j}{k_{j+1}}.
\end{align*}
For $j\geq 1$, taking the [inner product](/page/Inner%20Product) of the recurrence with $p_{j-1}$ gives
\begin{align*}
C_jh_{j-1}=\int_I t p_j(t)p_{j-1}(t)w(t)\,d\mathcal{L}^1(t).
\end{align*}
By symmetry of multiplication by $t$ under this integral,
\begin{align*}
\int_I t p_j(t)p_{j-1}(t)w(t)\,d\mathcal{L}^1(t)=\int_I p_j(t)\bigl(t p_{j-1}(t)\bigr)w(t)\,d\mathcal{L}^1(t).
\end{align*}
The coefficient of $p_j$ in the expansion of $t p_{j-1}(t)$ is $k_{j-1}/k_j$, so orthogonality gives
\begin{align*}
\int_I p_j(t)\bigl(t p_{j-1}(t)\bigr)w(t)\,d\mathcal{L}^1(t)=\frac{k_{j-1}}{k_j}h_j.
\end{align*}
Hence, for $j\geq 1$,
\begin{align*}
C_j=\frac{k_{j-1}h_j}{k_jh_{j-1}}.
\end{align*}
Consequently, for every $j\geq 0$,
\begin{align*}
t p_j(t)=\frac{k_j}{k_{j+1}}p_{j+1}(t)+B_jp_j(t)+\frac{k_{j-1}h_j}{k_jh_{j-1}}p_{j-1}(t),
\end{align*}
with the last term interpreted as $0$ when $j=0$.
[/step]