<s>[INST] Finding $a$ such that $f(x)=a\,|x-b|$ is satisfied by $(2,1)$ and $(10,3)$ 
I was given the following equation: $$f(x)=a\,|x-b|$$ and the information that both $(2,1)$ and $(10,3)$ are solutions for the equation. The question asked to solve for $a$.

This is what I did: $$a=\frac{1}{2-b}\\[10pt]a=\frac{-1}{2-b}\\[10pt]a=\frac{-3}{10-b}\\[10pt]a=\frac{3}{10-b}$$ all of these seem to be possible solutions for the equation, I just need to find the one that will work with both solution sets. I solved and got multiple values for a and b. The ones that worked for both ordered pairs were the solutions $a=\frac12 \text{ and } b=4$ and $a=\frac14\text{ and } b=-2$.
I feel pretty confident about my answer (perhaps wrongly so :) ) but is there a faster, more efficient way to do this?
 [/INST] I see two cases.  $b\in(2,10)$ and $b\notin(2,10)$
$f(b) = 0$
In the case that $b$ is not in $(2,10)$ we construct the line through the two points.    $b$ is the $x$-intercept of this line.  $|a|$ is the slope.
$|a| = \frac {3-1}{10-2} = \frac 14$
Since this slope is postive, $a > 0, b < 2$
$0 = \frac 14 (x-2) + 1\\
0 = \frac 14 (x +2)\\
b = -2\\
f(x) = \frac 14 |x+2|$
In the case that $b\in(2,10)$  The line needs to drop one unit in the interval and then rise 3 units.
$a = \frac {3+1}{10-2} = \frac 12$
And we have a negative slope to the left of $b$ and a postive slope to the right.
$0 = \frac 12 (x-10) + 3\\
0 = \frac 12 (x-4)
b = 4$
or
$0 = \frac 12 (x-2) + 1\\
0 = \frac 12 (x-4)
b = 4$
$f(x) = \frac 12 |x-4|$
</s>