Upvote:2
If all your flights are booked on the same ticket, this means that the minimum connection time for this connection is met (unless your travel agent circumvented some rules, which they normally not do).
Passport checks in Dusseldorf are usually quite quick. Please keep the comments to your original post in mind - you will need a "proper" Schengen visa for the trip since you have an intra-Schengen leg. In any case, I would suggest the following:
Upvote:3
40 minutes could be enough but it could become scarce. As your second leg is a domestic Schengen flight, you will need to get through security and passport check. With only 40 minutes between the flights it's likely to miss the flight to Munich.