Sunday, November 20, 2022

Photoelectricity: UNIZOR.COM - Physics4Teens - Waves - Photoelectricity

Notes to a video lecture on


In the previous lecture "Energy of Light" of this chapter we investigated the amount of energy carried by electromagnetic waves.
A single wavelength λ of harmonic oscillations of electromagnetic field carried an energy
Wλ = (λ/4)·[ε0·E0²+(1/μ0)·B0²]
ε0 is the electric permittivity of vacuum,
E0 is an amplitude of electric component of the field oscillations,
μ0 is the magnetic permeability of vacuum,
B0 is an amplitude of magnetic component of the field oscillations.

We can shorten this formula using a dependency between electric and magnetic amplitudes E0=c·B0 and expression of the speed of wave propagation c in terms of permittivity and permeability of vacuum c²==1/(ε0·μ0) described in the previous lecture.
Wλ =
= (λ/4)·
[ε0·E0²+(ε0/c²)·B0²] =
= (λ/4)·
[ε0·E0²+ε0·E0²] =
= (λ/2)·ε0·E0² =
= (c·τ/2)·ε0·E0²

where τ is a period of oscillations, that is the time a wave propagates by the distance equal to its wave length.

As you see, it's proportional to a wave length and to a square of amplitude of oscillations.

When these electromagnetic waves (like visible light) fall on some surface, some of this energy is absorbed by the material it falls on. Obvious consequence of this is that this energy is converted into heat, and the temperature of the surface should rise.

While this is, generally, true, some experiments showed that not only the temperature of the surface is increasing, but some electrons are flying off that surface and can be detected.
This was discovered by Heinrich Hertz, a German physicist, in 1887 and is known as Hertz effect or photoelectric effect or photoemission and these flowing away electrons were called photoelectrons.

With proper arrangement these electrons, kicked out from their orbits around an atom's nucleus by falling waves of electromagnetic oscillation, can form an electric current and used to detect some events related to light.

A simple example of this arrangement can have a negative pole of a battery connected to a metal surface A, while a battery's positive pole connected to some other metal plate B positioned opposite to A on a small distance. If a light that causes photoelectric emission falls on a surface A, it kicks off some electrons, which will be immediately attracted to surface B, thus creating a current in a circuit, while the light is on. This can, for example, be used to count parts on a conveyer going across some light beam with the beam interrupted with each part passing by.

Numerous experiments were conducted to research this process.
Different materials were used (primarily, metals), different intensities and frequencies of light were experimented with and very important observations were made.

The fact that the beam of light kicks off some electrons from a surface of a metal was not surprising.
Expected results of experiments were that the brighter light (higher amplitude of electromagnetic oscillations) should cause electrons to be flying off a surface in larger quantities and higher speed and, therefore, higher kinetic energy. Also, even the low intensity beam of light should gradually supply sufficient amount of energy for electrons to start flying off a surface of a metal.

What was surprising was that experiments did not produce these expected results.

Most importantly, for any kind of metal there was a specific frequency of electromagnetic waves (ω - angular frequency, f - regular frequency, that is the number of oscillations per second and ω=2π·f) or, equivalently, specific wave length (λ=2π·c/ω=c/f, where c is a speed of light) such that with this and higher frequency (or, equivalently, this and shorter wave length) the photoelectric effect was observed, but lower frequencies of waves (or longer wave lengths) did not cause this effect, no matter how long or how bright the light was shining on a metal surface, so the low frequency light energy was converted into internal heat with no photoelectrons emitted.

Without pretending that the following is a true explanation of why a specific frequency (or higher) is needed to kick off photoelectrons from a surface of a particular metal plate, we consider the following analogy helpful to intuitively feel the underlying mechanism of photoemission.

Consider you are in a car riding on a bumpy road. Assume, all bumps are of the same height, but different length, some short and steep, some long and gradually changing the height.

