Locus of a point for only a certain range of $x$ Good Day
I was solving to find the equation of the quadrant of a circle, when solving this:

A ladder of length $l$ slides with its ends on positive $x$ and $y$ axis. Find the locus of the mid-point of the ladder.

Using this, I was able to find the equation.
But, this made me wonder, what if I am given an equation and I want to make it valid for only some sections of $x$ values - that is, create custom "holes" in the graph.
For example, we can modify $$x = y$$ to $${(\sqrt{5 - x}} ^ 2 - (5 - x)) + ({\sqrt{x - 2}} ^ 2 - (x - 2)) + x = y$$ for $$2 \leq x \leq 5$$
How can we generalize this if I am given disjoint ranges $[l_1, r_1], [l_2, r_2], \cdots [l_n, r_n]$ or disjoint ranges $[l_1, r_1), [l_2, r_2), \cdots [l_n, r_n)$? For example, If I am given equation $$x = y$$ and I want a graph that exists only for $x$ values $[2, 5], [7, 9), (10, 11]$
Thanks
 A: If I understand your question correctly, I think that you can use the fact that $(x-a)(x-b)$ where $a\lt b$ is non-negative if and only if $x\in(-\infty,a]\cup[b,\infty)$.
For example, for $[2,5],[7,9]$, one can have
$$\bigg(\sqrt{x-2}^2-(x-2)\bigg)+\bigg(\sqrt{9-x}^2-(9-x)\bigg)+\bigg(\sqrt{(x-5)(x-7)}^2-(x-5)(x-7)\bigg)+x=y$$
If you want to exclude $x=c$, then you can add $\dfrac{(x-c)^2}{x-c}-(x-c)$.
So, for $[2,5),[7,9)$ where $x=5,9$ are excluded, one can have
$$\bigg(\sqrt{x-2}^2-(x-2)\bigg)+\bigg(\sqrt{9-x}^2-(9-x)\bigg)+\bigg(\sqrt{(x-5)(x-7)}^2-(x-5)(x-7)\bigg)+\bigg(\frac{(x-5)^2}{x-5}-(x-5)\bigg)+\bigg(\frac{(x-9)^2}{x-9}-(x-9)\bigg)+x=y$$
Finally, for $[2, 5], [7, 9), (10, 11]$ which is your example, one can have
$$\bigg(\sqrt{x-2}^2-(x-2)\bigg)+\bigg(\sqrt{11-x}^2-(11-x)\bigg)+\bigg(\sqrt{(x-5)(x-7)}^2-(x-5)(x-7)\bigg)+\bigg(\sqrt{(x-9)(x-10)}^2-(x-9)(x-10)\bigg)+\bigg(\frac{(x-9)^2}{x-9}-(x-9)\bigg)+\bigg(\frac{(x-10)^2}{x-10}-(x-10)\bigg)+x=y$$
A: The geometric locus is the astroid, plane curve generated as envelope of straight lines.
(see:”A CATALOG OF SPECIAL PLANE CURVES”, J. DENNIS LAWRENCE, Dover Publications, Inc., New York.
Coordinates of the mid-point of the ladder are:
$x=\frac{l.cos(\alpha)}{2}$,
$y =\frac{l.sin(\alpha)}{2}$.
At each point of the ladder you have:
$\frac{x}{cos(\alpha)}+\frac{y}{sin(\alpha)}=l$.
Deriving this expression :
$x \frac{sin(\alpha)}{cos(\alpha)^{2}}-y\frac{cos(\alpha)}{sin(\alpha)^{2}}=0$.
From the system of the two equations we derive :
$x=l.cos(\alpha)^{3}$,
$y =l.sin(\alpha)^{3}$.
By eliminating $\alpha$, we get the equation of the geometric locus of the midpoint of the ladder:
$x^{\frac{2}{3}}+y^{\frac{2}{3}}=l^{\frac{2}{3}}$,
expanded
$\Big(x^{2}+y^{2}-l^{2}\Big)^{3}+27l^{2}x^{2}y^{2}=0$.
