A joint optimal power allocation and sensing threshold selection for capacity maximisation at the secondary user (SU) in spectrum sharing (SS) cognitive radio networks (CRNs) is proposed. Hence, both optimal power allocation and spectrum sensing is considered in the SS CRNs model. The obtained results show that such a joint optimal selection improves the performance of the SU by maximising its capacity.Introduction: In spectrum sharing (SS) cognitive radio networks (CRNs), optimal power allocation (OPA) and spectrum sensing (SpSe) are used for the protection of the primary user (PU) from harmful interference caused by the secondary user (SU). Furthermore, for capacity maximisation of the SU, the main parameters related to OPA, i.e. the SU's transmit power, P t , is adapted according to the received signalto-noise ratio (SNR), g s , and related to SpSe, i.e. sensing threshold, h, and sensing time, t, for a given sensed SNR, g, need to be also carefully selected [1]. Previous studies on SU's capacity maximisation include SS CRNs models with SpSe [2, 3] or without SpSe [4,5]. For the former and more general case, the optimisation presented in [2] is considered over P t and t assuming h to be constant. In [3], although the effects of h as a variable are studied, the research is focused on the interference caused to the PU rather than the optimisation of the SU's capacity. Thus, a more general approach is presented in this Letter where a jointly OPA and SpSe threshold selection is considered so that the SU's capacity is maximised over P t and h.