A car can go over a long bump, when it slowly rising to its maximum height and slowly going down or it can be a short bump of the same height, but the car will have a steeper rise to its peak and steeper way down.
If you ride inside a car on this bumpy road, you will, probably, feel almost nothing going over a long bump, but a short one will cause a jerk and you will be thrown up by a couple of inches.
Steep forceful rise of a car causes it to sharply accelerate upwards, and whoever is inside will feel a strong but short lived force pushing upwards and, maybe, even exceeding the force of gravity.

Similar thing happens when after washing your hands you try to get rid of excess of water by shaking it off. Slow movement of hands with any amplitude will not do a trick because the acceleration of the water drops would be insufficient to shake these drops off, but short and abrupt motion will be effective, the drops will fall off.

Well, similar thing happens with electrons. A long electromagnetic wave length (that is, a wave of a low frequency) rises the energy of electrons inside a metal slowly and the energy dissipates among other electrons, not actually rising in any particular electron high enough to tear it off a nucleus against a force of a nucleus attraction.
If, on the other hand, a short wave hits an electron, it acts like a short bump to a car, it quickly lifts it, kicking off an orbit, so it becomes a free photoelectron.

So, for light to cause the photoelectric effect it's necessary to have to abruptly "shake" an electron with a short wave length (that is, high frequency) of light.

Albert Einstein has received a Nobel Prize in Physics for a really scientific theory of photoelectric effect based on a concept of light energy carried by discrete packets called light quanta or photons.
This and works of other physicists, like Max Planck, was the beginning of quantum theory, one of the major developments of the 20th century Physics.

It also showed a duality of electromagnetic waves that in some circumstances act like waves, while in other cases demonstrate quantum properties similar to particle theory of the past.

The wave theory of electromagnetic field developed by Maxwell and reflected in Maxwell's equations (see the chapter "Electromagnetic Field Waves" in this part "Waves" of a course) considers electromagnetic field as the space with continuous distribution of energy.
Einstein's approach was to consider the light (and electromagnetic field in general) as a space with discrete distribution of energy, with each "particle" of light carrying certain finite amount of energy - a photon.

According to this theory, each light quantum (or photon) carries an energy Ephoton that is proportional to its frequency
Ephoton = h·f
h=6.63·10−34 J·s (Joules·seconds) is Planck's constant and
f is the wave frequency, units of which are 1/s (Hertz, oscillations per second).

Each electron is attracted to some nucleus. It means, it needs some energy Efree to fly free, same as a spaceship needs an energy to break off the Earth gravitation.
An electron can absorb only one photon and either is kicked off its orbit, if the frequency of incident radiation is sufficiently high, or stays near its nucleus, if the frequency of radiation is not high enough.

If a photon hits an electron and the photon's energy Ephoton exceeds than what's needed to set free an electron Efree, the electron becomes a free photoelectron and, for example, can be used in some electronic device.
Excess energy Ephoton−Efree is transformed into kinetic energy of a photoelectron, which results in a simple equation
Ephoton−Efree = ½me·V²
Ephoton = Efree + ½me·V²
me is a mass of an electron,
V is the speed of an electron kicked off its orbit by a photon.

The concept of a photon leads to a new understanding of a term intensity, as applicable to light and other electromagnetic radiation. Intensity of radiation is defined as a quantitative characteristic of radiation proportional to the number of photons produced per unit of time.

At the same time the number of photoelectrons emitted from a surface per unit of time as a result of an incident radiation with sufficiently high frequency is also proportional to a number of photons falling on this surface.
Therefore, the photoelectric current, that is proportional to a number of photoelectrons produced in a unit of time, is proportional to intensity of incident radiation.

Tuesday, November 15, 2022

Energy of Light: UNIZOR.COM - Physics4Teens - Waves - Photoelectricity

Notes to a video lecture on

Energy of Light

