Simplifying $\frac{b^2+c^2-a^2}{(a-b)(a-c)}+\frac{c^2+a^2-b^2}{(b-c)(b-a)}+\frac{a^2+b^2-c^2}{(c-a)(c-b)}$ 
Simplify $$\frac{b^2+c^2-a^2}{(a-b)(a-c)}+\frac{c^2+a^2-b^2}{(b-c)(b-a)}+\frac{a^2+b^2-c^2}{(c-a)(c-b)}\,.$$

I tried very hard but I am not being able to solve it easily I opened up everything and multiplied all of it and got the answer -2. But it took me 1 hour and I also made many silly mistakes. Is there a quicker way than brute force?
 A: Let
$$
f(a,b,c)=\frac{b^2+c^2-a^2}{(a-b)(a-c)}+\frac{c^2+a^2-b^2}{(b-c)(b-a)}+\frac{a^2+b^2-c^2}{(c-a)(c-b)}
$$Observe $f$ is invariant under permutations: $f(a,b,c)=f(b,c,a)=f(c,a,b)$, etc. Further, observe $f(0,1,2)=f(1,0,-1)=-2$. In other words, $f$ evaluates to $-2$ at $12$ points, and $12$ is greater than the sum of the degrees of the numerator and denominator. Thus $f$ is identically constant (provided no two of $a,b,c$ are equal).
A: Here is a solution using polynomials.  Note that $$\begin{align}S&:=\frac{b^2+c^2-a^2}{(a-b)(a-c)}+\frac{c^2+a^2-b^2}{(b-c)(b-a)}+\frac{a^2+b^2-c^2}{(c-a)(c-b)}
\\&=(a^2+b^2+c^2)\left(\frac{1}{(a-b)(a-c)}+\frac{1}{(b-c)(b-a)}+\frac{1}{(c-a)(a-b)}\right)
\\&\phantom{abc}-2\left(\frac{a^2}{(a-b)(a-c)}+\frac{b^2}{(b-c)(c-a)}+\frac{c^2}{(c-a)(c-b)}\right)\,.\end{align}$$
Consider
$$p(x):=\frac{(x-b)(x-c)}{(a-b)(a-c)}+\frac{(x-c)(x-a)}{(b-c)(b-a)}+\frac{(x-a)(x-b)}{(c-a)(c-b)}$$
and
$$q(x):=a^2\frac{(x-b)(x-c)}{(a-b)(a-c)}+b^2\frac{(x-c)(x-a)}{(b-c)(b-a)}+c^2\frac{(x-a)(x-b)}{(c-a)(c-b)}\,.$$
Observe that $p(x)$ and $q(x)$ are polynomials of degree at most $2$ such that $p(t)=1$ and $q(t)=t^2$ for $t\in\{a,b,c\}$.  Therefore, $p(x)=1$ and $q(x)=x^2$ identically.  If $[x^k]f(x)$ denotes the coefficient of $x^k$ in a polynomial $f(x)$, then we have
$$\begin{align}S&=(a^2+b^2+c^2)\Big([x^2]p(x)\Big)-2\Big([x^2]q(x)\Big)\\&=(a^2+b^2+c^2)\cdot 0-2\cdot 1=-2\,.\end{align}$$

Alternatively, note that
$$S=-\frac{P(a,b,c)}{Q(a,b,c)}\,,$$
where
$$P(a,b,c):=(b^2+c^2-a^2)(b-c)+(c^2+a^2-b^2)(c-a)+(a^2+b^2-c^2)(a-b)$$
and
$$Q(a,b,c):=(b-c)(c-a)(a-b)\,.$$
Note that when two variables are equal, $P(a,b,c)=0$.  Thus, $P(a,b,c)$ is divisible by $Q(a,b,c)$.  This shows that $$P(a,b,c)=k\,Q(a,b,c)$$ for some constant $k$.  Since $P(-1,0,+1)=4$ and $Q(-1,0,+1)=2$, we conclude that $k=2$, whence $S=-k=-2$.
A: Here we use $$ab(a-b)+bc(b-c)+ca(c-a)=a^2(b-c)+b^2(c-a)+c^2(a-b)=-(a-b)(b-c)(c-a)$$
In short we cab write $$\sum ab(a-b)=\sum a^2(b-c)=-(a-b)(b-c)(c-a)~~~~(1)$$
Then $$F=\frac{a^2+b^2-a^2}{(a-b)(a-c)}+\frac{c^2+a^2-b^2}{(b-a)(b-c)}+\frac{a^2+b^2-c^2}{(c-a)(c-b)}$$
$$\implies F=\frac{(a^2+b^2-a^2)(c-b)+(c^2+a^2-b^2)(a-c)+(a^2+b^2-c^2)(b-a)}{(a-b)(b-c)(c-a)}$$
upon simplification in the numerator six terms: $(\pm a^3\pm b^3 \pm c^3)$ will cancel each other, we will get $6+6=12$ terms in the numerator as
$$F=\frac{-\sum a^2(b-c)-\sum ab(a-b)}{(a-b)(b-c)(c-a)}= 2,$$
on using (1).
A: hint
Multiply the first term by $ b-c$ to get in the numerator
$$b^3+c^2b-a^2b-b^2c-c^3+a^2c$$
and the others, by permutation
$$c^3+a^2c-b^2c-c^2a-a^3+b^2a$$
$$a^3+b^2a-c^2a-a^2b-b^3+c^2b$$
The result is $  -2$.
A: First of all,  we must have $$a\ne b\ne c$$
Take out the terms containing $b^2$ in the numerator
$$b^2\left(-\dfrac1{(a-b)(c-a)}+\dfrac1{(b-c)(a-b)}-\dfrac1{(c-a)(b-c)}\right)$$
$$=b^2\cdot\dfrac{-(b-c)+c-a-(a-b))}{(a-b)(b-c)(c-a}$$
$$=\dfrac{2b^2(c-a)}{(a-b)(b-c)(c-a)}$$
$$\implies\frac{b^2+c^2-a^2}{(a-b)(a-c)}+\frac{c^2+a^2-b^2}{(b-c)(b-a)}+\frac{a^2+b^2-c^2}{(c-a)(c-b)}$$
$$=\dfrac2{(a-b)(b-c)(c-a)}\cdot\left( b^2(c-a)+c^2(a-b)+a^2(b-c)\right)$$
Now $b^2(c-a)+c^2(a-b)+a^2(b-c)$
$=b^2(c-a)+c^2a-bc^2+a^2b-ca^2$
$=b^2(c-a)+ca(c-a)-b(c^2-a^2)$
$=(c-a)(b^2-b(c+a)+ca)$
$=\cdots$
$=-(a-b)(b-c)(c-a)$
