In trapezoid $ABCD$, $AB < CD$, $AB\perp BC$, $AB\parallel CD$, and the diagonals $AC$, $BD$ are perpendicular at point $P$. There is a point $Q$ on ray $CA$ past $A$ such that $QD\perp DC$. If
\[\frac{QP} {AP}+\frac{AP} {QP} = \left( \frac{51}{14}\right)^4 - 2,\]then $\frac{BP} {AP}-\frac{AP}{BP}$ can be expressed in the form $\frac{m}{n}$ for relatively prime positive integers $m,n$. Compute $m+n$.

[i]Ray Li.[/i]
1. Let \( AP = x \) and \( BP = y \) for convenience. Given that the diagonals \( AC \) and \( BD \) are perpendicular at point \( P \), we can use the properties of similar triangles to find the relationships between the segments.

2. Since \( \triangle APB \sim \triangle BPC \sim \triangle CPD \sim \triangle DPQ \), we can express the lengths of the segments in terms of \( x \) and \( y \):
   \[
   CP = \frac{y^2}{x}, \quad DP = \frac{y^3}{x^2}, \quad QP = \frac{y^4}{x^3}
   \]

3. We are given the equation:
   \[
   \frac{QP}{AP} + \frac{AP}{QP} = \left( \frac{51}{14} \right)^4 - 2
   \]
   Substituting the expressions for \( QP \) and \( AP \):
   \[
   \frac{\frac{y^4}{x^3}}{x} + \frac{x}{\frac{y^4}{x^3}} = \frac{y^4}{x^4} + \frac{x^4}{y^4}
   \]
   Therefore:
   \[
   \frac{y^4}{x^4} + \frac{x^4}{y^4} = \left( \frac{51}{14} \right)^4 - 2
   \]

4. Simplify the given equation:
   \[
   \left( \frac{51}{14} \right)^4 - 2 = \left( \frac{2601}{196} \right)^2 - 2
   \]
   \[
   = \left( \frac{2601}{196} \right)^2 - 2 = \left( \frac{2601}{196} \right)^2 - 2
   \]

5. Let \( \frac{x^2}{y^2} = k \). Then:
   \[
   k + \frac{1}{k} = \frac{2601}{196}
   \]
   Solving for \( k \):
   \[
   k + \frac{1}{k} = \frac{2601}{196}
   \]
   \[
   k + \frac{1}{k} = \frac{2601}{196}
   \]
   \[
   k + \frac{1}{k} = \frac{2601}{196}
   \]

6. We need to find \( \frac{BP}{AP} - \frac{AP}{BP} \):
   \[
   \frac{BP}{AP} - \frac{AP}{BP} = \frac{y}{x} - \frac{x}{y}
   \]
   \[
   = \sqrt{k} - \frac{1}{\sqrt{k}}
   \]
   \[
   = \frac{47}{14}
   \]

7. The final answer is in the form \( \frac{m}{n} \) where \( m \) and \( n \) are relatively prime positive integers. Here, \( m = 47 \) and \( n = 14 \).

The final answer is \( \boxed{ 47 + 14 = 61 } \)