At 40kHz the lousy old LM358 has a gain of about 25 when its supply is 30V.
With a supply of only 10V to 15V then the gain is about 20.
With a supply of less than 10V then its gain at 40kHz is probably less.
The LM386 is a power amp with internal negative feedback for a gain of 20. It is -3dB at 300kHz. A capacitor can be added to increase its gain to 200 where it is -3dB at 35kHz.
With a supply of only 10V to 15V then the gain is about 20.
With a supply of less than 10V then its gain at 40kHz is probably less.
The LM386 is a power amp with internal negative feedback for a gain of 20. It is -3dB at 300kHz. A capacitor can be added to increase its gain to 200 where it is -3dB at 35kHz.