Problem: In a convex quadrilateral $ABCD$,
the diagonal $BD$ bisects neither the angle $ABC$ nor the angle $CDA$.
The point $P$ lies inside $ABCD$ and satisfies
\[\angle PBC=\angle DBA \quad\text{and}\quad \angle PDC=\angle BDA. \]
Prove that $ABCD$ is a cyclic quadrilateral if and only if $AP=CP$.

Solution: We show two solutions.
We note that the first hypothesis cannot be dropped, because $ABCD$ being a kite
with $BA=BC$ and $DA=DC$ with center $P$ is a counterexample
(where $AP=CP$ but $ABCD$ is not cyclic).
However, the condition that $BD$ bisects neither angle $\angle B$ nor $\angle D$
is equivalent to requiring that the point $P$ does not lie on line $BD$
and we assume this henceforth.

\paragraph{Barycentric solution (from teenager Evan).}
Apply barycentric coordinates to $\triangle PBD$
(nondegenerate by the non-bisect condition)
with $P = (1,0,0)$, $B = (0,1,0)$ and $D = (0,0,1)$.
Define $a = BD$, $b = DP$ and $c = PB$.

Since $A$ and $C$ are isogonal conjugates with respect to $\triangle PBD$,
we set \[ A = (au : bv : cw) \qquad\text{and}\qquad
  C = \left( \frac au : \frac bv : \frac cw \right). \]
For brevity define $M = au + bv + cw$ and $N = avw + bwu + cuv$.

We now compute each condition.
\begin{claim*}
  Quadrilateral $ABCD$ is cyclic if and only if $N^2 = u^2 M^2$.
\end{claim*}
\begin{proof}
  W know a circle through $B$ and $D$
  is a locus of points
  with \[ \frac{a^2yz+b^2zx+c^2xy}{x(x+y+z)} \]
  is equal to some constant.
  Therefore quadrilateral $ABCD$ is cyclic if and only if
  $\frac{abc \cdot N}{au \cdot M}$
  is equal to $\frac{abc \cdot uvw \cdot M}{avw \cdot N}$
  which rearranges to $N^2 = u^2M^2$.
\end{proof}
\begin{claim*}
  We have $PA = PC$ if and only if $N^2 = u^2 M^2$.
\end{claim*}
\begin{proof}
  We have the displacement vector
  $\overrightarrow{PA}
  = \tfrac{1}{M} \left( bv+cw , -bv ,-cw \right)$.
  Therefore,
  \begin{align*}
    M^2 \cdot \left\lvert PA \right\rvert^2
    &= -a^2(bv)(cw) + b^2(cw)(bv+cw) + c^2(bv)(bv+cw) \\
    &= bc(-a^2vw + (bw+cv)(bv+cw)).
  \end{align*}
  In a similar way
  (by replacing $u$, $v$, $w$ with their inverses)
  we have
  \begin{align*}
    \left( \frac{N}{uvw} \right)^2 \cdot \left\lvert PC \right\rvert^2
    &= (vw)^{-2} \cdot bc(-a^2vw + (bv+cw)(bw+cv)) \\
    \iff N^2 \cdot \left\lvert PC \right\rvert^2
    & = u^2 bc(-a^2vw + (bw+cv)(bv+cw))
  \end{align*}
  These are equal if and only if $N^2 = u^2M^2$, as desired.
\end{proof}

\paragraph{Angle chasing solution (Evan Chen and Petko Lazarov).}
The solution consists of two parts.
The first part is that by angle chasing, we will prove that
\[ \dang PAC = \dang ACP \iff \dang BAC + \dang CBD + \dang DCA + \dang ADB = 0.
  \qquad (\spadesuit). \]
A careless reader would be forgiven for thinking that $(\spadesuit)$
implies the problem or at least one direction,
but it turns out the situation is more subtle.
The second part analyzes the angle conditions more carefully
and provides a complete proof.

\subparagraph{Proof of the equivalence $(\spadesuit)$ by angle chasing.}
We start with the following unconditional claim, valid for any quadrilateral.
\begin{claim*}
  [Isogonal conjugation]
  Let $ABCD$ and $P$ be as in the problem statement.
  Then $\dang APB + \dang CPD = 180\dg$.
\end{claim*}
\begin{proof}
  The angles in the statement imply that $A$ and $C$
  are isogonal conjugates with respect to $\triangle PBC$.
  Thus, lines $PA$ and $PC$ are isogonal with respect to $\angle BPC$, as needed.
\end{proof}

\begin{center}
\begin{asy}
import geometry;

size(9cm);
pair A = (-0.50099,1.69422);
pair B = (-1.8,-0.6);
pair C = (0.09182,-1.79600);
pair D = (1.55802,-0.60384);
pair P = (-1.04359,-0.19363);

draw(circumcircle(A,B,C), gray+dashed);
filldraw(A--B--C--D--cycle, opacity(0.2)+yellow, black);
draw(B--D);
draw(A--C);

draw(C--P--A, brown);
draw(B--P--D, gray);

markangle(radius=15, n=2, P, A, C, red, StickIntervalMarker(1,1, red));
markangle(radius=15, n=2, A, C, P, red, StickIntervalMarker(1,1, red));
markangle(radius=10, n=3, A, P, B, deepgreen, StickIntervalMarker(1,2, deepgreen));
markangle(radius=10, n=3, C, P, D, deepgreen, StickIntervalMarker(1,1, deepgreen));
markangle(radius=12, n=1, B, A, C, blue);
markangle(radius=12, n=1, C, B, D, blue);
markangle(radius=12, n=1, D, C, A, blue);
markangle(radius=12, n=1, A, D, B, blue);

