Step 1: Define \( t \).
\n\nLet \( \sin^2 x = t \). Substituting this into the original equation results in the following quadratic in \( t \):
\[\nt^2 - (p+2)t - (p+3) = 0\n\]\nwhere \( 0 \leq t \leq 1 \) because \( t = \sin^2 x \).\n\n
Step 2: Solve the quadratic.
\n\nUsing the quadratic formula, we get:
\[\nt = \frac{(p+2) \pm \sqrt{(p+2)^2 + 4(p+3)}}{2}\n\]\nSimplify the discriminant:
\[\n(p+2)^2 + 4(p+3) = p^2 + 4p + 4 + 4p + 12 = p^2 + 8p + 16\n\]\nTherefore:
\[\nt = \frac{(p+2) \pm \sqrt{p^2 + 8p + 16}}{2}\n\]\n\n
Step 3: Solution condition.
\n\nAt least one root \( t \) must be in \([0,1]\) for a solution to exist. Analyze key points:
\n Check when \( t=0 \) and \( t=1 \).
\n If \( t=0 \) is a root:
\[\n0 - 0 - (p+3) = 0 \quad \Rightarrow \quad p = -3\n\]\n If \( t=1 \) is a root:
\[\n1 - (p+2)(1) - (p+3) = 0 \quad \Rightarrow \quad 1 - p -2 - p -3 = 0\n\]\n\[\n-2p -4 = 0 \quad \Rightarrow \quad p = -2\n\]\n\nThus, \( p \) is between \(-3\) and \(-2\), including the endpoints.\n\nHence, \( p \in [-3, -2] \).