Find the sum of the squares of the three solutions of the equation x3+3x2−7x+1=0.

Assume the equation has three roots a,b and c:

then
(x-a)(x-b)(x-c)=0
x³-(a+b+c)x²+(ab+bc+ca)x-abc=0
which means
(a+b+c)=-3 (negative of coeff.of x²)
(ab+bc+ca)=-7 (coeff. of x)

Hence
a²+b²+c²
=(a+b+c)²-2(ab+bc+ca)
=3²-2(-7)
=9-(-14)
=23