As was presented in the lectures "Electric Energy" and "Magnetic Energy" of a chapter "Energy of Waves" in this part of a course "Physics 4 Teens", electromagnetic field carries energy, electric and magnetic.

The density of the field's total energy PE+M(t,x,y,z) at any time t at any point {x,y,z} of this field can be expressed as a sum of electric energy density
PE(t,x,y,z) = ½ε·E²(t,x,y,z)
where E(t,x,y,z) represents the intensity of an electric field
and magnetic energy density
PM(t,x,y,z) = ½(1/μ)·B²(t,x,y,z)
where B(t,x,y,z) represents the intensity of a magnetic field.

Constants ε and μ in the above expressions stand, correspondingly, for electric permittivity and magnetic permeability of an electromagnetic field.

For our purposes we assume the light propagates in the vacuum, so ε=ε0 and μ=μ0.

So, the total energy density of electromagnetic field is
PE+M(t,x,y,z) =
= PE(t,x,y,z) + PM(t,x,y,z)

Light is an oscillating electromagnetic field. Therefore, light carries energy.

Let's evaluate the amount of energy in one wave length λ of a single light ray propagating in vacuum in the direction of the Z-axis with speed c with sinusoidal harmonic oscillations of field intensities.

Assume, electric field intensity oscillates around the X-axis, depending on time t and distance from the source of light z, according to a formula:
where E0 is an amplitude and
ω is an angular frequency of oscillations.
The magnetic field intensity synchronously oscillates around the Y-axis with the same angular frequency ω:
where B0 is its amplitude.

The expression inside a cos() function for both (electric and magnetic) components of an electromagnetic field represents the fact that a wave on a distance z from the origin is similar to the wave at the origin (that is, when z=0), but reaches location z with a time delay of z/c needed to reach that point with the speed of wave propagation c.

Then the electric field energy in one wave length of this ray is
WE = 0λ½ε0E²(t,z)dz
which, considering the expression for electric field intensity, is

Analogously, the magnetic field energy in one wave length of this ray is
WM = 0λB²(t,z)/(2μ0)dz
which, considering the expression for magnetic field intensity, is

Let's calculate the common for these two expression integral
Then we will use it for calculation of WE and WM.

u = ω(t−z/c))
z = c·t−(c/ω)·u
du = −(ω/c)·dz
dz = −(c/ω)·du
We have to change the limits of integration for a new variable u:
if z=0, u=ωt,
if z=λ, u=ωt-(λω)/c.

Recall the following relationships between angular frequency ω, speed of light propagation c, wave length λ, period τ and frequency f, which were all discussed in the lecture "Rope Energy" of the chapter "Energy of Waves" in this part "Waves" of the course "Physics 4 Teens":
λ = c·τ
τ = 1/f
f = ω/(2π)
from which follows that
λ = c·τ = c/f = 2πc/ω

Therefore, upper limit of integration for variable u is
ωt−(λω)/c = ωt−2π.

With all the above substitutions integral
can be expressed in terms of variable u as
ωtωt−2π cos²(u)·(−(c/ω)·du) =
= (c/ω)
ωtωt−2π cos²(u)·du

Using trigonometric formula
cos²(φ) = ½[cos(2φ)+1]
and standard integration techniques, the result of integration is
(c/ω)ωtωt−2π cos²(u)·du =
= π·c/ω

Based on the above, the energy of one wave length λ of a single ray of light is
Wλ = (1/2)(ε0πc/ω)·E0² +
+ (1/(2μ0))(πc/ω)·B0² =

Let's evaluate the amount of energy falling on some surface of area A during time T from a set of synchronous monochromatic parallel rays of light (flat waves) that are directed perpendicular to this surface based on speed of light c and its angular frequency (that we perceive as color) ω, assuming the light is harmonic synchronous oscillations of an electromagnetic field with electric amplitude E0 and magnetic B0.

During time T on the flat surface area A falls perpendicularly to it all the energy of an electromagnetic field in the volume V=A·c·T

