To solve for \( f(g(-1)) \) and then subsequently evaluate \( f(f(g(-1))) \), we will follow these steps:
- Calculate \( g(-1) \).
- Use the result from step 1 to calculate \( f(g(-1)) \).
- Finally, use the result from step 2 to calculate \( f(f(g(-1))) \).
Step 1: Calculate \( g(-1) \)
The function \( g(x) \) is defined as:
\[ g(x) = 5x - 4 \]
Substituting \( x = -1 \):
\[ g(-1) = 5(-1) - 4 = -5 - 4 = -9 \]
Step 2: Calculate \( f(g(-1)) = f(-9) \)
Next, we will substitute the value of \( g(-1) \) into the function \( f(x) \). The function \( f(x) \) is defined as:
\[ f(x) = x^2 + 2x - 5 \]
Now substituting \( x = -9 \):
\[ f(-9) = (-9)^2 + 2(-9) - 5 \] \[ = 81 - 18 - 5 \] \[ = 81 - 18 - 5 = 58 \]
Step 3: Calculate \( f(f(g(-1))) = f(58) \)
Now we will use the result from the previous step to find \( f(58) \):
\[ f(58) = 58^2 + 2(58) - 5 \] \[ = 3364 + 116 - 5 \] \[ = 3364 + 116 - 5 = 3475 \]
Thus, the value of \( f(f(g(-1))) \) is:
\[ \boxed{3475} \]