The heart is a vital organ in our body, as it drives blood circulation. I was wondering if a heart keeps beating if it is separated from the body? If yes, then why?
Short version The heart has the ability to beat independently of the brain as long as it has oxygen. The heart will eventually stop beating as all bodily systems begin to stop working shortly after brain death. Remember the heart can beat, but your diaphragm and lungs won't. Hence the cardiac muscles undergo asphyxiation and die off. However, immediately after death, there is enough oxygenated blood in the body to keep the heart pumping for a while.
Long version There is a simple explanation why.
As you know every muscle in the body has to receive stimuli from the neuromuscular junctions (and subsequently the nervous system) in order to contract.
The heart is a bit different in that it is not regulated by the brain, but the regulatory mechanisms lie within the heart itself. The heart conductive system contains a special group of cells called the pace maker cells (SA node) that fire at regular intervals and cause the heart to beat.
Each heart beat is triggered by an electrical pacemaker - a group of cells in the heart that have the ability to generate electrical activity. They cause electrical impulses to spread over the heart and make it contract. The largest natural pacemaker of the heart is called the sinoatrial or SA node and is found in the right atrium. From it, specialised groups of cells that carry the electrical charge lead off to the rest of the heart.
(Taken from here)
The brain regulates the rate of the heart beat sure, but it does not send the signals that cause the heart to beat in itself.
In short, even after disconnection, the SA node still sends the impulse down the AV node and Purkinje fibres that spread out across the cardiac musculature and cause them to contract, causing the heart to beat. This will continue for a while till they run out of energy and stop.
You can read more about it here: Wiki
Sydney Ringer showed in 1882 that when the heart, when separated from the body and immersed in lactated Ringer's solution, or even isotonic saline solution, will beat because it has its own pacemaker systems at the level of the Sinoatrial node and Atrioventricular node. This activity will continue until there is insufficient ATP to support it energetically.
The Ringer sources link.
Miller, David J. "Sydney Ringer; physiological saline, calcium and the contraction of the heart." The Journal of physiology 555.3 (2004): 585-587.
I was wondering if a heart keeps beating if it is separated from the body?
Yes, it does. Here's a video showing it (don't click if you're squeamish!): https://www.youtube.com/watch?v=NEuSCPifKhA
It's a classical physiology experiment to remove a heart and keep it beating for some time in a jar with liquid solution. In fact, acetylcholine, the first neurotransmitter to be discovered, was detected via an experiment involving disembodied, still-beating frog hearts. As a result, Otto Loewi (who conducted the experiment) received the Nobel prize.
Of course it won't go on forever, as the heart eventually runs out of nutrients and air (without access to lungs). There are also other problems. Taking steps such as supplying oxygenated blood, putting the heart in an isotonic solution, ensuring stable temperature, adding adrenaline (which stimulates the heart) can extend the duration of beating.
If yes, then why?
Why not? Tissue doesn't die the moment it's removed from the body (it's not like individual cells can telepathically tell they've been cut off, they have no way of knowing). It lives for some time before nutrients are exhausted, blood in capillaries drains off, oxygen is depleted, temperature falls, desiccation occurs, and cells finally die. Note how when an accident severs body parts, they can often be surgically reattached and function normally.
Most tissues don't seem to be doing much when you sever them. For instance, a severed hand won't make any movements (actually severed animal limbs can often keep on twitching) but that is because no signal is coming from the brain. If you could emulate the signal, you could get it to move before necrosis occurs.
The heart has a central cluster of neurons, whose function is to generated a regular signal which causes the heart to beat. Because of this, the heart muscle continues to receive a signal even if cut out. The pacemaker cells don't keep perfect rhythm (and more over heart rate is a complicated matter), so in a normal human the brain fine-tunes the rate of beating through hormones and the vagus nerve. If you cut off the vagus connection, the beating won't be as regular or as rapid as inside the body.
In order to clear some issues with the question and answers I add this one.
The question itself was "will a heart keeps beating if it is separated from the body?"
The answer to this question as it was asked: No, the heart removed from the body "as is" will stop beating almost immediately. Denervation and stopping oxygen and electrolytes supply will cause short fibrillation and eventual asystole.
However, if we convert the question to "What are the conditions that will allow the denervated heart to keep beating?", the answer will be different:
If you supply it with solution of electrolytes it will continue beating for some time. If one want extend that time - other chemical compounds should be added as well as the temperature of the organ should be artificially lowered.
nice link that says exactly the same as my answer (provided by @RoverEye )