Please pay attention how I edited your writing to make the formula correct.
You start from
s = .
Multiply both sides by . You get then
= 2a + (n-1)d.
Next move the term (n-1)*d from the right side to the left side CHANGING ITS SIGN. You will get then
= 2a.
Last step multiply both sides by . You finally get
+---------------------------------------+
| a = . |
+---------------------------------------+
It is your answer.
You can transform this final formula further as you wish (using equivalent transformations, ONLY).
Solved and carefully explained.
///////////////
Ignore the post by @mananth, since it is TOTALLY WRONG.