In our text book, the formula for finding the formal charge of an element in a compound is

c(sub f) = X - (Y + Z/2)
where x = the number of valence electrons
y= the number of unshared electrons owned by the atom
z= the number of bonding electrons shared by the atom.

would this formula work if you were trying to find the formal charge of oxygen in SO2, where there are more than one oxygens?

First you must draw the Lewis electron dot structure for the molecule before you will know how many of an atom's electrons are shared and how many are not. With regard to SO2, specifically, the formal charge on one of the O atoms is 0 and the formal charge on the other O atom is -1. The formula works for both but it must be applied to each oxygen atom separately. I learn something every day. I didn't know there WAS a formula for determining formal charge. I've just counted the electrons around an atom and compared that with the normal number

Yes, the formula c(sub f) = X - (Y + Z/2) can be used to find the formal charge of an element in a compound, including the case where there are multiple atoms of the same element. In the case of SO2, where there are two oxygen atoms, you would apply the formula separately to each oxygen atom to determine the formal charge.

To find the formal charge of oxygen in SO2, you would first need to draw the Lewis electron dot structure for the molecule. In the Lewis structure for SO2, there is a double bond between the sulfur atom and one of the oxygen atoms, and a single bond between the sulfur atom and the other oxygen atom. Each bond represents 2 electrons being shared between the atoms.

From the Lewis structure, you can determine the number of valence electrons for oxygen (X), the number of unshared electrons owned by the atom (Y), and the number of bonding electrons shared by the atom (Z).

Let's calculate the formal charge for each oxygen atom in SO2:

For the oxygen atom bonded to sulfur with a double bond:

X = 6 (number of valence electrons for oxygen)
Y = 6 (there are no unshared electrons owned by the atom)
Z = 4 (one double bond represents 2 shared electrons)

Using the formula, we have:
c(sub f) = 6 - (6 + 4/2) = 6 - (6 + 2) = 6 - 8 = -2

For the oxygen atom bonded to sulfur with a single bond:

X = 6 (number of valence electrons for oxygen)
Y = 4 (there are two unshared electrons owned by the atom)
Z = 2 (one single bond represents 1 shared electron)

Using the formula, we have:
c(sub f) = 6 - (4 + 2/2) = 6 - (4 + 1) = 6 - 5 = +1

Therefore, in SO2, one oxygen atom has a formal charge of -2 and the other oxygen atom has a formal charge of +1.

It's worth noting that the formula for formal charge is just one approach to determine the formal charge of an atom. Sometimes, it may be more appropriate to use other methods, such as counting the electrons around an atom and comparing it with the expected number of electrons based on its group number on the periodic table.