Wa `alaykum As-Salamu waRahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
Dear questioner, we would like to thank you for the great confidence you place in us, and we implore Allah Almighty to help us serve His cause and render our work for His Sake.
Answering your question, Dr. Mohammad S. Alrahawan, Associate Professor at the department of Islamic Studies in English, Al-Azhar University, Egypt, states:
If you miss a constituent element of prayer such as ruku` or a prostration and you discover this subtract before making your final tasleem, just add a new rak`ah and recite tashahhud and tasleem. At the end, you should make sujud as-sahaw (prostration for being forgetful).
If you discover that immediately after tasleem, you can add a full rak`ah and recite tashahhud and tasleeem in addition to two prostrations for forgetfulness.
In case you miss a supererogatory act of prayer such as the middle tashahhud of a prayer consisting of four rak`ahs, you just make two prostrations for forgetfulness.
Allah Almighty knows best.