What is the trinity? Is there only one formula for baptism?
The trinity is a word, and some say a concept, not found in the Bible. The doctrine really only dates back for sure until around 300 AD. Many in the churches of Christ, the Baptist church, the Quakers, and other groups feel that it is not an essential doctrine; they consider it a matter for each individual to decide (or not decide) what they believe about it. The Catholic Church, most Presbyterians, most Epicopalians, and others coming more directly out of the Catholic tradition insist on a belief in the trinity. Many Pentecostals hold that a belief in the trinity is unscriptural and sinful.
Essentially, the doctrine of the trinity says that God, Jesus, and the Holy Spirit are all three different "aspects" or "personalities" of one God. Those who don't believe in it say that those who do actually believe in three gods. Supporters of the doctrine point out that a man can be a father, a husband, and a son at the same time. If so, then why can't God be father, son, and Holy Spirit at the same time?
While there are frequent mentions of the Father, the Son, and the Holy Spirit, there are only a limited number of passages that indicate any "triune nature" for the three. The more complicated involves three different passages. In John 8:54 Jesus refers to "my Fatherů; of whom ye say, that he is your God." John 1:1-2 says Jesus "was God. The same was in the beginning with God." In Acts 5:3-4 Peter tells Ananias that he lied to the Holy Spirit, which he also calls lying to God. So in these three passages all three are called God. But that doesn't necessarily imply that all are part of a "godhead," three in one.
The only passage that specifically says all three are one is 1 John 5:7-"For there are three that bear record in heaven, the Father, the Word, and the Holy Ghost; and these three are one." If John is saying they are all one, in the traditional meaning of the Trinity, he loses the argument he is making. By law, something is confirmed only by more than one witness. If the Father, Son, and Spirit are "three in one" then they are not three witnesses, as he says. Most likely he is saying they are one in testimony, not one in nature.
Opponents of the doctrine point to passages like "Hear o Israel, the Lord your God, the Lord is one." (Deuteronomy 6:4) They put Jesus in a sort of superhuman status. This was the view that all of John's writings in the Bible are meant to contradict: that flesh and spirit can not meet, that Jesus in the flesh could not have been God.
A middle ground view hinges on John's use of the term, about Jesus, "the only begotten son of God." If Jesus was begotten, then for some small fraction of eternity (how long is 1/100th of eternity, anyway?) the Son of God did not exist. Before the creation, however, he existed, because through him everything was made. (John 1:3) If he was begotten of God, then he has the full nature of being God. "For in him dwells all the fullness of Godness bodily." (Colossians 2:9) The Holy Spirit, who is described as "him" and not "it", is the word of God (Ephesians 6:17). He is the personification of God's speech or message, and is thus not separate from God in any real sense.
This may have been more than you wanted to know, but is the shortest answer I can give to your first question. One other passage in support of the doctrine of trinity also applies to your second question. "Go ye therefore and teach all nations, baptizing them in the name of the Father, and of the Son, and of the Holy Spirit." (Matthew 28:19)
Is there only one formula for baptism? Baptism is, by definition, immersion in water. Are there any specific words to be said when one is immersed? There is actually no "formula" to be said when one is baptized. You ask, what about the passage you just quoted? Neither that, nor any other passage, requires that anything be said over a person when they are baptized. What that passage says is that they are to be baptized "by the authority of" (the real meaning of "in the name of") the Father, Son, and Holy Spirit. But that doesn't require stating that authority out loud. We often do, in one form or another, just as a preacher or Justice of the Peace often marries someone with the formula, "by the authority vested in my by the state of." They would be just as married if he simply said, "You are now man and wife." Likewise, nobody needs say anything at a baptism.