The reactions of trimethylindium (TMIn) with HN 3 and NH 3 are relevant to the chemical vapor deposition of indium nitride thin film. The mechanisms and energetics of these reactions in the gas phase have been investigated by density functional theory and ab initio calculations using the CCSD(T)/Lanl2dz//B3LYP/Lanl2dz and CCSD(T)/Lanl2dz//MP2/Lanl2dz methods. The results of both methods are in good agreement for the optimized geometries and relative energies. These results suggest that the reaction with HN 3 forms a new stable product, dimethylindiumnitride, CH 3-In=N-CH 3 via another stable In(CH 3) 2N 3 (dimethylindium azide, DMInA) intermediate. DMInA may undergo unimolecular decomposition to form CH 3InNCH 3 by two main possible pathways: (1) a stepwise decomposition process through N 2 elimination followed by CH 3 migration from In to the remaining N atom and (2) a concerted process involving the concurrent CH 3 migration and N 2 elimination directly giving N 2 + CH 3InNCH 3. The reaction of TMIn with NH 3 forms a most stable product DMInNH 2 following the initial association and CH 4-elimination reaction. The required energy barrier for the elimination of the second CH 4 molecule from DMInNH 2 is 74.2 kcal/mol. Using these reactions, we predict the heats of formation at 0 K for all the products and finally for InN which is 123 ±1 kcal/mol predicted by the two methods. The gas-phase reaction of HN 3 with TMIn is compared with that occurring on rutile TiO 2 (110). The most noticeable difference is the high endothermicity of the gas-phase reaction for InN production (53 kcal/mol) and the contrasting large exothermicity (195 kcal/mol) released by the low-barrier Langmuir-Hinshelwood type processes following the adsorption of TMIn and HN 3 on the surface producing a horizontally adsorbed InN(a), Ti-NIn-O(a), and other products, CH 4(g) + N 2(g) + 2CH 3O(a) [J. Phys. Chem. B 2006, 110, 2263].