Since the entire job of an internal combustion engine (ICE) is to turn heat into mechanical energy, why aren't electric heating methods more popular? I know there must be a reason. I'm not talking about electric cars or anything, but using electricity to heat up and do work.
Because it wouldn't be very efficient.
The main advantage of internal combustion engines is that the energy density of their fuels (gasoline, diesel) is very good. You can go a long way on a relatively small, light tank. The drawback of them is that they aren't very efficient. Most of the energy in the fuel is lost to friction and heat, and only a very small portion (<35%) actually turns into mechanical motion.
Electric vehicles are great because they are incredibly efficient. The fuel they use (batteries) is no where near as compact and light as gasoline or diesel for the amount of energy they store, but an electric motor can turn 90%+ of that energy into mechanical motion.
Using electricity to heat air and run an engine based on the pressure change would be combining the worst aspects of both these system.
Although other answers provide good answers related to energy losses, there's an additional thing to consider.
How on earth are you planning to heat the air in a tiny cylinder at many kilowatts? This is required, because a typical four-cylinder car engine produces 100 kilowatts of power, and the efficiency is probably around 33% in the best case (assuming a non-Atkinson-cycle-engine here). So, you need 300 kilowatts of electric heating, of which one cylinder's share is 75 kilowatts.
Worse, you need to heat the air at a specific moment of time (between compression stroke and expansion stroke). For best efficiency, the heating should be very momentary period between these two strokes, but let's now assume that the entire expansion stroke can be used to heat the air. One of the four strokes means that momentary power needs to be 4 (number of strokes) times 75 kilowatts or 300 kilowatts. Per cylinder!
Have you seen 300 kilowatt electric heating elements? If you have, you probably realize that there is no way to put such a heating element inside a 86 mm stroke x 86 mm bore cylinder in a 2 liter engine. It would need actually to fit in much smaller space, because if the compression ratio is 10, only about 8.6mm is available in the vertical direction.
Even my 1900W electric interior heater which I use during the cold Finnish winter is much larger than 86 mm x 8.6 mm. And that's only 1.9 kilowatts, much less than 300 kilowatts.
Note that having the heater externally, i.e. heating the air before it passes to the engine, is not possible. In this case, the pressure of the air would rise in the compression stroke too, countering the pressure increase of the expansion stroke. You really need the air to be cold during the compression stroke and hot during the expansion stroke. So the heating element really has to be internal to the engine.
Internal combustion engines cannot turn all the heat into mechanical work. And if there is heat source, why not to use it for heating?
All thermal cycles, for example Carnot cycle (Ideal, the most effective), Otto cycle (idealised petrol engine), Diesel cycle (idealised diesel engine), Clausius-Rankine cycle (ideal steam turbine), dissipates some portion of heat by definition. The real engines turn even less energy into mechanical work and more energy to the heat.
Part of the mechanical energy is consumed by alternator to charge the battery, power the spark plugs, ECU and other system. The rest is used for the actual motion.
If we use elecrical heaters only, we will dump all the heat from the engine and use part of the mechanical work to heat the car up. It is double-waste. If we use air heating we had foud usage for part of the wasted energy from the engine.
As an example compare fuel comsumption and driving expirience of Skoda Fabia 1.2 HTP (honem to prodej [sell it ASAP]) with stereo, AC and seat heaters. When all systems are on, the consumption is significantly higher and acceleration is significantly worse - all because more power direced to the alternator rather to the wheels. Turning AC off is commonly tactics used when attempting to overtake with such cars.
Electrical independent heating and electrical seat heaters are used as optional extra for enhanced comfort. It takes less than a minute to heat them up regardless the ambient temperature, on the other hand warming up the engine takes from minutes to tens of minutes with respect to the ambient temperature.
Side note, if your engine is overheating it is recommended to turn heating fully on - it will redirect part of the heat from failing/overloaded radiator to the cabin.
The purpose of an ICE is to convert chemical energy into motion. It does this by igniting fuel not to generate heat per se but to cause rapid expansion of particles in the cylinder, which in turn creates pressure, and therefore applies force on the piston. Heat is one of a number of factors that come into play in that expansion. However a number of other factors come into play in the chemical reactions involved in combustion. These could not be simulated by simply heating air rapidly with electric heat. Converting chemical energy to heat is also, it turns out, much easier to do efficiently that converting electricity into heat.
But we do use electrical systems to create heat in internal combustion engines. They're called Block heaters.
As most of the comments and posts point out, it's not heat that's converted to mechanical energy, it's the force from the ignited fuel (the combustion) via the pistons. The heat is mostly wasted energy, which is absorbed and transferred out by the coolant.
However at extreme temperatures oil becomes more viscous, requiring more energy to move. This can lead to engine damage when trying to run cold, or the inability to run the system at all. Block heaters were designed to keep certain parts of the engine closer to their ideal running temperature in order to make it easier to start.
So while we don't need electricity to create extra heat in an already running engine, we do use it to keep things warm when it's off.
I don't know what you mean by heat up and do work but the pre-86 Lancia Delta featured electric cabin heating is that's what you are referring to?
If you mean to heat up air inducted into the engine, this is a bad idea because cold air has the highest density and therefore the most oxygen available for combustion.
First question - where do you get the electricity from? The electricity we use comes from other sources hydro, geothermal etc Combined with losses of conversion mean that using other fuels that are directly available coal etc to provide heat has been effective. Now, with global warming then we are moving away towards renewables...
Heat is a form of energy, but compared to electricity it's lazier. It's hard to get work out of it. So if you had a source of electricity you'd be much better off using it in an electric motor, with 99% efficiency, than using it to heat something and then extract work from the heat with maybe 30% efficiency on a really good day.
And I didn't even mention Boltzmann's constant!