Think of the fraction as $\frac{\frac12\int_a^b f(x)^2dx}{\int_a^b f(x)dx}\;;$ then you can more easily recognize it as $\dfrac{M_x}{M}$, where $M$ is the mass and $M_x$ is the moment about the $x$-axis.
For the second pivot line you do exactly the same thing, but with respect to the $y$-axis. It helps to understand the idea behind it. What you’re really doing is solving for the vertical line on with the region would balance. Say that this line has the equation $y=\bar x$. The region will balance on that line if its moment around that line is $0$. Since that’s a vertical line, you calculate the moment around it very much as you’d calculate the moment about the $y$-axis, except that the distance from the strip at $x$ to the line $y=\bar x$ is $x-\bar x$ instead of $x$. Thus, the moment about the line $y=\bar x$ is $\begin{align*}\int_a^b (x-\bar x)f(x)dx&=\int_a^b xf(x)dx-\bar x\int_a^bf(x)dx\\ &=M_y-\bar xM\;. \end{align*}$
This moment represents the tendency of the region to rotate around the line $y=\bar x$; in order for the region to balance (i.e., for this line to go through the centre of mass), this moment must be $0$. That means that $M_y-\bar xM=0$, and when you solve for $\bar x$, you get $\bar x=\frac{M_y}M\;.$
Now just substitute into this your formulas for $M_y$ and $M$, and you’ll have your other coordinate of the centre of mass of the region.