We are given a triangle PQR where the bisector of the internal angle $\angle Q$ and the bisector of the external angle $\angle R$ intersect at point M.
We are given $\angle QMR = 40^\circ$. The goal is to find the measure of $\angle P$.
A key geometric theorem states that the angle formed by the intersection of the internal bisector of one angle (like $\angle Q$) and the external bisector of another angle (like $\angle R$) is equal to half the third angle ($\angle P$).
The formula is: $\angle QMR = \frac{1}{2} \angle P$
Substitute the given value of $\angle QMR$ into the formula:
$40^\circ = \frac{1}{2} \angle P$
Solving for $\angle P$:
$\angle P = 2 \times 40^\circ$
$\angle P = 80^\circ$
Thus, the measure of $\angle P$ is $80^\circ$.