We can write an equation for the (complete) combustion of the substance as follows:

#C_xH_yN_z + (x+y/2+z)/2O_2 to xCO_2+y/2H_2O+zNO_2#

That might look complicated, but all we're saying is that each mole of #C# in the reactant will create #1# mole of #CO_2# as a product, and require #1/2# mole of #O_2# to do so.

The same kind of reasoning applies for #H# to #H_2O# and #N# to #NO_2#.

(There are several oxides of nitrogen such as #N_2O#, but this one corresponds to complete combustion.)

We know the molar mass of #CO_2# is #44# #gmol^-1# and the molar mass of #H_2O# is #18# #gmol^-1#.

Find the number of moles of #CO_2# in the products:

#n=m/M=(33.5xx10^-3)/44 = 7.6xx10^-4# #mol#

(note that we had mg of product and grams for molar mass)

This is simply the value of #x#, the number of moles of #C# in the reactant.

Find the number of moles of #CO_2# in the products:

#n=m/M=(41.1xx10^-3)/18 = 2.3xx10^-3# #mol#

Now each mole of #H# in the reactant produces only #1/2# mole of #H_2O#, so we need to double this number to find #y#, the number of moles of #H# in the reactant: #y=4.6xx10^-3# #mol#

We can now find the mass of #C# and the mass of #H# in the reactant:

For #C#:

#m = nM = 7.6xx10^-4*12=9.12xx10^-3# #g# = #9.12# #mg#

For #H#:

#m = nM = 4.6xx10^-3*1=4.6xx10^-3# #g# = #4.6# #mg#

Now, if we add these we have #13.72# #mg#, but we know the sample was #35.0# #mg#, so the remainder must be #N#: #21.28# #mg#.

Find the number of moles of #N#:

#n=m/M=(21.28xx10^-3)/14=1.52xx10^-3# #mol#

Now we have:

#x= 7.6xx10^-4 =0.76xx10^-3# #mol#

#y= 4.6xx10^-3# #mol#

#z= 1.52^-3# #mol#

These are not neat and tidy numbers, but they look close to #3/4, 4 1/2 and 1 1/2#. To get them to nice clean whole numbers, multiplying by 4000 seems to make sense:

#x~~3, y~~18, z~~6#

Hmm, close, but we can make it simpler by dividing by #3#:

#x~~1, y~~6, z~~2#

So our empirical formula, in its simplest form, is:

#CH_6N_2#

(we don't bother including a subscript of 1)