p=2 or p=−1
Step-by-step explanation:
The roots of a quadratic ax2+bx+c=0 are equal when the discriminant (b2−4ac) is equal to 0
In this case
a=1
b=−2p
c=(p+2)
So the discriminant is
(-2p)2−4(1)(p+2) =4p2−4p−8
which factors as
=4(p−2) (p+1)
and the discriminant
=0 if p=2 or p=−1