One primary defining characteristic of a modern submarine is its method of propulsion. There are several methods, each of which has its own set of pros and cons.
Of these, nuclear power is the most expensive but offers the best endurance. It does, however, add complexity and size to the submarine, and (one would hope) additional costs imposed by stringent safety procedures. For example, in the U.S. Navy, a nuclear ship always has a reactor crew aboard - even if the ship is already decommissioned and is simply awaiting dismantling.
Diesel-electric subs are a tried and true technology, having seen the world's major navies through two World Wars and over eighty years of use. They are cheap to build and operate. However, submarines powered in this fashion have limited underwater endurance - they must frequently surface (or at least snorkel) to recharge their batteries for electric underwater operation. In addition, the limitations of battery power typically limit underwater performance to a few knots (under 15).
Hydrogen Peroxide Propulsion addresses the underwater endurance issue; since it acts as its own oxidizer, internal combustion engines can be used underwater without having to snorkel. The disdvantages include expensive (relatively) and limited-availability fuel, as well as the dangers of having volatile fuels aboard the boat.
Stirling Cycle engines are one method of avoiding internal combustion engines. All that is required is a heat differential to run them; for example, radioisotope thermal generators (larger versions of those used in space probes) might be used. Or a fuel and oxidizer might be carried aboard for controlled burning.
In any case, there are many options for propulsion; more are being explored as this is written.
One addition to the ballast vs. planes discussion above: for safety's sake, one can 'trim' the boat to to a slight
positive buoyancy with the ballast tanks, and then use a slight downward trim on the hydroplanes to maintain or change depth. The advantage of this approach is that if you for some reason lose your propulsion (which means you may likely have lost the ability to control ballast as well) you can simply wait a bit, and you will float to the surface eventually. Naturally, in combat, under ice or in other particular situations this precaution may do more harm than good.