The main challenge has been focused on ibuprofen drug detection and adsorption of boron nitride nanotube (BNNT) doping with transition metal (TM = Fe, Ni, and Pt) atoms using the density functional theory calculation in gas and water phases. The geometrical structures, adsorption energies, solvation energies, and electronic properties were examined. The optimized geometries show that the ibuprofen molecule oriented itself at different bond distances and angles with respect to BNNT surface. The calculated results display exothermic adsorption processes for all ibuprofen/BNNT and ibuprofen/TM–doped BNNT complexes. Ibuprofen molecule can absorb on the Fe–, Ni–, and Pt–doped BNNTs via a stronger interaction than those of pristine BNNT in both gas and water phases in which the Fe doping on N site of BNNT shows the strongest interaction with ibuprofen molecule. The H (head) site of ibuprofen molecule to BNNT surface shows stronger interaction than M (middle) and T (tail) sites. The short of adsorption distance and the large of charge transfer correspond to the high adsorption strength of TM–doped BNNTs toward ibuprofen molecule. Charge analysis confirms the partial charge transfer occurring from the ibuprofen molecule to the BNNTs. The solvation energies in water solution reveal that the ibuprofen molecule adsorbed on TM–doped BNNTs is more soluble than pristine BNNT. The work functions of BNNTs are reduced by ibuprofen adsorption. A short recovery times and suitable desorption temperatures are observed for the ibuprofen desorption on pristine BNNT and TM–doped BNNT surfaces. After ibuprofen adsorption, the energy levels and energy gaps of Fe–, Ni–, and Pt–doped BNNTs are changed in which Ni doping on B atom of BNNT displays the largest change. The quantum molecular characteristics of BNNT will be changed after ibuprofen adsorption. The orbital distributions are occurred around the ibuprofen molecule and doping site. The alteration in the density of states for TM–doped BNNT is considerably more pronounced compared to the pristine BNNT. Drawing from the achieved outcomes, it can be inferred that when employed for the delivery of ibuprofen in biological media, Fe–, Ni–, and Pt–doped BNNTs exhibits the greater suitability for the adsorption and detection of the ibuprofen molecule compared to pristine BNNT.