I'm studying a recent article published by Autor et al. (QJE, 2024). The model is presented in Appendix, Section J. I'm working on solving the model, but I'm stuck at the final step, particularly with the aggregation. I hope you can help. Below is a brief summary of the model:
There are two sectors, producing skill-intensive and skill-non-intensive goods, $Y_s$ and $Y_u$, respectively. A representative household consumes both commodities according to \begin{equation} U(Y_u,Y_s) = Y_u^{\beta} Y_s^{1 - \beta} \end{equation} where $\beta \in (0,1)$, and $p_j$ denotes the price of good $j \in \{ u, s\}$. Let $P$ denote the ideal price index; and $P_u Y_u + P_s Y_s = P Y$. Let $Y$ be the numeraire so that $P \equiv 1$. Suppose there is no leisure and therefore the labor supply is inelastic.
Each sector produces a unique final output by combining a unit measure of tasks $i \in [N_{j-1},N_j]$:
\begin{equation} Y_j = \left[\int_{N_{j-1}}^{N_j} y_j(i)^{\frac{\sigma-1}{\sigma}} \, di \right]^{\frac{\sigma}{\sigma-1}} \end{equation}
where $y_j(i)$ is the output of task $i$ in sector $j$; $\sigma$ is the elasticity of substitution between tasks (assumed identical across sectors $j \in \{U, S\}$).
Each task is produced by combining a labor composite of high- and low-skill types, $n_j(i)$, or capital, $k_j(i)$, with a task-specific intermediate $q_j(i)$. The production function for task $i$ is given by:
\begin{equation} y_j(i) = \begin{cases} B_j q_j(i)^\eta k_j(i)^{1-\eta} & \text{if } i \in [N_j - 1, I_j] \\ B_j q_j(i)^\eta [\gamma_j(i) n_j(i)]^{1-\eta} & \text{if } i \in (I_j, N_j] \end{cases} \end{equation}
where $B_j \equiv \psi_j^\eta [1 - \eta]^{\eta-1} \eta^{-\eta}$ for notational convenience; the parameter $\eta \in (0, 1)$ is the share of output paid to intermediates; $\gamma_j(i)$ is the productivity of the labor composite $n_j(i)$ (relative to capital); and $I_j$ and $N_j$ are the equilibrium thresholds for automation and new task creation, respectively, meaning tasks from $N_j - 1$ to $I_j$ are produced by machines and those from $I_j$ to $N_j$ are produced by labor.
The key assumption is: $\gamma_j(i)$ is strictly increasing in $i$, meaning that labor has a comparative advantage in performing higher index (more complex) tasks.
The labor composite $ n_j(i) $ in each sector is a Cobb-Douglas combination of $H $ and $L$ - type labor: \begin{equation} n_j(i) = l_j(i)^{\alpha_j} h_j(i)^{1-\alpha_j}. \end{equation}
Let $L_U$, $L_S$, $H_U$, and $H_S$ be the equilibrium labor allocations to each sector. \begin{equation} L_U + L_S = L \quad \text{and} \quad H_U + H_S = H. \end{equation} The wage index $W_j$ is equal to \begin{equation} W_j \equiv \alpha^{-\alpha_j} (1 - \alpha_j)^{\alpha_j - 1} \cdot W_L^{\alpha_j} \cdot W_H^{1 - \alpha_j} \end{equation}
Finally, capital is sector-specific, with sectoral capital stocks $K_U$ and $K_S$ taken as given. The capital rental rate for sector-specific capital is denoted by $R_j$ for each sector $j \in \{U, S\}$. Since $\gamma_j(i)$ is strictly increasing in $i$, there exists a unique threshold $\tilde{I}_j$ in each sector such that: \begin{equation} \frac{W_j}{R_j} = \gamma_j (\tilde{I}_j) \label{threshold} \end{equation}
Tasks are competitively supplied, and the price of task $i$, $p_j(i)$, is \begin{equation} p_j(i) = \begin{cases} R_j^{1-\eta} & \text{if } i \in [N_j - 1, I_j] \\ \left( \frac{W_j}{\gamma_j(i)} \right)^{1-\eta} & \text{if } i \in (I_j, N_j] \end{cases} \label{price_intermediate} \end{equation}
The demand for sector task output, $y_j(i) $ reads \begin{equation} y_j(i) = \left( \frac{P_j}{p_j(i)} \right)^{\sigma} Y_j = \beta_j Y P_j^{\sigma-1} p_j(i)^{-\sigma} \label{demand_intermediate1} \end{equation}
The supply of $y_j(i)$ is a Cobb-Douglas aggregate of labor, capital, and intermediates. The sectoral demands for capital and labor for each task $i$ are as follows:
\begin{equation} k_j(i) = \begin{cases} [1 - \eta]\beta_j Y P_j^{\sigma-1} R_j^{-\hat{\sigma}} & \text{if } i \in [N_j - 1, I_j] \\ 0 & \text{if } i \in (I_j, N_j] \end{cases} \end{equation}
\begin{equation} n_j(i)= \begin{cases} 0 & \text{if } i \in [N_j - 1, I_j] \\ [1 - \eta]\beta_j Y_j P_j^{\sigma-1} \frac{1}{\gamma_j(i)} \left[ \frac{W_j}{\gamma_j(i)} \right]^{-\hat{\sigma}} & \text{if } i \in (I_j, N_j] \end{cases} \end{equation} with $\hat{\sigma} = 1 - (1 - \sigma)(1 - \eta)$.
The capital and labor markets clear in each sector, so that
\begin{equation} \int_{N_j - 1}^{I_j} [1 - \eta]\beta_j Y_j P_j^{\sigma - 1} R_j^{-\hat{\sigma}} \, di = K_j \label{clear_k} \end{equation}
\begin{equation} \int_{I_j}^{N_j} [1 - \eta]\beta_j Y_j P_j^{\sigma - 1} \frac{1}{\gamma_j(i)} \left[\frac{W_j}{\gamma_j(i)}\right]^{-\hat{\sigma}} \, di = \mathcal{L}_j \label{clear_l} \end{equation}
where $\mathcal{L}_U \equiv L_U^{\alpha_U} H_U^{1-\alpha_U}$ and $\mathcal{L}_S \equiv (L - L_U)^{\alpha_S} (H - H_U)^{1-\alpha_S}$.
Factor prices satisfy the following ideal price index condition: \begin{equation} P_j^{1-\sigma} = [I_j - N_j + 1] R_j^{1-\hat{\sigma}} + W_j^{1-\hat{\sigma}} \int_{I_j}^{N_j} \gamma_j(i)^{\hat{\sigma}-1} \, di \end{equation} Aggregate output reads: \begin{equation} (1 - \eta) Y_j = P_j^{\frac{\eta}{1- \eta }} \left[ \left( I_j - N_j + 1 \right)^{\frac{1}{\hat{\sigma}}} \left( K_j \right)^{\frac{\hat{\sigma} - 1}{\hat{\sigma}}} + \left( \mathcal{L}_j \right)^{\frac{\hat{\sigma} - 1}{\hat{\sigma}}} \left( \int_{N_j}^{I_j} \gamma_j(i)^{\hat{\sigma} - 1} \, di \right)^{\frac{1}{\hat{\sigma}}} \right]^{\frac{\hat{\sigma}}{\hat{\sigma} - 1}} \end{equation} where $\frac{\sigma - \hat{\sigma}}{\hat{\sigma} - 1} = \frac{\eta}{1- \eta }$.
Wage-bills must satisfy: \begin{align} W_{L}L_U &= \alpha_U s^{L}_{U} P_U Y_U = \alpha_U s^{L}_{U} \beta Y \\ W_{L}L_S &= \alpha_S s^{L}_{S} P_S Y_S = \alpha_S s^{L}_{S} (1- \beta) Y \\ W_{H}L_U &= (1-\alpha_U) s^{L}_{U} P_U Y_U = (1-\alpha_U) s^{L}_{U} \beta Y \\ W_{H}L_S &= (1-\alpha_S) s^{L}_{S} P_S Y_S = (1-\alpha_S) s^{L}_{S} (1- \beta) Y \end{align}
What I'm not able to derive are the labor shares. The article derives just one (4 in total) and I'm trying to derive it, i.e., the share of output in sector $j$ going to unskilled workers ($s^{L}_{j}$). Can you show me how to derive it: The labor share in sector ( j ) is given by: \begin{equation} s^{L}_{j} = \left[ 1 + \left( \frac{1 - \Gamma_j}{\Gamma_j} \right)^{\frac{1}{\sigma}} \left( \frac{K_j}{ \mathcal{L}_j} \right)^{\frac{\sigma - 1}{\sigma}} \right]^{-1} \label{l_share} \end{equation} with $\sigma$ the elasticity between tasks in goods production and \begin{equation} \Gamma_j \equiv \frac{\int_{N_j}^{I_j} \gamma_j(i)^{\sigma - 1} \, di}{\left[I_j - N_j + 1\right]^{\sigma - 1} + \int_{N_j}^{I_j} \gamma_j(i)^{\sigma - 1} \, di}. \end{equation}
My attempt (which does not match the paper's result): \begin{equation} \frac{\partial Y_j}{\partial L_j} = Y^{\frac{1}{\hat{\sigma}}} \alpha_j L_j^{\alpha_j - 1} H_j^{1 - \alpha_j} \left( \int_{I_j}^{N_j} \gamma(i)^{\hat{\sigma} - 1} \, di \right)^{\frac{1}{\hat{\sigma}}} = W_L. \end{equation}
Then, since $\mathcal{L} = L^{\alpha_j}_j H^{1-\alpha_j}_j$, \begin{equation} s^{L}_j = \frac{W_L L_j}{\alpha_j P_j Y_j} = \frac{\mathcal{L}_j \left( \int_{I_j}^{N_j} \gamma(i)^{\hat{\sigma} - 1} \, di \right)^{\frac{1}{\hat{\sigma}}}}{Y^{\frac{\hat{\sigma} - 1}{\hat{\sigma}}} P_j}, \end{equation} I eventually get \begin{equation} s^{L}_j = \frac{1}{\mathcal{L}^{-\frac{1}{\hat{\sigma}}}(1-\eta)^{- \frac{\hat{\sigma} - 1}{\hat{\sigma}}} P_j^{\frac{\hat{\sigma} - 1}{\hat{\sigma} (1-\eta)}} \left [\left( \frac{I_j - N_j + 1}{\int_{I_j}^{N_j} \gamma(i)^{\hat{\sigma} - 1} \, di} \right)^{\frac{1}{\hat{\sigma}}} \left( \frac{K_j}{\mathcal{L}_j} \right)^{\frac{\hat{\sigma} - 1}{\hat{\sigma}} }+1 \right]}. \end{equation} which seems to be not the right one.