If #alpha and beta # are the roots of the equation #x^2-p(x+1)-c=0# or
#x^2-px-(p+c)=0#
then
#alpha+beta=pand alphabeta=-(p+c)#
So #c=-alpha-beta-alphabeta#
Now the numerical value of #(alpha^2+2alpha+1)/(alpha^2+2alpha+c)+(beta^2+2beta+1)/(beta^2+2beta+c)#
#=(alpha^2+2alpha+1)/(alpha^2+2alpha-alpha-beta-alphabeta)+(beta^2+2beta+1)/(beta^2+2beta-alpha-beta-alphabeta)#
#=(alpha^2+2alpha+1)/(alpha^2+alpha-beta-alphabeta)+(beta^2+2beta+1)/(beta^2+beta-alpha-alphabeta)#
#=(alpha+1)^2/(alpha(alpha+1)-beta(alpha+1))+(beta+1)^2/(beta(beta+1)-alpha(1+beta))#
#=(alpha+1)^2/((alpha-beta)(alpha+1))-(beta+1)^2/((beta+1)(alpha-beta))#
#=(alpha+1)/(alpha-beta)-(beta+1)/(alpha-beta)#
#=(alpha+1-beta-1)/(alpha-beta)#
#=1#