The magnetic field B within the solenoid having n turns per metre length and carrying a current of i ampere is given by