For the function \( f(x) \) to be defined, two conditions must be met.
First, the expressions inside the square roots must be non-negative.
Condition 1: \( x^2 + x \ge 0 \implies x(x+1) \ge 0 \). This holds for \( x \le -1 \) or \( x \ge 0 \).
Condition 2: \( x^2 - x \ge 0 \implies x(x-1) \ge 0 \). This holds for \( x \le 0 \) or \( x \ge 1 \).
We must satisfy both conditions simultaneously. The intersection of these intervals is \( (-\infty, -1] \cup \{0\} \cup [1, \infty) \).
Second, the argument of the logarithm must be strictly positive.
Condition 3: \( \sqrt{x^2+x} + \sqrt{x^2-x}>0 \).
The sum of two square roots (which are non-negative) is always non-negative.
The sum is zero only if both terms are zero.
\( \sqrt{x^2+x} = 0 \) and \( \sqrt{x^2-x} = 0 \). This occurs only when \( x = 0 \).
Since the argument of the logarithm must be strictly positive, we must exclude \( x = 0 \).
Combining the result from the square root conditions with the logarithm condition, we exclude \( x=0 \).
The final domain is \( (-\infty, -1] \cup [1, \infty) \).