# [Math] Domain of a function by inspection

functions

Find the domain of a function $f(x)=\sqrt{x^2-5x+4}$.

My solution: Step 1: $x^2-5x+4 \geq0$. Step 2: $(x-4)(x-1)\geq 0$. Step 3: $x\geq 4$ OR $x\geq 1$, but $x\geq 1$ does not satisfy the inequality of step 2, therefore $x\geq4$.
Solution by inspection: Any negative number when squared is positive$(x^2)$, same number when multiplied by $-5$ is also positive$(-5x)$, so the inequality of step 1 holds for all negative numbers, but the same may not be true for all positive numbers. So we say the $x^2$ has to be greater than OR equal to $5x$, only then $x^2-5x\geq0$, so $x(x-5)\geq0$ which gives either $x\geq0$ OR $x\geq5$ that means $0$ and all the positive numbers.

My question: Why the first method of finding the domain mathematically/algebraically failed? Do we always first try to find the domain by inspection and then go for the algebraic solution?

The problem is to find the domain of the function $f(x)$, where $$f(x)=\sqrt{x^2-5x+4}.$$

The factoring procedure that you used is sensible, particularly when factoring is easy. We have $$x^2-5x+4=(x-1)(x-4).$$ As you observed, the number $x$ is in the domain of $f$ iff $(x-1)(x-4) \ge 0$. This is the case if (i) both $x-1$ and $x-4$ are $\ge 0$ and (ii) if both $x-1$ and $x-4$ are $\le 0$.

Case (i) happens if $x \ge 1$ and $x\ge 4$, or more simply if $x \ge 4$.

Case (ii) happens if $x \le 1$ and $x \le 4$, or more simply if $x \le 1$.

Thus the domain of $f(x)$ is the union of the two sets that correspond to cases (i) and (ii). Compactly, we could write that the domain is $$(-\infty,1] \cup [4,\infty).$$

Comment: A product like $(x-a)(x-b)(x-c)\cdots$ cannot change sign except possibly at $a, b, c, \cdots$. We have written possibly because for example $(x-1)(x-1)(x-2)$ does not change sign at $x=1$.

So to find out about the sign of $(x-1)(x-4)$ it would be enough to test at some $x<1$, some $x$ between $1$ and $4$, and some $x$ greater than $4$. Draw a picture of the number line to help decide on the test points, and to give concreteness to the problem. Playing with inequalities can be treacherous, all inequalities kind of look the same. Without a geometric context, mistakes are all too likely. I have a feeling that you will find there are fewer accidents if you use the above testing procedure, at least as backup.

The "inspection" procedure that you used failed for the same reason that the systematic procedure failed. In the inspection procedure, you write "$x(x-5) \ge 0$ which gives either $x \ge 0$ or $x \ge 5$, that means $0$ and all the positive numbers." This is not true, the product is $\ge 0$ when both $x \ge 0$ and $x \ge 5$ hold. In particular, $x(x-5)$ is negative at, for example, $x=2$. But anyway, the sign of $x(x-5)$ is irrelevant. We are interested in whether $x^2-5x +4 \ge 0$, that is, whether $x^2-5x \ge -4$. The sign of $x(x-5)$ does not supply the needed information.

An inspection procedure can, in some cases, succeed. But the systematic algebraic/geometric method is far more reliable. Another way of looking at things is to look at the parabola $y=x^2-5x+4$. This parabola is upward-facing, and crosses the $x$-axis at $x=1$ and $x=4$. So $x^2-5x+4$ is negative in the interval $(1,4)$.