I learnt that action potentials travel much faster along myelinated axons, and when these axons are demyelinated the action potentials travel much slower and sometimes die out. Why do action potentials die midway in unmyelinated axons?
In unmyelinated axons, there are voltage-gated ion channels along the entire length of the axon. Depolarization in one segment depolarizes and opens ion channels in the adjacent segment, which further depolarizes the next segment, etc.
Myelinated axons are built differently. They have stretches of myelinated axon which are (mostly) free of voltage-gated channels, interrupted by nodes of Ranvier that lack myelin but have dense voltage-gated channels. The depolarization at one node has to be sufficient to reach the next node for the signal to propagate.
Normally this is no problem. Thanks to insulating myelin, the signal propagates unattenuated for a long distance. However, if you start to lose myelin then some of the signal is lost along the way (specifically, the current goes to charge the membrane capacitance, which is reduced by myelin) and it may not be enough to open voltage-gated channels at the next node of Ranvier.
Myelinated axons have schwann cells around them, electrically insulating the neuron axons except for gaps in the sheath which are called the Nodes of Ranvier. The insulation increases the speed of transmission of action potentials.
Without myelination conduction signals along the nerve can be impaired or lost.
There are some diseases E.g. Acute disseminated encephalomyelitis where myelination is lost.