# Optimal Power Allocation with Hybrid Relaying Based on the Channel Condition
## 3 Optimal Power Allocation Schemes for Hybrid Relay Networks
### The DF and AF Relay Networks
#### 3.2.1 Case a \((P_{s}|h_{1}|^{2}<P|h_{2}|^{2})\)  
We define \(\omega_{da,1}\) as  
\[\omega_{da,1}=\frac{P_{s}|h_{1}|^{2}}{P|h_{2}|^{2}}. \tag{29}\]  
When \(0<\alpha_{da}\leq\omega_{da,1}\), we can obtain the relation \(\alpha_{da}P|h_{2}|^{2}<P_{s}|h_{1}|^{2}\). Therefore, \(\min(P_{s}|h_{1}|^{2},\alpha_{da}P|h_{2}|^{2})\) is determined as \(\alpha_{da}P|h_{2}|^{2}\). In addition, when \(\omega_{da,1}\leq\alpha_{da}<1\), we can obtain the relation \(\alpha_{da}P|h_{2}|^{2}>P_{s}|h_{1}|^{2}\). Hence, \(\min(P_{s}|h_{1}|^{2},\alpha_{da}P|h_{2}|^{2})\) is determined as \(P_{s}|h_{1}|^{2}\). In other words,  
\[ \begin{split}&\min(P_{s}|h_{1}|^{2},\alpha_{da}P|h_{2}|^{2})\\ &=\left\{\begin{array}{rl}\alpha_{da}P|h_{2}|^{2}&\text{for}\ \ 0< \alpha_{da}\leq\omega_{da,1}\\ P_{s}|h_{1}|^{2}&\text{for}\ \ \omega_{da,1}\leq\alpha_{da}<1\end{array}\right.\end{split}  \tag{30}\]  
Firstly, we consider Case a(1) when \(|h_{2}|^{2}\
eq|h_{3}|^{2}\). By using Equation (30), the optimization problem in Equation (27) is rewritten as  
\[ \begin{split}\max_{\alpha_{da}}\ \gamma_{da}(\alpha_{da})& =\left\{\begin{array}{rl}f_{da,1}(\alpha_{da})\ \ \text{for}\ \ 0<\alpha_{da}\leq\omega_{da,1}\\ f_{da,2}(\alpha_{da})\ \ \text{for}\ \ \omega_{da,1}\leq\alpha_{da}<1\end{array}\right.\\ s.t.\ \ 0<\alpha_{da}<1,\end{split}  \tag{31}\]  
where \(f_{da,1}(\alpha_{da})\) and \(f_{da,2}(\alpha_{da})\) are given by  
\[f_{da,1}(\alpha_{da})=\frac{P^{2}|h_{2}|^{2}|h_{3}|^{2}(\alpha_{da}-\alpha_{da} ^{\ 2})}{\alpha_{da}P(|h_{2}|^{2}-|h_{3}|^{2})+P|h_{3}|^{2}+1}, \tag{32}\]  
\[f_{da,2}(\alpha_{da})=\frac{(1-\alpha_{da})PP_{s}|h_{1}|^{2}|h_{3}|^{2}}{(1- \alpha_{da})P|h_{3}|^{2}+P_{s}|h_{1}|^{2}+1}. \tag{33}\]  
Taking a partial derivative of Equation (32) with respect to \(\alpha_{da}\) and equating it to zero, we can obtain \(\omega_{da,2}\), which maximizes \(f_{da,1}(\alpha_{da})\) as  
\[\omega_{da,2}=\frac{\sqrt{\lambda_{da}}-(P|h_{3}|^{2}+1)}{P(|h_{2}|^{2}-|h_{3} |^{2})}, \tag{34}\]  
where \(\lambda_{da}=P^{2}(|h_{2}|^{2}|h_{3}|^{2}+|h_{2}|^{2}-|h_{3}|^{2})+2P|h_{3}|^{ 2}+1\). The \(f_{da,1}(\alpha_{da})\) increases for \(0<\alpha_{da}\leq\omega_{da,2}\) and decreases for \(\omega_{da,2}\leq\alpha_{da}<\omega_{da,1}\). Since \(\frac{\partial f_{da,2}(\alpha_{da})}{\partial\lambda_{da}}\) is less than zero, \(f_{da,2}(\alpha_{da})\) decreases as \(\alpha_{da}\) increases for \(\omega_{da,1}<\alpha_{da}<1\). As a result, the optimal \(\alpha_{da}\) is \(\omega_{da,2}\) when \(\omega_{da,1}\geq\omega_{da,2}\) and \(\omega_{da,1}\) when \(\omega_{da,1}\leq\omega_{da,2}\). Secondly, we consider Case a(2) when \(\left|h_{2}\right|^{2}=\left|h_{3}\right|^{2}\). By using Equation \(\left(\ref{eq:22}\right)\) and \(\left|h_{da}\right|^{2}=\left|h_{2}\right|^{2}=\left|h_{3}\right|^{2}\), the optimization problem in Equation (27) is rewritten as  
\[\max_{\alpha_{da}}\ \gamma_{da}(\alpha_{da})=\left\{ \begin{array}{l l l}f_{da,3}( \alpha_{da})&\text{for}&0<\alpha_{da}\leq\omega_{da,1}\\ f_{da,4}(\alpha_{da})&\text{for}&\omega_{da,1}\leq\alpha_{da}<1\end{array} \right. \tag{35}\]  
where \(f_{da,3}(\alpha_{da})\) and \(f_{da,4}(\alpha_{da})\) are given by  
\[f_{da,3}(\alpha_{da})=\frac{P^{2}|h_{da}|^{4}(\alpha_{da}-\alpha_{da}{}^{2})}{ P|h_{da}|^{2}+1}, \tag{36}\]  
\[f_{da,4}(\alpha_{da})=\frac{(1-\alpha_{da})P_{5}|h_{1}|^{2}|h_{da}|^{2}}{(1- \alpha_{da})P|h_{da}|^{2}+P_{5}|h_{1}|^{2}+1}. \tag{37}\]  
By solving the equation \(\frac{\partial f_{da,3}(\alpha_{da})}{\omega_{da}}=0\), we know that \(f_{da,3}(\alpha_{da})\) has a maximum value when \(\alpha_{da}=1/2\). Therefore, \(f_{da,3}(\alpha_{da})\) increases for \(0<\alpha_{da}\leq 1/2\) and decreases for \(1/2\leq\alpha_{da}<\omega_{da,1}\). Since \(\frac{\partial f_{da,4}(\alpha_{da})}{\omega_{da}}\) is less than zero, \(f_{da,4}(\alpha_{da})\) decreases as \(\alpha_{da}\) increases for \(\omega_{da,1}\leq\alpha_{da}<1\). As a result, the optimal \(\alpha_{da}\) is \(1/2\) when \(\omega_{da,1}\geq 1/2\) and \(\omega_{da,1}\) when \(\omega_{da,1}\leq 1/2\).