Submarine
While submerged, MBTs generally remain flooded, which simplifies their design, and on many submarines, these tanks are a section of the space between the light hull and the pressure hull. For more precise control of depth, submarines use smaller depth control tanks (DCTs)—also called hard tanks (due to their ability to withstand higher pressure) or trim tanks. These are variable buoyancy pressure vessels, a type of buoyancy control device. The amount of water in depth control tanks can be adjusted to hydrostatically change depth or to maintain a constant depth as outside conditions (mainly water density) change. Depth control tanks may be located either near the submarine's center of gravity, to minimise the effect on trim, or separated along the length of the hull so they can also be used to adjust static trim by transfer of water between them.
When submerged, the water pressure on a submarine's hull can reach 4 MPa (580 psi) for steel submarines and up to 10 MPa (1,500 psi) for titanium submarines like K-278 Komsomolets, while interior pressure remains relatively unchanged. This difference results in hull compression, which decreases displacement. Water density also marginally increases with depth, as the salinity and pressure are higher. This change in density incompletely compensates for hull compression, so buoyancy decreases as depth increases. A submerged submarine is in an unstable equilibrium, having a tendency to either sink or float to the surface. Keeping a constant depth requires continual operation of either the depth control tanks or control surfaces.
Submarines in a neutral buoyancy condition are not intrinsically trim-stable. To maintain desired longitudinal trim, submarines use forward and aft trim tanks. Pumps move water between the tanks, changing weight distribution and pitching the sub up or down. A similar system may be used to maintain transverse trim.

Control surfaces: The hydrostatic effect of variable ballast tanks is not the only way to control the submarine underwater. Hydrodynamic maneuvering is done by several control surfaces, collectively known as diving planes or hydroplanes, which can be moved to create hydrodynamic forces when a submarine moves longitudinally at sufficient speed. In the classic cruciform stern configuration, the horizontal stern planes serve the same purpose as the trim tanks, controlling the trim. Most submarines additionally have forward horizontal planes, normally placed on the bow until the 1960s but often on the sail on later designs, where they are closer to the center of gravity and can control depth with less effect on the trim.

An obvious way to configure the control surfaces at the stern of a submarine is to use vertical planes to control yaw and horizontal planes to control pitch, which gives them the shape of a cross when seen from astern of the vessel. In this configuration, which long remained the dominant one, the horizontal planes are used to control the trim and depth and the vertical planes to control sideways maneuvers, like the rudder of a surface ship.
Alternatively, the rear control surfaces can be combined into what has become known as an x-stern or an x-rudder. Although less intuitive, such a configuration has turned out to have several advantages over the traditional cruciform arrangement. First, it improves maneuverability, horizontally as well as vertically. Second, the control surfaces are less likely to get damaged when landing on, or departing from, the seabed as well as when mooring and unmooring alongside. Finally, it is safer in that one of the two diagonal lines can counteract the other with respect to vertical as well as horizontal motion if one of them accidentally gets stuck.

The x-stern was first tried in practice in the early 1960s on the USS Albacore, an experimental submarine of the US Navy. While the arrangement was found to be advantageous, it was nevertheless not used on US production submarines that followed due to the fact that it requires the use of a computer to manipulate the control surfaces to the desired effect. Instead, the first to use an x-stern in standard operations was the Swedish Navy with its Sjöormen class, the lead submarine of which was launched in 1967, before the Albacore had even finished her test runs. Since it turned out to work very well in practice, all subsequent classes of Swedish submarines (Näcken, Västergötland, Gotland, and Blekinge class) have or will come with an x-rudder.

