The B field at the center of a stack of N circular loops each carrying current I is B = mu0 * N * I / (2a) where a is the radius of the loop, derived using Biot-Savart law. The B field inside a solenoid is B = mu0 * N * I / l where l is the length of the solenoid, derived using Ampere's law. Yet everywhere I searched it is always stated that a solenoid can be thought of as a stack of circular loops. Then why are the results different? Why can't I use Ampere's law on the stack of loops to get mu0 * N * l? It is also stated that in a solenoid the B field at the ends of the solenoid is 1/2 of the B field inside the solenoid, or B = mu0 * N * I / (2l) Could that be it? That is, the B field calculated using Biot-Savart law for stack of loops is the same as that for a solenoid B field but ONLY at the ends of the solenoid? I am citing Figures 28.14 and 28.24 in University Physics by Young and Freedman, 13th edition.