# Joint User Pairing, Channel Assignment and Power Allocation in NOMA based CR Systems
## Appendix A
### Convexity of **P2**  
To check whether the objective function of **P2** is convex in \(\alpha_{n,j,c}\) and \(Q_{n,j,c}\), we calculate the Hessian matrix as given below:  
\[H=\begin{bmatrix}\Omega_{1}&\Omega_{2}\\ \Omega_{3}&\Omega_{4}\end{bmatrix}\]  
where  
\[\Omega_{1}=\frac{(|\overline{h_{i,c}}|^{2}-|h_{n,c}|^{2})Q_{n,i,c} ^{2}\sigma^{2}(2\alpha_{n,i,c}|\overline{h_{i,c}}|^{2}|h_{n,c}|^{2}Q_{n,i,c}+(| \overline{h_{i,c}}|^{2}+|h_{n,c}|^{2})\sigma^{2})}{(\alpha_{n,i,c}|h_{n,c}|^{2} Q_{n,i,c}+\sigma^{2})^{2}(\alpha_{n,i,c}|\overline{h_{i,c}}|^{2}Q_{n,i,c}+ \sigma^{2})^{2}}\] \[\Omega_{2}=\Omega_{3}=\frac{(|\overline{h_{i,c}}|^{2}-|h_{n,c}|^{ 2})\sigma^{2}(\alpha_{n,i,c}^{2}|\overline{h_{i,c}}|^{2}|h_{n,c}|^{2}Q_{n,i,c} -\sigma^{4})}{(\alpha_{n,i,c}|h_{n,c}|^{2}Q_{n,i,c}+\sigma^{2})^{2}(\alpha_{n, i,c}|\overline{h_{i,c}}|^{2}Q_{n,i,c}+\sigma^{2})^{2}}\] \[\Omega_{4}=-\frac{\alpha_{n,i,c}^{2}|h_{n,c}|^{4}}{(\alpha_{n,i,c }|h_{n,c}|^{2}Q_{n,i,c}+\sigma^{2})^{2}}+|\overline{h_{i,c}}|^{4}\left(\frac{ \alpha_{n,i,c}^{2}}{(\alpha_{n,i,c}|\overline{h_{i,c}}|^{2}Q_{n,i,c}+\sigma^{2 })^{2}}-\frac{1}{(\overline{h_{i,c}}Q_{n,j,c}+\sigma^{2})^{2}}\right).\]  
For eigenvalues, we need to transform the Hessian into triangular matrix. Then, the values in the diagonal are the eigenvalues. Performing matrix operations, we transform \(H\) into upper-triangular matrix as:  
\[H=\begin{bmatrix}\Omega_{1}&\Omega_{2}\\ 0&\Omega_{5}\end{bmatrix}\]  
where  
\[\Omega_{5}=\frac{\kappa}{Q_{n,i,c}^{2}(\alpha_{n,i,c}|h_{n,c}|^{2}Q_{n,i,c}+ \sigma^{2})(|\overline{h_{i,c}}|^{2}Q_{n,i,c}+\sigma^{2})^{2}Q_{n,i,c}^{2}( \alpha_{n,i,c}|\overline{h_{i,c}}|^{2}Q_{n,i,c}+\sigma^{2})},\]  
the value of \(\kappa\) is given by:  
\[\kappa=-2\alpha_{n,i,c}^{3}|\overline{h_{i,c}}|^{8}|h_{n,c}|^{4}Q_{n,i,c}^{5} -2|\overline{h_{i,c}}|^{6}Q_{n,i,c}^{2}\sigma^{6}-2|\overline{h_{i,c}}|^{2}(| \overline{h_{i,c}}|^{2}-|h_{n,c}|^{2})Q_{n,i,c}\sigma^{8}+(-|\overline{h_{i,c }}|^{2}+|h_{n,c}|^{2})\sigma^{10}\] \[+\alpha_{n,i,c}^{2}(-6|\overline{h_{i,c}}|^{6}|h_{n,c}|^{4}Q_{n,i,c}^{4}\sigma^{2}+6|\overline{h_{i,c}}|^{6}|h_{n,c}|^{2}Q_{n,i,c}^{3}\sigma^{ 4}-6|\overline{h_{i,c}}|^{4}|h_{n,c}|^{4}Q_{n,i,c}^{3}\sigma^{4}+3|\overline{ h_{i,c}}|^{4}|h_{n,c}|^{2}Q_{n,i,c}^{2}\sigma^{6}-\] \[3|\overline{h_{i,c}}|^{2}|h_{n,c}|^{4}Q_{n,i,c}^{2}\sigma^{6})+ \alpha_{n,i,c}(-4|\overline{h_{i,c}}|^{6}|h_{n,c}|^{2}Q_{n,i,c}^{3}\sigma^{ 4}-2|\overline{h_{i,c}}|^{4}|h_{n,c}|^{4}Q_{n,i,c}^{3}\sigma^{4}+2|\overline{ h_{i,c}}|^{6}Q_{n,i,c}^{2}\sigma^{6}-2|\overline{h_{i,c}}|^{2}\] \[|h_{n,c}|^{4}Q_{n,i,c}^{2}\sigma^{6}+|\overline{h_{i,c}}|^{2}(| \overline{h_{i,c}}|^{2}-|h_{n,c}|^{2})Q_{n,i,c}\sigma^{8}+(|\overline{h_{i,c }}|^{2}-|h_{n,c}|^{2})|h_{n,c}|^{2}Q_{n,i,c}\sigma^{8}),\]  
with \(\Omega_{1}\) and \(\Omega_{5}\) the eigenvalues. It can be seen that \(\Omega_{1}\) will always be negative as \(|h_{n,c}|^{2}>|\overline{h_{i,c}}|^{2}\). However, the sign of \(\Omega_{5}\) depends on the values of \(Q_{n,i,c}\) and \(\alpha_{n,i,c}\). As, \(Q_{n,i,c}\) and \(\alpha_{n,i,c}\) are optimization variables and will change values during optimization, this may result in positive value of \(\Omega_{5}\). Hence, the function is non-convex. Similarly, the eigenvalues of Equation (15) are \(\frac{|\overline{h_{i,c}}|^{4}Q_{n,i,c}^{2}}{(\alpha_{n,i,c}|\overline{h_{i,c}}| ^{2}Q_{n,i,c}+\sigma^{2})^{2}}\) and \(\frac{\sigma^{2}(2(-1+\alpha_{n,i,c})|\overline{h_{i,c}}|^{4}Q_{n,i,c}^{2}+(-2 +\alpha_{n,i,c})|\overline{h_{i,c}}|^{2}Q_{n,i,c}\sigma^{2}-\sigma^{4})}{(| \overline{h_{i,c}}|^{2}Q_{n,i,c}+\sigma^{2})^{2}Q_{n,j,c}^{2}(\alpha_{n,i,c}| \overline{h_{i,c}}|^{2}Q_{n,i,c}+\sigma^{2})}\). As \(\alpha\leq 1\), it can be concluded that one eigenvalue is positive and other is negative. The function in Equation (15) is non-convex.