## Magnetic vector potential

The calculation of magnetic field in BiotSavart is based on the magnetic vector potential ** A**.
The magnetic flux density

*is the curl of the vector potential:*

**B**
The magnetic vector potential is defined up to a gauge transformation (the addition of the gradient
of an arbitrary scalar function). BiotSavart uses
the so-called *Coulomb* gauge, in which the vector potential has no divergence:

In this gauge the vector potential satisfies the following equation of the Poisson type:

where * J* is the known current density. The solution of the equiation
is

This fundamental relation gives rise to closed-form expressions for the magnetic field of loops and line segments. These expressions are used to calculate the magnetic field of solenoids (approximated as a collection of loops) and wires (approximated as a collection of straight line segments).