In an arithmetic sequence, each term can be expressed as:
\[ a_n = a_1 + (n-1)d \]
where \( a_n \) is the nth term, \( a_1 \) is the first term, \( d \) is the common difference, and \( n \) is the term number.
Given:
- The second term \( a_2 \) is 9.
- The fourth term \( a_4 \) is 21.
We can set up the equations for the second and fourth terms using the formula:
-
For \( a_2 \): \[ a_1 + d = 9 \quad (1) \]
-
For \( a_4 \): \[ a_1 + 3d = 21 \quad (2) \]
Now, we can solve these equations simultaneously. First, we'll eliminate \( a_1 \) by rearranging equation (1):
From (1): \[ a_1 = 9 - d \]
Now substitute \( a_1 \) into equation (2):
\[ (9 - d) + 3d = 21 \]
Combine like terms:
\[ 9 + 2d = 21 \]
Now, isolate \( d \):
\[ 2d = 21 - 9 \] \[ 2d = 12 \] \[ d = 6 \]
Now that we have \( d \), we can substitute it back into equation (1) to find \( a_1 \):
\[ a_1 + 6 = 9 \] \[ a_1 = 9 - 6 = 3 \]
Now we have \( a_1 = 3 \) and \( d = 6 \).
To find the 40th term \( a_{40} \), we use the formula:
\[ a_{40} = a_1 + (40-1)d \] \[ a_{40} = 3 + 39 \cdot 6 \] \[ a_{40} = 3 + 234 \] \[ a_{40} = 237 \]
Thus, the 40th term in the sequence is:
\[ \boxed{237} \]