Why did Jesus spend forty days with the apostles after his resurrection?
Jesus spent forty days with the apostles to show Himself alive after His death, burial, and resurrection by many infallible proofs, and to speak of things pertaining to the kingdom. He used that time to explain truths the apostles had not previously comprehended, especially concerning Israel's kingdom and Messiah's rule.
Les explains from Acts 1:3 that after His passion—His death, burial, and resurrection—Jesus showed Himself alive to the Eleven by many infallible proofs, being seen of them forty days and speaking of things pertaining to the kingdom. During those forty days in His resurrection body, He was explaining things the apostles had not previously comprehended. The context shows the Eleven asked whether He would at that time restore the kingdom to Israel. They knew Israel's past glory under David and Solomon and anticipated the greater glory of Messiah's rule and reign. So the forty days focused on kingdom truth and revealed what they had not yet understood.