To get change in your surname, you will have to follow three step procedure.
1. Firstly, you will have to make an affidavit in legal way and get it notarized by a Notary. You will have to mention in it your old name, father's name, your date of birth, address, and your changed surname. A proper non judicial stamp paper is to be used for this purpose.
Language of the affidavit may be like this:
I .......(name with old surname).....have changed my name from ......(old name)...... to ........(New name)......by affidavit sworn before the Public Notary, at .....(place).....on ........(date).......... Henceforth, I shall be known as .........(New name)........For all purpose in future.
You will have to mention reason also behind name change.
2. In the next step you will have to publish advertisement stating your name change in two newspapers I.e. one local and one of national repute. These newspapers must be on roll of Gazette of India.
You will have to use the language of the affidavit for this purpose. Keep these newspaper clippings with you.
3. In the third and last step, you will have to notify you name in the Gazette of India. Every State has its own Gazette. Visit a Gazette office either State or Central on any working day and fill up the form for the purpose and pay the requisite fee along with newspaper cutting and other documents like Date of Birth, address proof etc. After approval of application, usually changed surname will get published in Gazette within 8-10 weeks.
After publication of changed name in Govt. Gazette, this procedure get completed. Now you can use your changed surname for all purpose and also change in all documents except academic documents.
You will have to submit copy of Gazette notification along with educational documents.
In UPSC you should submit the copy of Gazette having changed name published with the educational documents. Only court affidavit will not work.