The first term of an AP is -5 and the last term is 45. If the sum of the terms of the AP is 120, then find the number of terms and the common difference.

$\\Given that a = - 5, a\textsubscript{n} = 45, S\textsubscript{n} = 120\\ a\textsubscript{n}= 45\\ a + (n - 1) \times d = 45 (using a\textsubscript{n} = a + (n-1).d)\\ -5 + (n-1) \times d = 45\\ (n - 1) \times d = 50 \ldots (1)\\ S\textsubscript{n} = 120\\ {{S}_{n}}=\frac{n}{2}\left[ 2a+\left( n-1 \right)d \right] = 120\\ \frac{n}{2}\left[ -10+50 \right]=120 Using (1)\\ n \times (40) = 240\\ n = 24/4 = 6\\ Number of terms (n)= 6\\ Put n = 6 in (1)\\ (6 - 1) \times d = 50\\ 5d = 50\\ d = 10\\ Common difference = 10\\$