Assume that the direction of the propagation of light (red lines on the picture above) is vertically down along the Z-axis, while X- and Y-axes are on the bottom surface of area A.

The height of a cylinder on a picture above is the distance light covers in time T, that is, the height equals to c·T.
In this height we can fit certain number of wave length of waves. If the wave length is λ, the number of waves we can fit into the height c·T is
c·T/λ = c·T·ω/(2πc) = ω·T/(2π)

Taking into consideration the area A the light falls on, the total amount of energy falling on this area during time T is
WA,T = [ω·T·A/(2π)]·Wλ =
[π·c/(2ω)]·[ε0·E0²+(1/μ0)·B0²] =
[T·A·c/4]·[ε0E0² + (1/μ0)B0²]

Density of energy falling per unit of area per unit of time that can be called the average intensity of light I can be obtained by dividing the above expression by A and by T getting
I = [c/4]·[ε0E0² + (1/μ0)B0²]

An important addition to these calculations allows to express this average intensity of light only in terms of electric field intensity.
In the lecture "Speed of Light" of the chapter "Electromagnetic Field Waves" of this part of a course "Physics 4 Teens" we have derived a simplified form of the Fourth Maxwell Equation as
By(t,z)/z = μ0·ε0·Ex(t,z)/t
where indices x under E and y under B correspond to a model we discuss in this lecture, that electric field intensity oscillates around X-axis, magnetic field intensity oscillates around Y-axis and the light propagates along Z-axis.
So, for our purposes we can safely drop these indices, which results in the following differential equation
B(t,z)/z = μ0·ε0·E(t,z)/t

In that same lecture "Speed of Light" we have expressed the speed of propagation of electromagnetic waves in vacuum as
c² = 1/(μ0·ε0)
Using this, we can rewrite the differential equation with partial derivatives above as
−c²·B(t,z)/z = E(t,z)/t

We have assumed that the ray of light is described by harmonic oscillations
E(t,z )= E0·cos(ω(t−z/c)),
B(t,z) = B0·cos(ω(t−z/c)),

Let's take the partial derivatives in the differential equation above for these field intensities.
B(t,z)/z =
= B0·sin(ω(t−z/c))·(ω/c)

E(t,z)/t =
= −E0·sin(ω(t−z/c))·ω

For these harmonic oscillations the differential equation above looks like
c·B0·sin(ω(t−z/c)) =
= E0·sin(ω(t−z/c))

from which follows
c·B0 = E0

Now the above expression for the amount of energy falling per unit of area per unit of time (average intensity of light) can be transformed into
I = [c/4]·[ε0E0² + (1/μ0)B0²] =
[c/4]·[ε0E0² + (1/(c²·μ0))E0²]

From c²=1/(μ0·ε0) follows
that 1/(c²·μ0)=ε0.
I = [c/4]·[ε0E0² + ε0E0²] =
= c·E0²·ε0 /2

Simple transformations allow to express the same average intensity of light in terms of magnetic field intensity
I = c·B0²/(2μ0)
or in terms of both electric and magnetic field intensities
I = E0·B0/(2μ0)

An important consequence from the above formulas is that the density of light energy, that is the average amount of energy falling on a unit of area during a unit if time or average light intensity is proportional to a square of its amplitude.

Friday, November 4, 2022

Speed of Light: UNIZOR.COM - Physics4Teens - Waves - Field Waves

Notes to a video lecture on

Speed of Light

Based on Maxwell equations, we can derive separate differential equations for vectors of electrical (E) and magnetic (B) components of a electromagnetic field and the speed of its propagation in a simple case of vacuum as a medium and no additional sources of electric charges, moving or stationary, present.

As we know, oscillations of electromagnetic field are transverse, vectors E and B are perpendicular to each other and both are perpendicular to the direction of waves propagation.

