To solve the equation \( \log_3(x^2 - 5x + 4) - \log_3(x - 4) = 2 \), we can apply the properties of logarithms. Specifically, we can use the property that states that the difference of logs can be rewritten as the log of the quotient:
\[ \log_3 \left( \frac{x^2 - 5x + 4}{x - 4} \right) = 2 \]
Now, we can exponentiate both sides to eliminate the logarithm:
\[ \frac{x^2 - 5x + 4}{x - 4} = 3^2 \] \[ \frac{x^2 - 5x + 4}{x - 4} = 9 \]
Next, we can multiply both sides by \( x - 4 \) (assuming \( x - 4 \neq 0 \)):
\[ x^2 - 5x + 4 = 9(x - 4) \] \[ x^2 - 5x + 4 = 9x - 36 \]
Now, let's rearrange the equation:
\[ x^2 - 5x + 4 - 9x + 36 = 0 \] \[ x^2 - 14x + 40 = 0 \]
Now we will use the quadratic formula to solve for \( x \):
\[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]
Here, \( a = 1, b = -14, c = 40 \):
\[ x = \frac{-(-14) \pm \sqrt{(-14)^2 - 4 \cdot 1 \cdot 40}}{2 \cdot 1} \] \[ x = \frac{14 \pm \sqrt{196 - 160}}{2} \] \[ x = \frac{14 \pm \sqrt{36}}{2} \] \[ x = \frac{14 \pm 6}{2} \]
This gives us two possible solutions:
- \( x = \frac{20}{2} = 10 \)
- \( x = \frac{8}{2} = 4 \)
However, we need to check that these solutions are valid in the context of the original logarithmic equation, especially considering the domain restrictions.
Since \( \log_3(x - 4) \) requires \( x - 4 > 0 \), this means \( x > 4 \).
- \( x = 10 \) is valid.
- \( x = 4 \) is not valid since it makes \( \log_3(0) \).
Thus, the only solution to the equation is:
\[ \boxed{10} \]