The ductus arteriosus gets functionally closed through contraction of its muscular wall almost immediately after birth.
However anatomical closure occurs only 2-3 weeks after birth
in fetal life prostaglandins relax the vascular smooth muscle and keep the ductus arteriosus open
After birth there is high oxygen content in the blood due to ventilation in the lung
This is inhibitis the production of prostaglandins.
The ductus closes due to vascular smooth muscle contraction leaving a ligamentous remnant known as ligamentum arteriosum