<s>[INST] 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?
 [/INST] 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$.
</s>