Let the height of the tower be \( h \) and the distance from the point X to the base of the tower be \( x \).
Step 1:
Using the information that the angle of elevation from point X is 60°, we can use the tangent of the angle to write the equation:
\[
\tan 60^\circ = \frac{h}{x}.
\]
Since \( \tan 60^\circ = \sqrt{3} \), the equation becomes:
\[
\sqrt{3} = \frac{h}{x} \quad \Rightarrow \quad h = \sqrt{3}x \quad \text{(Equation 1)}.
\]
Step 2:
Next, from point Y, which is 40 m vertically above X, the angle of elevation of Q is 45°. Using the tangent of 45°, we write:
\[
\tan 45^\circ = \frac{h - 40}{x}.
\]
Since \( \tan 45^\circ = 1 \), the equation becomes:
\[
1 = \frac{h - 40}{x} \quad \Rightarrow \quad h - 40 = x \quad \Rightarrow \quad h = x + 40 \quad \text{(Equation 2)}.
\]
Step 3:
Now, solve the system of equations (Equation 1 and Equation 2). From Equation 1, we have:
\[
h = \sqrt{3}x.
\]
Substitute this into Equation 2:
\[
\sqrt{3}x = x + 40.
\]
Solve for \( x \):
\[
\sqrt{3}x - x = 40 \quad \Rightarrow \quad x(\sqrt{3} - 1) = 40 \quad \Rightarrow \quad x = \frac{40}{\sqrt{3} - 1}.
\]
To simplify, multiply the numerator and denominator by \( \sqrt{3} + 1 \):
\[
x = \frac{40(\sqrt{3} + 1)}{(\sqrt{3} - 1)(\sqrt{3} + 1)} = \frac{40(\sqrt{3} + 1)}{3 - 1} = 20(\sqrt{3} + 1).
\]
Step 4:
Now substitute this value of \( x \) back into Equation 1 to find \( h \):
\[
h = \sqrt{3} \times 20(\sqrt{3} + 1) = 20\sqrt{3}(\sqrt{3} + 1).
\]
Simplify:
\[
h = 20 \times (3 + \sqrt{3}) = 60 + 20\sqrt{3}.
\]
Thus, the height of the tower \( h \) is \( 60 + 20\sqrt{3} \) meters, and the distance \( PX = 20(\sqrt{3} + 1) \) meters.
Conclusion:
The height of the tower PQ is \( 60 + 20\sqrt{3} \) meters, and the distance \( PX \) is \( 20(\sqrt{3} + 1) \) meters.