if a,b,c are roots of a cubic equation then for the following question... If $a, b, c$ are roots of $x^3 -3x^2 + 2x +4 = 0$ and
$$y= 1 + \frac{a}{x-a} + \frac{bx}{(x-a)(x-b)} + \frac{cx^2}{(x-a)(x-b)(x-c)}$$
then value of $y$ at $x=2$ is:

We can reduce this to all be over the denominator $(x-a)(x-b)(x-c)$:
\begin{align}y&=1 + \frac{a}{x-a} + \frac{bx}{(x-a)(x-b)} + \frac{cx^2}{(x-a)(x-b)(x-c)}\\\\
&=\frac{(x-a)(x-b)(x-c)}{(x-a)(x-b)(x-c)}+\frac{a(x-b)(x-c)}{(x-a)(x-b)(x-c)}\\
&\qquad\qquad+\frac{bx(x-c)}{(x-a)(x-b)(x-c)}+\frac{cx^2}{(x-a)(x-b)(x-c)}\\\\
&=\frac{(x-a)(x-b)(x-c)+a(x−b)(x−c)+bx(x−c)+cx^2}{(x-a)(x-b)(x-c)}\\\\
&=\frac{-a b c + a b x + a c x - a x^2 + b c x - b x^2 - c x^2 + x^3 +ab c - ab x - ac x + ax^2 +bx^2-bcx+cx^2}{(x-a)(x-b)(x-c)}\\\\
&=\frac{x^3+(-a-b-c+a+b+c)x^2+(ab+ac+bc-ab-ac-bc)x+(-abc+abc)}{(x-a)(x-b)(x-c)}\\
&=\frac{x^3}{(x-a)(x-b)(x-c)}\end{align}
Now, we know that $(x-a)(x-b)(x-c)=x^3−3x^2+2x+4$, and so we have $$y=\frac{x^3}{x^3-3x^2+2x+4}$$
Therefore, when $x=2$, \begin{align}y&=\frac{2^3}{2^3-3\times 2^2+2\times 2+4}\\
&=\frac{8}{8-12+4+4}\\
&=\frac{8}{4}\\
&=2\end{align}
