If we have below relation in triangle $ABC$ what is $\hat{B}$ $$60\\120\\135\\150$$ the relation is $$a^2+c^2+3a^2c=(a+c)(ac+b^2)-3ac^2$$ I tried it many times ,but I get stuck ...may I use cosine theorem ?
Can someone give a ray of hope? please ... Thanks in advance.
Remark: It was given from one my colleague. I am in doubt with it, because if it was $$a^3+c^3+3a^2c=(a+c)(ac+b^2)-3ac^2$$ I can solve it easily, and $\hat{B}=120$ but in this case, I don't know what to do.
By the Law of cosines, $$b^2=a^2+c^2-2ac\cos(\hat{B}).$$ Hence, by the relation it follows that $$\frac{a^2+c^2+3a^2c-3ac^2}{(a+c)}-ac=b^2=a^2+c^2-2ac\cos(\hat{B})$$ which implies that $$\cos(\hat{B})=\frac{(a+c)(a-c)^2-a^2-c^2}{2ac(a+c)}.$$ This means that $\cos(\hat{B})$ depends on the values of $a$ and $c$.
P.S. Note that with the relation $a^3+c^3+3a^2c=(a+c)(ac+b^2)-3ac^2$, following the same approach we get $\cos(\hat{B})=-1/2$, that is $B=120^{\circ}$.