What is the chromatic polynomial for $K_{2,3}$? [duplicate]

The correct answer is $x (x-1) (x^3-5 x^2+10 x-7)$. Here is another argument to prove it:

In any coloring of $K_{2,3}$ the two vertices in the first part will have either the same color or two different colors. So, in the first case, there are $x$ colors to choose the same color and $x-1$ colors to choose from to color the remaining three vertices. Thus there are $x(x-1)^3$ colorings of this first kind.

In the second case, there $x(x-1)$ ways to color the two vertices with different colors and we are left with $x-2$ colors to choose from to color the remaining three vertices. Thus, there are $x(x-1)(x-2)^3$ colorings of this second kind.

So, in total we have: $x(x-1)^3 + x(x-1)(x-2)^3$ colorings. After simplification you get your answer.

** Edit:

Also your method wields the same result:

So $P(K_{2,3},x)=\frac{P(C_4, x).P(K_2, x)}{P(K_1, x)}-\frac{P(K_3, x).P(K_3, x)}{P(K_2, x)}$

and we have:

$P(C_4,x)=x(x-1)(x^2-3x+3)$,

$P(K_3, x)= x(x-1)(x-2)$,

$P(K_2, x)= x(x-1)$

and $P(K_1, x)= x$

So, $P(K_{2,3},x)=\frac{x(x-1)(x^2-3x+3).x(x-1)}{x}-\frac{(x(x-1)(x-2))^2}{x(x-1)}$

$P(K_{2,3},x)=x(x-1)^2(x^2-3x+3)- x(x-1)(x-2)^2$

$P(K_{2,3},x)=x(x-1)[(x-1)(x^2-3x+3)- (x-2)^2 ]$

$P(K_{2,3},x)=x(x-1)[(x-1)(x^2-3x+3)- (x-2)^2 ]$

This will give you the correct answer.