I have a cubic polynomial $f(x)=x^3+px^2+qx+72$ which is divisible by both $x^2+ax+b$ and $x^2+bx+a$ (where a,b,p,q are constants and a$ \neq $b).I have to find the sum of the squares of the the roots of the cubic polynomial.
I tried to attempt it like this.
Since the quadratics divide the polynomial its roots must be the same as the roots of the quadratics.
Let the roots of the first quadratic be A and B and that of second quadratic be D and E.
Now for having 3 roots of the cubic polynomial one root of the 2 quadratics must be common.Then suppose B=D.
Now from the first quadratic $A+B=-a$ and $AB=b$.From second quadratic $B+E=-b$ and $BE=a$.
We need the sum of squares of the roots of the cubic polynomial i.e. $A^2+B^2+E^2$.We have $A^2+B^2+E^2=(A+B+E)^2-2(AB+BE+AE)$.We have $A+B+E=-p$ and $AB+BE+AE=q$.So $A^2+B^2+E^2=-p-2q$.
I don't know how to proceed.