# Can you write a non-piecewise equation that describes an arbitrary shape?

This batman equation thing got me thinking: for an arbitrary curve drawn on the Cartesian plane, can you write a corresponding equation which is not piecewise? What about closed shapes, a la the batman symbol?

I assume that there are limitations, such as that the curve would have to be differentiable and/or continuous everywhere, but is this possible for any random squiggle? Or is it not?

-
What kind of expressions are you allowing? –  Qiaochu Yuan Jul 31 '11 at 2:02
@tel: That's not the issue Qiaochu meant. For example, the logarithmic integral function can't be expressed in terms of any "elementary" functions (the definition of which is completely arbitrary); however, by simply naming the logarithmic integral function "$\text{li}(x)$", we can now easily describe it: specifically, as $\text{li}(x)$. So the question of whether something can be written as "an equation" is not well-defined until you specify what you're allowing to go into it. –  Zev Chonoles Jul 31 '11 at 2:26
If you allow at least one of the absolute value, unit step or sign functions, you're effectively allowing a piecewise construction. –  Guess who it is. Jul 31 '11 at 2:54
@J.M.: If you elaborate on that thought a bit, it would probably be a satisfactory answer to the OP... –  The Chaz 2.0 Jul 31 '11 at 3:06
Isn't it the case that any simple closed curve in the plane can be approximated arbitrarily closely as the solution set of a polynomial (of very high degree)? –  Grumpy Parsnip Jul 31 '11 at 3:32

## 1 Answer

As has been alluded to in the comments, your question depends on the definition of "equation" and "piecewise function". I'm sure you have some idea ("I'll know it when I see it") what sorts of things you'd like to allow and forbid, and we could try to make this precise in some algebraic way by building functions up out of some collection of "elementary" functions you'd like to start with.

However, the functions you end up allowing will likely end up conflicting with the piecewise functions you want to forbid. For example, if you allow squares and square roots, you end up letting the absolute value function in the back door:

$$\sqrt{x^2}=|x|=\begin{cases}x&\text{if }\ x\geq 0\\-x & \text{if }\ x<0\end{cases}$$

Once you have one piecewise function, you can set about making more. Assuming you allow division, you also have

$$\frac{\sqrt{x^2}}{x}=\frac{|x|}{x}=\begin{cases}1&\text{if }\ x>0\\-1&\text{if }\ x<0\end{cases}$$

and hence

$$\frac{\sqrt{x^2}+x}{2x}=\frac{|x|+x}{2x}=\begin{cases}1&\text{if }\ x>0\\0&\text{if }\ x<0\end{cases}.$$

Fiddling around with transformations of the above function, you can essentially make indicator functions of intervals, and from there you can get nearly any piecewise function at all.

All this is to show that it will be very difficult, if not impossible, to formally describe the class of curves which are expressible by equations which you might consider "nice". However, if it's just the shape you're looking for, pretty much anything you could scribble down can be approximated by nice equations, as @Jim Conant points out in the comments.

-
As a short addendum: to use that "Batman curve" as an example again: note that the "curve" has straight sections. Since a (nonchimeric/nondegenerate) polynomial curve of degree greater than one cannot intersect a line in infinitely many points, the equation for Batman will be necessarily piecewise/chimeric. If you allow that the straight sections be "curved" slightly, then there might be an algebraic curve whose shape is more or less similar to the "Batman curve". –  Guess who it is. Jul 31 '11 at 12:01