Assume that the wave propagation is along the Z-axis of some system of coordinates, electric component E is changing along the X-axis and magnetic component B is changing along the Y-axis.

For this type of the electromagnetic field we can state
E = {Ex,Ey,Ez}
with Ey=0 and Ez=0,
while Ex(t,z) being a function of time t and coordinate along the Z-axis z.
B = {Bx,By,Bz}
with Bx=0 and Bz=0,
while By(t,z) being a function of time t and coordinate along the Z-axis z.

Using the above format of vectors of electrical (E) and magnetic (B) components of the electromagnetic field, we can analyze the form of the Maxwell equations for them.

The third Maxwell equation that relates induced electric field to a changing magnetic field - the Faraday's Law - is

E = −B/t

Recall the definition of a vector (cross) product of a pseudo-vector
by any vector
V(x,y,z) = {Vx,Vy,Vz}
using unit vectors i, j and k along the coordinate axes:
V =
= (
Vz/y − Vy/z)·i +
+ (
Vx/z − Vz/x)·j +
+ (
Vy/x − Vx/y)·k

(you can refresh this in the lecture "Curl in 3D" of this chapter of a course on UNIZOR.COM)

Considering a special characteristics of vector E with only Ex(t,z)≠0,
E =
= (
Ez/y − Ey/z)·i +
+ (
Ex/z − Ez/x)·j +
+ (
Ey/x − Ex/y)·k =
= (

Considering a special characteristics of vector B with only By(t,z)≠0,
B/t = −(By/t)·j

Therefore, the third Maxwell equation in this case of a simple electromagnetic field takes the form
(Ex/z)·j = −(By/t)·j
Ex/z = −By/t

The fourth Maxwell Equation looks like

∇⨯B = μ·ε·E/t + μ·σ·E

Here the variables participating in this equation are:
μ is a magnetic permeability of the media,
ε is an electric permittivity of the media,
σ is a material conductivity of the media.

Considering our medium is vacuum, σ=0, and the fourth Maxwell equation looks like
∇⨯B = μ·ε·E/t
Since only By(t,z)≠0,
B =
= (
Bz/y − By/z)·i +
+ (
Bx/z − Bz/x)·j +
+ (
By/x − Bx/y)·k =
= −(

The vector E on the right side of the fourth Maxwell equation has only X-component not equal to zero.
Therefore, this equations looks like
−(By/z)·i = μ·ε·(Ex/t)·i
By/z = μ·ε·Ex/t

As a result, the third and fourth Maxwell equations for an electromagnetic field in vacuum with no additional charges take the short form:
Ex/z = −By/t
By/z = μ·ε·Ex/t

To separate electric and magnetic components into separate single variable equations, let's differentiate the first equation by space coordinate z and the second equation - by time t.
∂²Ex/z² = −∂²By/tz
∂²By/zt = μ·ε·∂²Ex/

From these two equations we can construct one for Ex:
∂²Ex/z² = μ·ε·∂²Ex/

We can drop an index x for an electric component of an electromagnetic field since the other two components are zero.
In vacuum magnetic permeability μ is a known constant, approximately equal to

and an electric permittivity ε is also a known constant, approximately equal to

In these terms the last equation for the electric component of an electromagnetic field is
∂²E(t,z)/z² = μ0·ε0·∂²E(t,z)/
This equation is the general wave equation for the direction of the wave propagation along the Z-axis.

Incidentally, one of the solutions to it, considered in the lecture "Wave Equation 2" of this chapter of the course on UNIZOR.COM is the wave function
E(t,z) = A·sin(ω·(t−z/v))
where ω is the frequency of oscillations and v is the speed of wave propagation.

Indeed, differentiating E(t,z) by z gives
E(t,z)/z =
= −(ω/v)·A·cos(ω·(t-z/v))

∂²E(t,z)/z² =
= −(ω/v)²·A·sin(ω·(t-z/v))

Differentiating E(t,z) by t gives
E(t,z)/t =
= ω·A·cos(ω·(t-z/v))

∂²E(t,z)/t² =
= −ω²·A·sin(ω·(t-z/v))

∂²E(t,z)/z² = (1/v²)·∂²E(t,z)/

If 1/v²=μ0·ε0, the wave equation for E(t,z)=A·sin(ω·(t-z/v)) is satisfied.

The last statement is extremely important, since it defines the speed of wave propagation in terms of magnetic permeability and electric permittivity of the medium.

Using the constants of magnetic permeability and electric permittivity of vacuum listed above, the speed of propagation of electromagnetic oscillations for vacuum can be calculated as follows:

1/v² = μ0·ε0 =
= 11.1265005604·10−18

v² = 1/(μ0·ε0) =
= 0.0898755178·1018

v = √0.0898755178·109 =
= 299,792,458

The speed of light in vacuum is usually denoted as c, so
c = 299,792,458 m/sec

All the above calculations were performed by James Maxwell at the end of 19th century.
At the same time the speed of light was measured relatively precisely, and it was almost exactly the same as the speed of electromagnetic waves propagation calculated above.
That led to a hypothesis that light is the oscillations of electromagnetic field.

The magnetic permeability and electric permittivity of vacuum are not dependent on the frequency of oscillations. That's why the speed of light of any color in vacuum is the same as calculated above.
When the light goes through some material substance (like air or glass), the magnetic permeability and electric permittivity of a medium do depend on the frequency of oscillations and, therefore, the speed of light of different colors varies in material substance, which causes such effects as interference, diffraction or dispersion of light.

Magnetic Field Energy: UNIZOR.COM - Physics4Teens - Waves - Energy of Waves

Notes to a video lecture on

Magnetic Field Energy

Our task is to determine the energy carried by a magnetic field. More precisely, a density of a potential energy as a function of a local characteristic of a magnetic field - the value of its intensity vector B.

First, we have to choose a device where a uniform magnetic field can be created and evaluate the total amount of energy we have to spent to create this uniform magnetic field. This energy will be stored in a certain volume of space inside this device occupied by a created magnetic field as its potential energy.
Then, dividing the total amount of energy of the magnetic field inside this space by the space volume, we will get a density of the potential energy of the magnetic field.

Recall the description of an infinitely long solenoid as a device that produces relatively uniform magnetic field. It was described in the lecture "Electromagnetism - Magnetism of Electric Current - Solenoid" of this course "Physics 4 Teens" on UNIZOR.COM.
The absolute value of an intensity of a uniform magnetic field B inside such a solenoid, was expressed as
B = μ·n·I
μ is permeability of the medium inside a solenoid,
n is the density of the wire loops making up a solenoid and
I is the electric current running through a solenoid.

As physicists usually do, we assume that our real solenoid, though not infinite, is long enough to use this formula for absolute value of a magnetic field intensity at all points inside a solenoid and it's zero outside.

While this methodology depends on the fact that the magnetic field we analyze is inside a solenoid, the final formula for energy density will depend only on the field's intensity and, as a field's local characteristic, will be the same, no matter what is the outside source of a magnetic field, whether it's a solenoid or a few permanent magnets, or the result of electromagnetic oscillations far from the source of these oscillations.

Consider a battery of voltage V that we connect to a solenoid of resistance R to create a magnetic field inside it. Electric current I(t) through a solenoid in the beginning equals to zero and, gradually, rises to some value Imax=V/R (Ohm's Law).

Since the electric current varies with time from 0 to Imax, the above formula for magnetic field intensity is time-dependent:
B(t) = μ·n·I(t)

Recall that changing electric current in a wire causes changing magnetic field around it that adversely affects the current, resisting its change. This is a self-induction effect described in the chapter "Electromagnetism - Self-Induction" of this course.

Therefore, the process of rising of an electric current through a solenoid requires some work performed by the battery against self-induction of the solenoid.
This work is converted into energy of the magnetic field inside a solenoid, and we will quantitatively evaluate it.

According to Faraday's Law of Induction, the electromotive force (EMF) U generated against the increasing electric current in a wire loop is proportional to a rate of change of the magnetic flux Φ1 flowing through this single loop:
U(t) = −dΦ1(t)/dt
Magnetic flux is related to a field intensity in a single loop of wire of area A as
Φ1(t) = B(t)·A
For a solenoid with total number of wire loops N the flux will be N times greater:
ΦN(t) = B(t)·A·N

Using the above stated dependency between field intensity B(t) and the electric current I(t), we can express the magnetic flux through a solenoid as
ΦN(t) = μ·n·I(t)·A·N

Obviously, if the length of a solenoid is l and the density of the wire loops is n, the total number of wire loops is
N = n·l

ΦN(t) = μ·n²·I(t)·A·l
Incidentally, the expression A·l is a volume of space inside a solenoid Vspace, so we write the above formula as
ΦN(t) = μ·n²·I(t)·Vspace

The power P(t) at any moment of time t needed to run the electric current (that is, the amount of work per unit of time) depends on the voltage, that is EMF U(t) needed for it and the electric current at the time I(t) as
P(t) = U(t)·I(t)
Using the expression above for the EMF, we derive an absolute value of power as a function of time
P(t) = dΦN(t)/dt·I(t) =
[μ·n²·I(t)·Vspace]·I(t) =
= μ·n²·Vspace·

The constants in front form a characteristic of a solenoid called inductance L=μ·n²·Vspace, so we simplify the expression for power as
P(t) = L·I(t)·[dI(t)/dt]

During the time period from t to t+dt the electric current will rise by dI=[dI(t)/dt]·dt and the work performed will be dW=P(t)·dt.
Therefore, to increase the electric current from I to I+dI we have to perform work equal to
dW = L·I·dI

The total amount of work W we have to perform to rise the electric current from 0 to Imax can be obtained by integrating the above expression by I:
W = [0,Imax]L·I·dI = ½L·I²max

When the electric current reaches Imax, the magnetic intensity B reaches its maximum value, and the potential energy accumulated in the magnetic field will be equal to work performed.

From the above formula for magnetic field intensity B=μ·n·I follows that
I = B/(μ·n)
Substituting this into an expression for total work performed,
W = ½L·B²/(μ·n)² =
= ½·μ·n²·Vspace·B²/(μ·n)² =
= ½·Vspace·B²/μ

Dividing the total work performed W (that is, the total potential energy accumulated by a solenoid during the process of rising the electric current) by the total volume inside a solenoid Vspace, we obtain the potential energy density PM of a magnetic field as a function of a local field characteristic - its intensity B:

PM = B²/(2μ)

We have used a simple kind of a magnetic field to derive the formula above - the static uniform finite field inside a solenoid. Notice, however, that the formula contains only the local property of the field - its intensity at any point B.
Even if the field is of a more complex kind (variable, non-uniform, infinite etc.), since only its intensity participates in the above expression for a potential energy density, the formula should be valid.
In particular, it's valid for a magnetic component of an oscillating electromagnetic field.

Combining the result for an electric component of electromagnetic field presented in the previous lecture with the formula above for magnetic component, we obtain a total potential energy density of an electromagnetic field

PE+M = ½[ε·E² + B²/μ]

Final comment about an oscillating electromagnetic field.
Once formed at the source, variable electric field possess certain potential energy.
Where is it going if the source stopped producing it?

Since variable electric field produces variable magnetic field, this energy is transferred to a newly formed variable magnetic field into its potential energy.

In turn, this potential energy of a variable magnetic field is used to generate a new variable electric field with its potential energy, which it uses to generate a new variable magnetic field etc.

That's how energy is delivered by an electromagnetic oscillations to some final destinations, where it might be used to convert it to some other forms.