Light has no mass so it also has no energy according to Einstein, but how can sunlight warm the earth without energy?
In the above equation, E is the total energy of the particle, p is the momentum of the particle (which is related to its motion), c is the speed of light, and m is the mass of the particle. This equation can be derived from the relativistic definitions of the energy and momentum of a particle. The above equation tells us that the total energy of a particle is a combination of its mass energy and its momentum energy (which is not necessarily related to its mass). When a particle is at rest (p = 0), this general equation reduces down to the familiar E = mc2. In contrast, for a particle with no mass (m = 0), the general equation reduces down to E = pc. Since photons (particles of light) have no mass, they must obey E = pc and therefore get all of their energy from their momentum.