(x-a)(x-b)=x2+px+5=x2-(a+b)x+ab. [a2+ap+5=0=b2+bp+5=0 because a and b are roots.]
a+b=-p and ab=5. x=(-p±√(p2-20))/2, so a=(-p+√(p2-20))/2 and b=(-p-√(p2-20))/2.
(a+b)2=a2+2ab+b2=(-p)2=p2, so 10a2+10b2+20ab=10p2,
10a2+10b2=10p2-20ab=10p2-100, 10a2+10b2-3=10p2-103.
Not sure if this what you want.