Answer: \(M = \frac{\mu_0 N_1 N_2 A}{l}\)
Assume the solenoid is long (ideal), so that its field is uniform inside and the whole flux of the solenoid passes through the secondary coil wound around its centre.
Let a current \(I_1\) flow in the primary (the solenoid). Number of turns per unit length \(n = \frac{N_1}{l}\).
Magnetic field inside the solenoid:
\(B = \mu_0 n I_1 = \frac{\mu_0 N_1 I_1}{l}\)
Flux through each turn of the secondary coil (cross-sectional area A):
\(\Phi = BA = \frac{\mu_0 N_1 I_1 A}{l}\)
Total flux linked with the \(N_2\) turns of the secondary:
\(N_2\Phi = \frac{\mu_0 N_1 N_2 A I_1}{l}\)
By definition, mutual inductance \(M = \frac{N_2 \Phi}{I_1}\). Therefore
\(M = \frac{\mu_0 N_1 N_2 A}{l}\)
Since the field outside an ideal solenoid is zero, this result does not depend on the shape or size of the secondary coil, as long as it encloses the solenoid's cross-section. If the solenoid has a core of relative permeability \(\mu_r\), \(M = \frac{\mu_0 \mu_r N_1 N_2 A}{l}\).