Let $(x - 1)^2-2|x-1|+|k-3|=0$ be a quadratic equation. If ‘$x$’ and ‘$k$’ are both integers, then the distinct number of integer values of $x$ satisfying the equation is?
I thought to proceed like this: $$(x - 1)^2-2|x-1|+|k-3|=0\Longrightarrow |x - 1|^2-2|x-1|+|k-3|=0$$ Let us assume $|x-1|=y$. Then $$|x - 1|^2-2|x-1|+|k-3|=0 \Longrightarrow y^2-2y+|k-3|=0$$ Then I thought of making two cases for $|k-3|$, i.e., when $k \geq3$ and when $k \lt 3$ but I do not see a way to find the possible values of $y$ and then for $x$. Please help!
Thanks in advance!
It can be a bit easier to sort out the solutions of the equation by considering the properties of the curve in question. Since absolute-values appear in the expression, we might first look at the curve $ \ y \ = \ (x – 1)^2 \ – \ 2·|x–1| \ \ . $ For $ \ x \ \ge \ 1 \ \ , $ this is $ \ y \ = \ (x – 1)^2 \ – \ 2·(x–1) \ = \ x^2 - 4x + 3 \ \ , $ for which the curve is an "upward-opening" parabola with its vertex at $ \ x \ = \ 2 \ \ . $ With $ \ x \ \le \ 1 \ \ , $ we have $ \ y \ = \ (x – 1)^2 \ + \ 2·(x–1) \ = \ x^2 - 1 \ \ , $ an "upward-opening" parabola with its vertex at $ \ x \ = \ 0 \ \ . $ So we have a "W-shaped" curve formed from parts of two parabolas "joined" at the symmetry axis $ \ x \ = \ 1 \ \ . $
We now include the absolute-value "constant term" which tells us the "vertical shift" to be made to the curve we've described. For $ \ y \ = (x – 1)^2 \ – \ 2|x–1| \ + \ |k–3| \ \ , $ the "join" of the two parts occurs at $ \ ( \ 1 \ , \ |k - 3| \ ) \ \ . $ The vertices of the individual parabolas $ \ x^2 - 4x + 3 \ $ and $ \ x^2 - 1 \ $ are both at $ \ y \ = \ -1 \ \ , $ so the "twin" vertices of our "W-curve" are located at $ \ ( \ 0 \ , \ |k - 3| - 1 \ ) \ $ and $ \ ( \ 2 \ , \ |k - 3| - 1 \ ) \ \ . $
The absolute-value constant term also imposes a symmetry on the curve, in that the curve is in the same position for equal values of $ \ |k - 3| \ \ $ and thus there is a symmetry for the behavior of the curve about the value $ \ k \ = \ 3 \ \ . $ For $ \ k \ = \ 3 \ \ , $ the "join-point" is on the $ \ x-$axis at $ \ ( 1 \ , \ 0 ) \ \ $ and the vertices are $ \ ( \ 0 \ , \ - 1 \ ) \ $ and $ \ ( \ 2 \ , \ - 1 \ ) \ \ . $ This tells us that there must be two other $ \ x-$intercepts found from the zeroes of $$ x^2 - 4x + 3 \ \ = \ \ (x \ - \ 1)·(x \ - \ 3) \ \ \ \text{and} \ \ \ x^2 - 1\ \ = \ \ (x \ - \ 1)·(x \ + \ 1) \ \ , $$ those being $ \ (-1 \ , \ 0) \ $ and $ \ (3 \ , \ 0) \ \ . $
For $ \ k \ = \ 2 \ $ or $ \ 4 \ \ , $ we have $ \ |k - 3| \ = \ +1 \ \ , $ which now places the twin vertices on the $ \ x-$axis at $ \ (0 \ , \ 0) \ $ and $ \ (2 \ , \ 0 ) \ \ . $ So there are no other $ \ x-$intercepts for our curve at these values of $ \ k \ \ . $ That brings our search to an end: for $ \ k \ < \ 2 \ $ or $ \ k \ > \ 4 \ \ , $ the two vertices will only be "raised higher" above the $ \ x-$axis, making no other integer (or real-number, for that matter) solutions for the equation possible.
Hence, the number of distinct integer solutions for $ \ (x – 1)^2 \ – \ 2·|x–1| \ + \ |k - 3| \ = \ 0 \ \ $ is five:
$ \mathbf{k \ = \ 3 \ \ : \ } \quad x \ = \ -1 \ , \ +1 \ , \ +3 \ \ \ ; \ \ \ \mathbf{k \ = \ 2 \ , \ 4 \ \ : \ } \quad x \ = \ 0 \ , \ +2 \ \ \ . $
(Because these are consecutive integers, there are no other solutions "lurking".)