What is the formula of magnesium sulfate and ammonia?

My work:MgSO4 + 2NH4OH --> (NH4)2SO4 + Mg(OH)2

Correct/Balance the equation below.
MgSO4 + NH4OH → (NH4)2SO4 + Mg(OH)2

Also what is reaction between magnesium sulfate and ammonia? I think its a Double-replacment reaction.

Thank you very much DrBob222. I hope you have a great Christmas or what ever you celebrate.

To determine the formula of the product when magnesium sulfate and ammonia react, we need to know the charges of the elements involved.

The formula of magnesium sulfate is MgSO4. In this compound, magnesium (Mg) has a charge of +2, and sulfate (SO4) has a charge of -2.

Similarly, ammonia has the molecular formula NH3. In this compound, nitrogen (N) has a charge of -3, and each hydrogen (H) has a charge of +1.

Now, let's balance the equation:
MgSO4 + 2NH3 → (NH4)2SO4 + Mg(OH)2

To balance the equation, we need to make sure that the number of each type of atom is the same on both sides of the equation.

On the left-hand side (reactants):
Mg: 1 (unchanged)
S: 1 (unchanged)
O: 4 (unchanged)
N: 2 (2 x 1 from NH3)
H: 8 (2 x 3 from NH3 + 2 x 1 from NH4OH)

On the right-hand side (products):
(NH4)2SO4: 1 (unchanged)
Mg(OH)2: 1 (unchanged)

By comparing the number of each type of atom on both sides of the equation, we can see that the equation is balanced. So, the balanced equation is:

MgSO4 + 2NH3 → (NH4)2SO4 + Mg(OH)2

If you want to balance what you've written it is

MgSO4 + 2NH4OH ==> (NH4)2SO4 + Mg(OH)2 and you are correct that what you have written is a double replacement reaction.

Technically that is not correct because NH4OH does not exist. Ammonia is NH3 gas and if you have a solution of NH3 it is NH3(aq). It is correct to write that NH3 + H2O ==> NH4^+ + OH^-

So you could write
MgSO4 + 2NH3 + 2H2O ==> Mg(OH)2 + (NH4)2SO4 or you could write it as

MgSO4 + 2NH4^+ + 2OH^- ==>Mg(OH)2 + (NH4)2SO4

I don't think there will be a reaction between MgSO4 and ammonia gas.
MgSO4(s) + NH3(g) ==> No Reaction.