In addition to stars, gas, and dust, there is one additional component to galaxies. Astronomers discovered it by styding to motions of gas (and stars) in spirals), and it is one of the most puzzling facts about the universe. We know that, according to the laws of gravity, there is a relation between the period of an orbit, the semi-major axis of that orbit, and the mass enclosed by the orbit, i.e., (M + m) P^2 = a^3. Now note that the period of an orbit depends on how fast the object is moving: the faster the object is moving, the quicker it goes around the orbit. In the case of circular orbits, the velocity v = 2 pi a / P. If you substitute this into the previous equation, you find that the further you are from the center of the orbit, the slower the body moves. Mathematically, the equation is v = SQRT [ M / a ] (where a few constants have been left out, and the mass of the moving particle is assumed to be negligible compared to the mass of what is orbiting).
For the solar system, this equation makes perfect sense. The outer planets
move slower (by the square root of their distance from the Sun) than the
inner planets. However, when we observe the motions of stars and gas in the
outer parts of galaxies, we find something very peculiar. As you get further
and further from the center of a galaxy, the velocities of objects orbiting the
galaxy do not decline with radius. For example, gas orbiting at a distance
of 5 kpc from the center of a galaxy moves at the same speed as gas at a
distance of 10 kpc. According to Newton's laws, this is impossible,
unless the mass inside the orbit has increased. Obviously, in the case of
the Milky Way, the above example is not too surprising --- there
are plenty of stars between 5 kpc and 10 kpc, so that the relevant mass
for a body at 5 kpc is less than that for a body at 10 kpc. However,
when you go out very far from the galaxy center -- so far that you don't see
any more stars -- the behavior is the same. The only possible conclusion
is that the mass of the galaxy must be increasing, even when you don't
see any matter. There must be dark matter in the outskirts
of galaxies. In fact, from the motions we see, there must be quite
a bit a dark matter.
The rotation of spiral galaxies isn't the only evidence for dark matter.
For example, take the motions of galaxies in clusters. Most galaxies live
is cluster. Our Milky Way is part of a small group of galaxies called the
Local Group. The Milky Way and the Andromeda Galaxy (M31) are the
two largest galaxies of the group. The Triangulum Galaxy (M33), the
Large and Small Magellanic Clouds are smaller members, along with about 30
very small dwarf galaxies. But some clusters contain thousands of galaxies,
all in random orbits about the center of the cluster.
Although the orbits are random, they do obey a rule. There must always
be a balance between motion and gravity. If the galaxies move too slowly,
relative to the center of the cluster, then their mutual gravity will cause
them fall-in amongst themselves, creating a big mess in the middle. On the
other hand, if the galaxies move too rapidly, then the gravity of the cluster
will not be enough to contain them -- they would achieve escape velocity and
leave the cluster. Thus, for a cluster of galaxies to exist, the motions of
the galaxies must exactly balance the force of gravity. By measuring the
motions of cluster galaxies, it is therefore possible to estimate how much
gravity (and mass) there is. This dynamical estimate can then be compared
to the amount of visible mass in the galaxies. When astronomers do this,
they again find alot of dark matter.
Yet another way to measure dark matter is through the effect of gravity on
light. Consider a nearby galaxy cluster, and a galaxy far in the background
(and exactly behind) the cluster. The light from the background galaxy
can be deflected by the gravity of the cluster, such that it is ``focussed''
onto the earth. The result is a series of magnified arclets. The amount
of magnification (and the radius of the arclets) depends on the amount of
gravity in the cluster. Once again, when we measure the gravity (and therefore
the mass) of the cluster, and compare it to the amount of light we see, we
can only conclude that there is alot of matter that we do not see.
In fact, the best estimate is that about 85% of the mass of the
universe is dark matter. This dark matter question is one of the most
perplexing mysteries of astronomy today, since astronomers still have no clue
as to what makes it up. The best guess is that it might be some sub-atomic
particle left over from the beginning of the universe, but objects such as
black holes, non-pulsar neutron stars, or even planets are not ruled out
observationally. (There are, however, theoretical reasons why
these cannot make up the dark matter.)
Consider a very large cloud of gas. Because every atom of this cloud
is gravitationally attracting every other atom, the matter in this cloud will
gradually be drawn together and the entire cloud will become smaller.
If there is even the smallest amount of rotation associated with the
cloud to begin with, this rotation will increase, as a consequence of the
conservation of angular momentum. (This is the same physics
we applied to pulsars.)
So now consider what will happen to this rotating cloud of gas. The gas that is near the poles of this cloud will not be rotating very rapidly (just like the north pole of the earth is standing still), so gravity will work to pull the gas towards the center. However, gas near the equator of the cloud will have a harder time falling towards the center, due to centripetal force. (For an example of centripetal force, imagine yourself in a car going around a racetrack at high speed. You will feel a force pushing you out away from the center of the track. This is actually due to Newton's first law [bodies in motion will continue in a straight line motion, etc.], but we will call it centripetal force.) So, the gas near the poles will collapse towards the center, while the gas in the equatorial plane will not. When the gas falling in from the top of the gas cloud collides with gas falling in from the bottom, the energy of the collsion dissipates, trapping the gas in the plane of rotation. In effect, the circular gas cloud collapses to a disk.
Note that any stars (or clusters) that may have formed during this stage will be very metal poor. Note also that, while a cloud of gas can stop another cloud of gas from penetrating and falling through the disk, stars are alot denser. (Collisions between stars and gas are like collisions between cannonballs and tissue paper.) As a result, any stars that formed during the collapse will continue in their orbits above and below the Galactic plane. Subsequent generations of stars will be formed in the disk, and will orbit in the disk.
The greatest amount of star formation will occur where the gas density is
greatest. This is in the spiral arms. It is possible to make spiral arms
just with the differential rotation of the galaxy. (The stars in the inner
regions of the galaxy have a shorter period than the stars in the galaxy's
outer regions, so things quickly get wrapped into spiral patters.) But this
is not what causes spiral arms.
A galaxy's spiral arms represent regions of the galactic disk that are slightly overdense (due to the elliptical nature of the stellar orbits). This greater density will cause nearby gas clouds fall into the arms. The compression of these gas clouds then causes star formation. The stars made at this time will eventually drift away from the spiral arms, but not before all the O and B stars have exploded as supernovae. As a result O and B star are only found near spiral arms, and the arms show up much better at ultraviolet wavelengths (where the O and B stars shine brightest).
The question of why spiral bars exist is very complex. Numerical simulations suggest that galaxies without spiral bars will eventually form spiral bars, due to the interaction of stellar orbits. But the entire subject is not well understood.
Finally, astronomers have recently realized that many of the stars in a spiral galaxy's bulge and halo may not have formed in the galaxy at all. Small galaxies which get too close to a large galaxy (such as the Milky Way) can be ripped apart by tides. These stars remain in whatever orbit the (now destroyed) galaxy started with, but are spread out over long arcs. Over time, a spheroidal halo can be built up.
Elliptical galaxies were once thought to be made from gas clouds that did not have much rotation to begin with. However, the modern theory of elliptical galaxies is that these systems form as a result of collisions between galaxies. At first, the result of a collision is a mess, with alot of star formation and ``splashes'' of stars all over the place. However, according to numerical simulations, it appears that, when all is said and done, the stars settle down into an elliptical configuration. Without the spiral patterns (and spiral density waves), new generations of stars do not form. Since dense clusters of galaxies contain many more elliptical galaxies than the field, these simulations seem to be supported by the observations.