I have a Bezier curve given by four points: a start point ($P_0$), an end point ($P_3$), and two control points ($P_1$ and $P_2$). The points lie in a certain way. $P_1$ and $P_3$ lie on the x axis. $P_1$ lies on a vertical line with $P_0$ and $P_2$ lies on a vertical line with $P_3$. $P_1$ and $P_2$ also lie on the same horizontal line. Let's say the following
\begin{aligned} P_0 &= (0,0), & P_1 &= (x_1,y_1), & P_2 &= (x_2,y_1), & P_4 &= (x_2,0) \end{aligned}
How do I get the maximum distance between the baseline (line from $P_0$ and $P_3$) and the Bezier curve? In other words, how do I get the top of the bezier curve?