The Gemaruh states that just like the Torah was given in 40 days, so too the Neshama is created in 40 days ( " Neshama Nozrah " ). Rashi on the spot quotes the Gemaruh in Niddah the a Fetus does not take shape until 40 days after conception. I don't see the connection between the body taking shape, and the creation of the Neshama.
The Gemarauh in Niddah 16B talks about, at the time of conception ( 40 days before the fetus takes shape ), that an Angel takes a drop from conception , and brings it too Hash-m, and it is at that moment in time that it is decided who he is going to marry, rich, house, etc The Gemaruh in Sanhedrin 110B talks about, when does a child merit Olam Haba, and Ravina answers at the time of conception. And Rashi on the spot explains that even if the mother miscarries, the baby will merit Olam Haba
The Gemaruh in Ketuvot 111A says such a fetus merits Techiat Hamietim, in the name of Rebbie.
Rav Moshe Feinstein, Zt"L, quotes this as Halacha in Egeret Moshe ( Yoreh Deah part 3 siman 138), that a baby after conception merits Olam Haba and Techiat Hamietim, even if the mother miscarries, Lo Aleinu. From all these sources, it would seem that the Neshama is sent down to this world at the moment of conception.
I thought maybe to explain this, that the Neshama is in fact created at time of conception, but it can not be placed into child's body until it is formed , 40 days. As we find by Adam Harieshon, that Hash-m blew the Neshama into his nostrils. But it doesn't follow with the Gemaruh's Loshon " Neshama Nozrah BeArbaim " - it is created on the 40th day ????
Shmuel Katz
(a) With regard to your suggestion, I think it is clear that the Neshamah is around even *before* the child's birth; all Neshamos were created with the world, see Rashi Nidah 13b DH she'be'Guf.
(b) As for when the Neshamah is put into the body, the Gemara in Sanhedrin 91b cites an argument between Rebbi and Antoninus as to when a fetus gets a Neshamah -- from the time of "Yetzirah" or from the time of "Pekidah." Rebbi concludes that Antoninus is correct, the Neshamah comes at the earlier of the two, which is "Pekidah."
Rashi there writes that Pekidah means when the angel asks Hash-m what the baby will be, while Yetzirah means when the skin forms on the bones. The RAMAH says this is "but a dream"; the true explanation for Pekidah is the time of conception (and Yetzirah is presumably 40 days after conception, as we find in Sotah 2a). The MARGOLIYOS HA'YAM there refers to our Gemara, which seems to contradict the Ramah. This, in fact, must be Rashi's source for saying that Pekidah means when the angle brings the drop before Hash-m to ask what the baby will be. (Until the fetus if 40 days old, it is still called a "drop" since it is indeterminate whether it will be a boy or girl. The Gemara in Nidah 16b does not mention that the drop is brought to Hash-m 40 days before its Yetzirah.)
Rashi here means that our Gemara assumes the Neshamah would not be inserted before the completion of the "Tzurah" of the child.
The Gemaras in Kesuvos and in Sanhedrin 110b do not necessarily mean that a child miscarried during its initial 40 days will have Olam ha'Ba. (Rashi in Sanhedrin 110b indeed mentions "she'Niklat ha'Zera b'Mei'ei Ishah," implying that the fetus has Olam ha'Ba from the time of conception. Perhaps a Neshamah is reserved for the fetus even though it did not get a chance to enter its body. Alternatively, Niklat here may mean 40 days, when it is decided what the child will be.)
(c) It is not clear how the Ramah will learn the Gemara in Menachos. Perhaps he will that since the Gemara cannot mean that the Neshamah is created after 40 days (since it has been around since Beri'as ha'Olam, as I wrote above in (a)), it must mean that the *body* is created in 40 days, and the world Neshamah means the body and Neshamah as a group.
Be well,
M. Kornfeld