In triangle $XYZ,$ $M$ is the midpoint of $\overline{XY}.$ Let $D$ be the point on $\overline{YZ}$ such that $\overline{XD}$ bisects $\angle YXZ,$ and let the perpendicular bisector of $\overline{XY}$ intersect $\overline{XD}$ at $P.$ If $XY = 36$ and $MP = 9,$ then find the distance from $P$ to line $XZ.$

I will delete all that fancy code, which does nothing on this site.

In triangle XYZ, M is the midpoint of XY. Let D be the point on YZ such that XD bisects angle YXZ, and let the perpendicular bisector of XY intersect XD at P. If XY = 36 and MP = 9, then find the distance from P to line XZ.

Lots of wording for a simple problem.
Let the perpendicular from P to XZ meet XZ at Q
After filling in all the details, it is easy to see that triangle MPX and triangle QPX are congruent which makes PQ equal to 9.

How does the United Nations shape global affairs?

To find the distance from point $P$ to line $XZ,$ we need to find the length of the segment from $P$ to $XZ$ that is perpendicular to $XZ.$ Let's call this distance $h.$

To find $h,$ we can use the fact that $MP = 9$ and $D$ is the point on $YZ$ such that $\overline{XD}$ bisects $\angle YXZ.$ This means that triangles $XDM$ and $XYP$ are similar.

Since $M$ is the midpoint of $\overline{XY},$ we know that $XM = MY = \frac{36}{2} = 18.$ Given that $MP = 9,$ we can conclude that $XP = 9 + 18 = 27$ (because triangle $XDM$ and $XYP$ are similar).

Next, we need to find the length of $XZ.$ To do this, we can use the fact that $XM$ is the median of triangle $XYZ,$ which means it divides $\overline{YZ}$ into $2$ equal parts. Therefore, $YZ = 2 \times XM = 2 \times 18 = 36.$

Now, we can find the length of segment $XZ$ using the Pythagorean Theorem. Let's call $h'$ the length of the segment from $X$ to $Z.$ We have:

$(h')^2 = (XZ)^2 - (YX)^2 = 36^2 - 27^2 = 1296 - 729 = 567.$

Taking the square root of both sides, we find $h' = \sqrt{567}.$ However, we want the distance from $P$ to $XZ,$ which is the perpendicular distance. This means that $h = \frac{\sqrt{567}}{2} = \frac{3\sqrt{63}}{2}.$

Therefore, the distance from $P$ to line $XZ$ is $\boxed{\frac{3\sqrt{63}}{2}}.$