Step 1: Understanding the problem:
We are given an arithmetic progression (AP) with the following conditions:
- The sum of the first three terms is 30.
- The sum of the last three terms is 36.
- The first term \( a = 9 \).
We are asked to find the number of terms in the AP.
Step 2: Sum of the first three terms:
The sum of the first three terms of an AP is given by the formula:
\[
S_3 = \frac{n}{2} \left( 2a + (n-1)d \right)
\]
where \( n \) is the number of terms, \( a \) is the first term, and \( d \) is the common difference.
For the sum of the first three terms:
\[
S_3 = a + (a + d) + (a + 2d)
\]
Substituting \( a = 9 \), we get:
\[
S_3 = 9 + (9 + d) + (9 + 2d) = 30
\]
Simplifying:
\[
27 + 3d = 30
\]
\[
3d = 3
\]
\[
d = 1
\]
Thus, the common difference \( d = 1 \).
Step 3: Sum of the last three terms:
Let the total number of terms in the AP be \( n \). The last three terms are \( a + (n-3)d \), \( a + (n-2)d \), and \( a + (n-1)d \). The sum of these last three terms is:
\[
S_{\text{last 3}} = (a + (n-3)d) + (a + (n-2)d) + (a + (n-1)d)
\]
Substituting \( a = 9 \) and \( d = 1 \), we get:
\[
S_{\text{last 3}} = (9 + (n-3)) + (9 + (n-2)) + (9 + (n-1))
\]
Simplifying:
\[
S_{\text{last 3}} = 3 \times 9 + (n-3 + n-2 + n-1) = 27 + 3n - 6 = 36
\]
\[
3n + 21 = 36
\]
\[
3n = 15
\]
\[
n = 5
\]
Thus, the number of terms in the AP is \( n = 5 \).
Conclusion:
The number of terms in the AP is \( 5 \).