Two lines are perpendicular if their direction vectors are orthogonal, meaning their dot product is zero.
Step 1: Identify the direction vectors. The direction vector for \(\vec{r}_1\) is: \[ \vec{d}_1 = 2\hat{i} + p\hat{j} + 5\hat{k}. \] The direction vector for \(\vec{r}_2\) is: \[ \vec{d}_2 = 3\hat{i} - p\hat{j} + p\hat{k}. \]
Step 2: Compute the dot product. The dot product \(\vec{d}_1 \cdot \vec{d}_2\) is calculated as: \[ \vec{d}_1 \cdot \vec{d}_2 = (2)(3) + (p)(-p) + (5)(p). \] Simplifying yields: \[ \vec{d}_1 \cdot \vec{d}_2 = 6 - p^2 + 5p. \]
Step 3: Equate the dot product to zero. For perpendicular lines, this condition must hold: \[ 6 - p^2 + 5p = 0. \]
Step 4: Solve the resulting quadratic equation. Rearrange the equation: \[ p^2 - 5p - 6 = 0. \] Factor the quadratic: \[ (p - 6)(p + 1) = 0. \] The solutions for \( p \) are: \[ p = 6 \quad \text{or} \quad p = -1. \]
Step 5: Verify the solutions. Both \( p = 6 \) and \( p = -1 \) satisfy the perpendicularity condition. The specific solution required is \( p = 6 \). Final Answer: \[ \boxed{6} \]