In science, anything that displaces water equal to its weight will float just like a ship. This process of water displacement produces an upward force that puts the ship down. This is what we call the Law of Buoyancy. In the case of a submarine, it can create and manage its own buoyancy that allows it to sink and rise on surface.
In controlling its buoyancy, the submarine is made up of ballast tanks and accessories called trim tanks that contain water or air alternately. If the submarine is above surface, the ballast tanks will be filled with air thus, the total density of the submarine becomes less than the water surrounding it.
When the submarine submerge in the water, these ballast tanks become flooded with water and the air contained inside the tanks is released out of the submarine until its total density becomes higher than the water surrounding it. This process called negative buoyancy makes the submarine sink.
Only a small supply of contracted air is retained for life support of the crew. The submarine has flexible wings known as hydroplanes at the back that enables the submarine to control its diving angle. These hydroplanes have angles to induce the water to move at the back forcing the end of the submarine upward that makes it dive in a downward direction.
To maintain the level of the submarine at water depth, it retains a balance of air and water contained in the trim tanks. This is made possible to produce a total density which is equal to the weight of water surrounding it.
When the submarine rises to the surface, compressed air goes out from the flasks to the ballast tanks that forces the release of water outside the submarine and its total density becomes less than the water surrounding it. This process enables the submarine to rise up.
Submarines are equipped with diesel engines and high-powered batteries for electrical power under the sea. Since light cannot penetrate deeply in water, submarines have to put off their lights and go on with their travel with almost blind visibility. In this case, submarines depend on navigational charts and sophisticated navigational equipment to determine their route.
On the other hand, a whale is different from other mammals in its ability to submerge in water for long. Its ability to stay under water for a long time in an incredible depth is made possible thru the work of its various organs. When the whale is in the depth of the sea, it has to change its blood circulation in the flippers and flukes.
The blood temperature returns to normal when the insulating blubber is bypassed. The blubber of the whale enables it to retain its blood temperature to rise up on surface thus offsetting the negative buoyancy or its ability to stay underwater produced by its muscle and skeleton.
Its power to rise is enabled by its epaxial mass situated on the upper side of its backbone while its submersion ability is powered by its hypaxial mass or popularly called the back muscle.