The Kockums shipyard responsible for the design of the x-stern on Swedish submarines eventually exported it to Australia with the Collins class as well as to Japan with the Sōryū class. With the introduction of the type 212, the German and Italian Navies came to feature it as well. The US Navy with its Columbia class, the British Navy with its Dreadnought class, and the French Navy with its Barracuda class are all about to join the x-stern family. Hence, as judged by the situation in the early 2020s, the x-stern is about to become the dominant technology.
When a submarine performs an emergency surfacing, all depth and trim control methods are used simultaneously, together with propelling the boat upwards. Such surfacing is very quick, so the vessel may even partially jump out of the water, potentially damaging submarine systems.

Hull: 

Overview: Modern submarines are cigar-shaped. This design, also used in very early submarines, is sometimes called a "teardrop hull". It reduces hydrodynamic drag when the sub is submerged, but decreases the sea-keeping capabilities and increases drag while surfaced. Since the limitations of the propulsion systems of early submarines forced them to operate surfaced most of the time, their hull designs were a compromise. Because of the slow submerged speeds of those subs, usually, well below 10 kt (18 km/h), the increased drag for underwater travel was acceptable. Late in World War II, when technology allowed faster and longer submerged operation and increased aircraft surveillance forced submarines to stay submerged, hull designs became teardrop shaped again to reduce drag and noise. USS Albacore (AGSS-569) was a unique research submarine that pioneered the American version of the teardrop hull form (sometimes referred to as an "Albacore hull") of modern submarines. On modern military submarines the outer hull is covered with a layer of sound-absorbing rubber, or anechoic plating, to reduce detection.
The occupied pressure hulls of deep-diving submarines such as DSV Alvin are spherical instead of cylindrical. This allows a more even distribution of stress and efficient use of materials to withstand external pressure as it gives the most internal volume for structural weight and is the most efficient shape to avoid buckling instability in compression. A frame is usually affixed to the outside of the pressure hull, providing attachment for ballast and trim systems, scientific instrumentation, battery packs, syntactic flotation foam, and lighting.
A raised tower on top of a standard submarine accommodates the periscope and electronics masts, which can include radio, radar, electronic warfare, and other systems. It might also include a snorkel mast. In many early classes of submarines (see history), the control room, or "conn", was located inside this tower, which was known as the "conning tower". Since then, the conn has been located within the hull of the submarine, and the tower is now called the "sail" or "fin". The conn is distinct from the "bridge", a small open platform in the top of the sail, used for observation during surface operation.
"Bathtubs" are related to conning towers but are used on smaller submarines. The bathtub is a metal cylinder surrounding the hatch that prevents waves from breaking directly into the cabin. It is needed because surfaced submarines have limited freeboard, that is, they lie low in the water. Bathtubs help prevent swamping the vessel.

Single and double hulls: Modern submarines and submersibles usually have, as did the earliest models, a single hull. Large submarines generally have an additional hull or hull sections outside. This external hull, which actually forms the shape of submarine, is called the outer hull (casing in the Royal Navy) or light hull, as it does not have to withstand a pressure difference. Inside the outer hull there is a strong hull, or pressure hull, which withstands sea pressure and has normal atmospheric pressure inside.
As early as World War I, it was realized that the optimal shape for withstanding pressure conflicted with the optimal shape for seakeeping and minimal drag at the surface, and construction difficulties further complicated the problem. This was solved either by a compromise shape, or by using two layered hulls: the internal strength hull for withstanding pressure, and an external fairing for hydrodynamic shape. Until the end of World War II, most submarines had an additional partial casing on the top, bow and stern, built of thinner metal, which was flooded when submerged. Germany went further with the Type XXI, a general predecessor of modern submarines, in which the pressure hull was fully enclosed inside the light hull, but optimized for submerged navigation, unlike earlier designs that were optimized for surface operation.

After World War II, approaches split. The Soviet Union changed its designs, basing them on German developments. All post-World War II heavy Soviet and Russian submarines are built with a double hull structure. American and most other Western submarines switched to a primarily single-hull approach. They still have light hull sections in the bow and stern, which house main ballast tanks and provide a hydrodynamically optimized shape, but the main cylindrical hull section has only a single plating layer.