Step 1: Understand the given problem:
We are given an arithmetic progression (AP) where:
- The sum of the first three terms is 30,
- The sum of the last three terms is 36,
- The first term \( a = 9 \).
We need to find the number of terms in the AP.
Step 2: Use the formula for the sum of the first \( n \) terms of an AP:
The sum of the first \( n \) terms of an AP is given by the formula:
\[
S_n = \frac{n}{2} \left( 2a + (n - 1) d \right)
\]
where \( a \) is the first term, \( d \) is the common difference, and \( n \) is the number of terms.
Step 3: Sum of the first three terms:
The sum of the first three terms is 30, so we can use the formula for the sum of the first three terms:
\[
S_3 = \frac{3}{2} \left( 2a + (3 - 1) d \right) = 30
\]
Substitute \( a = 9 \) into the equation:
\[
\frac{3}{2} \left( 2(9) + 2d \right) = 30
\]
Simplify:
\[
\frac{3}{2} \left( 18 + 2d \right) = 30
\]
Multiply both sides by 2:
\[
3(18 + 2d) = 60
\]
Simplify:
\[
54 + 6d = 60
\]
\[
6d = 6
\]
\[
d = 1
\]
Thus, the common difference \( d = 1 \).
Step 4: Sum of the last three terms:
The sum of the last three terms is 36. Let the total number of terms be \( n \), so the last three terms are the terms \( a_{n-2}, a_{n-1}, a_n \). The sum of these terms is:
\[
a_{n-2} + a_{n-1} + a_n = 36
\]
The general formula for the \( n \)-th term of an AP is \( a_n = a + (n-1)d \). Therefore:
\[
a_{n-2} = a + (n-3)d, \quad a_{n-1} = a + (n-2)d, \quad a_n = a + (n-1)d
\]
Substitute these into the equation for the sum of the last three terms:
\[
(a + (n-3)d) + (a + (n-2)d) + (a + (n-1)d) = 36
\]
Simplify:
\[
3a + (3n - 6)d = 36
\]
Substitute \( a = 9 \) and \( d = 1 \) into this equation:
\[
3(9) + (3n - 6)(1) = 36
\]
\[
27 + 3n - 6 = 36
\]
\[
3n + 21 = 36
\]
\[
3n = 15
\]
\[
n = 5
\]
Step 5: Conclusion:
The number of terms in the AP is \( \boxed{5} \).