## 4 Combined Optimization of UAV Location, User Pairing, and Power Allocation
### UAV Transmission Power Optimization
By analyzing optimization problem (22), it is found that the optimal solution \(p_{1,m}\) of power allocation from the UAV to user \(UE_{1,m}\) exists in closed-form and is expressed as \(p_{1,m}^{*}=\Lambda_{m}\), \(p_{2,m}^{*}=p_{m}-p_{1,m}^{*}\). \(\Lambda_{m}\) can be directly solved using the formula \(\Lambda_{m}\triangleq\frac{-\left(\Gamma_{1,m}+\Gamma_{2,m}\right)+\sqrt{ \left(\Gamma_{1,m}+\Gamma_{2,m}\right)^{2}+4\Gamma_{1,m}\Gamma_{2,m}^{2}p_{m}} }{2\Gamma_{1,m}\Gamma_{2,m}}\), where \(\Gamma_{n,m}=\frac{\left\|h_{m,m}\right\|^{2}}{\delta_{m}^{m}}\) represents the normalized channel power gain and \(p_{m}\) denotes the assumed power budget for the given channel \(m\). The specific derivation process is as follows. For users \(UE_{1,m}\) and \(UE_{2,m}\) on channel \(m\), the constraint is represented by \(p_{1,m}+p_{2,m}=p_{m}\), from which \(p_{2,m}=p_{m}-p_{1,m}\) can be derived. Substituting \(p_{2,m}=p_{m}-p_{1,m}\) into (7) and (8), we obtain the rates of users \(UE_{1,m}\) and \(UE_{2,m}\) on channel \(m\), respectively:  
\[R_{1,m}(p_{1,m})=B_{c}\log(1+p_{1,m}\Gamma_{1,m}) \tag{25}\]  
\[R_{2,m}(p_{1,m})=B_{c}\log(1+\frac{q_{m}\Gamma_{2,m}+1}{1+p_{1,m}\Gamma_{2,m}}) \tag{26}\]  
Thus, the optimization problem (24) can be reformulated as:  
\[ \begin{array}{l}\underset{p_{1,m}}{\text{maxmin}}\{R_{1,m}(p_{1,m}),R_{2,m}( p_{1,m})\}\\ \text{s.t.}\text{ }0\leq p_{1,m}\leq\frac{p_{m}}{2}\end{array}  \tag{27}\]  
The optimal solution to the above problem is reached when \(R_{1,m}(p_{1,m})=R_{2,m}(p_{1,m})\) is substituted into optimization problem (27). Substituting (25) and (26) into \(R_{1,m}(p_{1,m})=R_{2,m}(p_{1,m})\) gives \(B_{c}\log(1+\frac{q_{m}\Gamma_{2,m}+1}{1+p_{1,m}\Gamma_{2,m}})=B_{c}\log(1+p_{ 1,m}\Gamma_{1,m})\), forming a univariate quadratic equation \((p_{1,m})^{2}\Gamma_{1,m}\Gamma_{2,m}+p_{1,m}\Gamma_{1,m}-q_{m}\Gamma_{2,m}-1=0\) in variable \(p_{1,m}\). Solving this equation by using the formula for rooting quadratic equations yields the optimal solution \(p_{1,m}^{*}=\Lambda_{m}=\frac{-(\Gamma_{1,m}+\Gamma_{2,m})+\sqrt{\left(\Gamma _{1,m}+\Gamma_{2,m}\right)^{2}+4\Gamma_{1,m}\Gamma_{2,m}^{2}p_{m}}}{2\Gamma_{ 1,m}\Gamma_{2,m}}\) with power \(p_{1,m}\). Therefore, the optimal solution \(p_{1,m}^{*}\), \(p_{2,m}^{*}\) for the power allocated by the UAV to the user for a given individual channel power budget can be expressed as follows:  
\[p_{1,m}^{*}=\frac{-(\Gamma_{1,m}+\Gamma_{2,m})+\sqrt{\left(\Gamma_{1,m}+ \Gamma_{2,m}\right)^{2}+4\Gamma_{1,m}\Gamma_{2,m}^{2}p_{m}}}{2\Gamma_{1,m} \Gamma_{2,m}} \tag{28}\]  
\[p_{2,m}^{*}=p_{m}-\frac{-(\Gamma_{1,m}+\Gamma_{2,m})+\sqrt{\left(\Gamma_{1,m} +\Gamma_{2,m}\right)^{2}+4\Gamma_{1,m}\Gamma_{2,m}^{2}p_{m}}}{2\Gamma_{1,m} \Gamma_{2,m}} \tag{29}\]  
By substituting the channel power allocation optimal solution \(p_{1,m}^{*}\), \(p_{2,m}^{*}\) into the user transmission rate formula, the fair user transmission rate optimal solution \(R_{m}^{*}=R_{1,m}(p_{1,m}^{*},p_{2,m}^{*})=R_{2,m}(p_{1,m}^{*},p_{2,m}^{*})\) is obtained. Thus, the optimal solution of the user rate of a single channel is obtained and expressed as follows:  
\[R_{m}^{*}\triangleq B_{c}\log\left(\frac{\Gamma_{2,m}-\Gamma_{1,m}+\sqrt{ \left(\Gamma_{1,m}+\Gamma_{2,m}\right)^{2}+4\Gamma_{1,m}\Gamma_{2,m}^{2}p_{m} }}{2\Gamma_{2,m}}\right) \tag{30}\]  
However, the optimal solution of the aforementioned optimization problem is only applicable to a single channel. Therefore, in order to achieve the optimal power distribution for all channels, it is necessary to jointly optimize the power budget \(\mathbf{p}=\left\{p_{m}\right\}_{m=1}^{M}\) of all channels. The power budget optimization problem is expressed as follows:  
\[ \begin{array}{l}\underset{p}{\text{max}}\underset{m=1,\ldots,M}{\text{min}}R_ {m}^{*}(p_{m})\\ \text{s.t.}\text{ }\Sigma_{m=1}^{M}\text{ }p_{m}\leq P_{\text{max}}\\ \mathbf{p}\geq\mathbf{0}\end{array}  \tag{31}\]According to [26], the aforementioned optimization problem is addressed using the Lagrange multiplier method, which involves transforming (31) into:  
\[