# How to graph/visualize complicated inequalities

I'm having trouble visualizing areas defined by for example,

$$x^2 + y^2 \leq 2y$$

Or

$$(x^2 +y^2)^2 \leq 2a^2(x^2 - y^2)$$

What is the thought process in picturing these regions?

-
subtract $2y$ both sides and complete the square for first inequality – ganeshie8 Sep 2 '14 at 21:06
@Antoine What tells you the inequality has to be true $\forall x,y\in\mathbb R$? – user26486 Sep 2 '14 at 21:25
@mathh I am so sorry, I will remove it. – Antoine Sep 2 '14 at 21:27

Here are some methods:

1. If possible, express y explicitly in terms of x (or vice versa) on the line of equality. For instance in the first example write: $$x = \sqrt{y(2-y)}$$ Plot this function (not forgetting the negative square root). It's a circle.

2. Picture each side as a two dimensional surface and imagine where they intersect (and where one is higher than the other). Not always easy, but in the first example $x^2+y^2$ is a rotationally symmetric bowl and $2y$ is a sloping plane. They intersect in an ellipse.

3. To help the visualisation process in method 2, set x to a series of constants and plot each side of the inequality as a function of y. Do the same for a series of y values. These plots are sections through the 3-dimensional landscape.

4. Alternatively set each side to the same constant and plot the resulting contours.

5. Shift terms from one side of the inequality to the other, or change the variables by shifting the origin or rotating, in an attempt to simplify the picture.

-
Strictly speaking, that should be $x=\pm\sqrt{y(2-y)}$, because the radical sign $(\sqrt{})$ denotes the positive square root. – Rahul Sep 2 '14 at 22:07

$x^2+y^2 \leq 2y \Rightarrow x^2+y^2 - 2y \leq 0 \Rightarrow x^2 + (y-1)^2 -1 \leq 0 \Rightarrow$

$\Rightarrow x^2 + (y-1)^2 \leq 1$

We have the interior and boundary of a circle with center in (0,1)

-

For $(x^2 +y^2)^2 \leq 2a^2(x^2 - y^2)$ I would immediately go to polar coordinates, and rewrite as $$r^4\le 2a^2(r^2\cos^2\theta-r^2\sin^2\theta)=2a^2r^2\cos(2\theta).$$ Remembering that $r=0$ is the origin, we can almost rewrite the inequality as $r^2\le 2a^2\cos^2(2\theta)$. The polar curve is easy to draw, by just imagining $\theta$ growing, and following what happens to $2a^2\cos(2\theta)$. We are inside or on the curve.

-

For the second, try polar coordinates: $x^2 + y^2 = r^2$ while $x^2 - y^2 = r^2 (\cos^2(\theta) - \sin^2(\theta)) = r^2 \cos(2\theta)$. So the equation becomes

$$(r/a)^2 \le 2 \cos(2\theta)$$

Note that the right side is positive for $-\pi/4 < \theta < \pi/4$ and for $3\pi/4 < \theta < 5\pi/4$, negative for $\pi/4 < \theta < 3\pi/4$ and $5 \pi/4 < \theta < 7\pi/4$. The region exists in the sectors where the right side is positive. It looks like this:

The boundary curve is called a lemniscate.

-

Type in RegionPlot[x^2+y^2<=2y,{x,-1,1},{y,0,2}] link or RegionPlot[(x^2+y^2)^2<=2*2^2(x^2-y^2),{x,-3,3},{y,-3,3}] (using $a=2$) link to WolframAlpha or Wolfram Cloud.

-