We have,
first term A=a
Common difference D=?
And nth term An=b
Then,
We know that,
An=A+(n−1)D
⇒b=a+(n−1)D
⇒(b−a)=(n−1)D
⇒D=(b−a)(n−1)