A point $P$ is given in the square $ABCD$ such that $\overline{PA}=3$, $\overline{PB}=7$ and $\overline{PD}=5$. Find the area of the square.
1. **Rotate $\triangle APD$ to $\triangle AQB$ by $\frac{\pi}{2}$:**
   - When we rotate $\triangle APD$ by $\frac{\pi}{2}$ counterclockwise around point $A$, point $D$ maps to point $B$ and point $P$ maps to point $Q$.
   - Since $\angle PAQ = \frac{\pi}{2}$, the distance $PQ$ can be calculated using the Pythagorean theorem in $\triangle PAQ$:
     \[
     PQ = \sqrt{PA^2 + AQ^2} = \sqrt{3^2 + 3^2} = \sqrt{18} = 3\sqrt{2}
     \]

2. **Apply the Law of Cosines to $\triangle PQB$:**
   - In $\triangle PQB$, we know $PQ = 3\sqrt{2}$, $PB = 7$, and $QB = PD = 5$.
   - Using the Law of Cosines:
     \[
     PB^2 = PQ^2 + QB^2 - 2 \cdot PQ \cdot QB \cdot \cos(\angle PQB)
     \]
     \[
     7^2 = (3\sqrt{2})^2 + 5^2 - 2 \cdot 3\sqrt{2} \cdot 5 \cdot \cos(\angle PQB)
     \]
     \[
     49 = 18 + 25 - 30\sqrt{2} \cdot \cos(\angle PQB)
     \]
     \[
     49 = 43 - 30\sqrt{2} \cdot \cos(\angle PQB)
     \]
     \[
     6 = -30\sqrt{2} \cdot \cos(\angle PQB)
     \]
     \[
     \cos(\angle PQB) = -\frac{1}{5\sqrt{2}}
     \]

3. **Determine $\angle QPB$:**
   - Since $\cos(\angle PQB) = -\frac{1}{5\sqrt{2}}$, we can find $\angle PQB$.
   - However, we can also use the fact that $\angle QPB = \frac{\pi}{4}$ (as given in the problem).

4. **Calculate $\angle APB$:**
   - Since $\angle PAQ = \frac{\pi}{2}$ and $\angle QPB = \frac{\pi}{4}$, we have:
     \[
     \angle APB = \angle PAQ + \angle QPB = \frac{\pi}{2} + \frac{\pi}{4} = \frac{3\pi}{4}
     \]

5. **Use the Pythagorean theorem to find $AB$:**
   - Since $\angle APB = \frac{\pi}{2}$, we can use the Pythagorean theorem in $\triangle APB$:
     \[
     AB^2 = AP^2 + PB^2 = 3^2 + 7^2 = 9 + 49 = 58
     \]
   - Therefore, the side length of the square $ABCD$ is $\sqrt{58}$.

6. **Calculate the area of the square:**
   - The area of the square is given by the square of its side length:
     \[
     \text{Area} = (\sqrt{58})^2 = 58
     \]

The final answer is $\boxed{58}$