dot("$A$", A, dir(A));
dot("$B$", B, dir(B));
dot("$C$", C, dir(C));
dot("$D$", D, dir(D));
dot("$P$", P, dir(45));
\end{asy}
\end{center}

Next we rewrite the two angles $\dang APB$ and $\dang CPD$ in the claim
(colored green with three rings)
so that their only dependence on $P$
is through the angles $\dang PAC$ and $\dang CAP$ (colored red with two rings),
as follows:
\begin{align*}
  -\dang APB &= \dang PBA + \dang BAP = \dang PBA + (\dang BAC - \dang PAC) \\
    &= \dang CBD + \dang BAC - \dang PAC \\
  -\dang CPD &= \dang PDC + \dang DCP = \dang PDC + (\dang DCA + \dang ACP) \\
    &= \dang ADB + \dang DCA + \dang ACP.
\end{align*}
Since the claim says $\dang APB + \dang CPD = 0$, summing
lets us finally rewrite $\dang PAC - \dang APC$ in terms of only $A$, $B$, $C$, $D$:
\begin{align*}
  0 &= (\dang ACP - \dang PAC) + \dang ADB + \dang DCA + \dang CBD + \dang BAC \\
  \implies \dang PAC - \dang ACP &= \dang ADB + \dang DCA + \dang CBD + \dang BAC.
\end{align*}
These four latter angles are colored blue with one ring in the figure.
This proves $(\spadesuit)$.

\subparagraph{Quasi-harmonic quadrilaterals.}
To interpret the condition $(\spadesuit)$, we define a new term:
a quadrilateral $ABCD$ is \emph{quasi-harmonic} if $AB \cdot CD = BC \cdot DA$.
(See IMO 2018/6 for another problem involving quasi-harmonic quadrilaterals.)
The following two lemmas show why this condition is relevant:
\begin{lemma*}
  The condition
  \[ \dang BAC + \dang CBD + \dang DCA + \dang ADB = 0 \]
  is equivalent to $ABCD$ being \emph{either} cyclic or quasi-harmonic or both.
\end{lemma*}
\begin{proof}
  A clean approach with complex numbers
  (posted at \url{https://aops.com/community/p15327734}) goes as follows:
  define complex numbers $\mu = (a-b)(c-d) \neq 0$ and $\nu = (b-c)(d-a) \neq 0$.
  Then \[ \mu-\nu = (a-c)(b-d) \neq 0. \]

  Now the angle condition is equivalent to
  \begin{align*}
    \RR &\ni \frac{a-b}{d-b} \cdot \frac{b-c}{a-c} \cdot \frac{c-d}{b-d} \cdot \frac{d-a}{c-a} \\
    &= \frac{\mu \nu}{(\mu - \nu)^2} \\
    &= \frac{1}{\frac{\mu}{\nu} + \frac{\nu}{\mu} - 2} \\
    \iff \RR &\ni \frac{\mu}{\nu} + \frac{\nu}{\mu}.
  \end{align*}
  In general, though $z+1/z$ is real exactly when either $|z|=1$ or $z \in \RR$.
  Note $\mu/\nu \in \RR$ is equivalent to $ABCD$ cyclic
  and $|\mu| = |\nu|$ is equivalent to $ABCD$ being quasiharmonic; the proof follows.

  This can be also proved by inversion at $A$, though we don't write the details here.
  (See also \url{https://problems.ru/view_problem_details_new.php?id=116602}).
\end{proof}

\begin{lemma*}
  Quadrilateral $ABCD$ is quasi-harmonic if and only if $P$ lies on line $AC$.
\end{lemma*}
\begin{proof}
  Let $X = \ol{BD} \cap \ol{AC}$.
  If the isogonal of line $BD$ with respect to $\angle B$ meets line $AC$ at $Y$, then
  $\frac{AX}{CX} \frac{AY}{CY} = \left( \frac{BA}{BC} \right)^2$.
  Similarly if the isogonal to $\angle D$ meets line $AC$ at $Y'$, then
  $\frac{AX}{CX} \frac{AY'}{CY'} = \left( \frac{DA}{DC} \right)^2$.
  Hence $ABCD$ is quasi-harmonic if and only if $Y = Y'$ (that is, $Y=Y'=P$).
\end{proof}

\subparagraph{Wrap-up.}
We now show that $PA = PC$ if and only if $ABCD$ is cyclic
by cases on whether $P$ lies on $\ol{AC}$.
\begin{itemize}
  \ii If $ABCD$ is \emph{not} quasi-harmonic,
  then $(\spadesuit)$ implies the problem statement immediately.
  Indeed, $\dang PAC = \dang ACP$ if and only if $PA = PC$
  (as $\triangle PAC$ is not degenerate)
  and the second lemma turns our angle condition into $ABCD$ cyclic.

  \ii Now assume $ABCD$ is quasi-harmonic and $P$ lies on line $AC$.
  We ignore $(\spadesuit)$.
  Instead, note that if $ABCD$ is also cyclic then
  $\ol{BD}$ is a symmedian of $\triangle ABC$ and hence $P$ is the midpoint.
  Conversely, suppose we know $\ol{BD}$ is a symmedian of $\triangle ABC$.
  Let $D' \neq B$ be the point for which $ABCD'$ is cyclic and harmonic;
  then $B$, $D$, $D'$ are collinear and $\frac{BD}{CD} = \frac{BD'}{CD'} = \frac{BA}{CA}$.
  So $D' = D$ (the corresponding Apollonian circle only meets line $BD$ twice), as needed.
\end{itemize}