Need help on Algebraic chemical formula question please

I am completely Bamboozled on how to solve this question:

"Alkanes have the general formula CnH2n+2
Alkanes ungergo complete combustion in a plentiful supply of oxygen
CnH2n+2 + xO2 = nCO2 + (n+1)H2O
Determine x in terms of n"

The answer to this is 3n+1/2 but I have no idea in how you can get to this answer

Can someone please help and explain in a simple step-to-step way in how to solve this question?
Original post by Vinisman
I am completely Bamboozled on how to solve this question:

"Alkanes have the general formula CnH2n+2
Alkanes ungergo complete combustion in a plentiful supply of oxygen
CnH2n+2 + xO2 = nCO2 + (n+1)H2O
Determine x in terms of n"

The answer to this is 3n+1/2 but I have no idea in how you can get to this answer

Can someone please help and explain in a simple step-to-step way in how to solve this question?

Use the fact that the number of oxygen atoms on each side of the equation are equal.

Given there is xO2 on the left-hand side, how many oxygen atoms are there?

Using a similar method, in terms of n, how many oxygen atoms are on the right hand side of the equation? (Hint, consider the (n+1)H2O and the nCO2).

Set the two things equal to each other and you should get the answer as given.
Original post by TypicalNerd
Use the fact that the number of oxygen atoms on each side of the equation are equal.

Given there is xO2 on the left-hand side, how many oxygen atoms are there?

Using a similar method, in terms of n, how many oxygen atoms are on the right hand side of the equation? (Hint, consider the (n+1)H2O and the nCO2).

Set the two things equal to each other and you should get the answer as given.

Oh now I get it,

That was very helpful. Thank you