# How to plot and calculate the square of a figure obtained as the result of intersections of functions?

Let's say we have a list of functions:

y = 4/Sqrt[4 - x^2],
y = 4,
y = 6/(x + 5),
y = Abs[x],
x >= -2


The simple plot of these functions:

Plot[{4/Sqrt[4 - x^2], 4, 6/(x + 5), Abs[x]}, {x, -2, 5},
PlotLegends -> "Expressions"] And here is my best attempt to get the region derived by intersections:

Plot[{4/Sqrt[4 - x^2], 4, 6/(x + 5), Abs[x]}, {x, -5, 5}, PlotLegends -> "Expressions",
RegionFunction -> Function[{x, y},Reduce[x >= -2 && y <= 4 && y >= 6/(x + 5) &&y >= Abs[x]]],Filling -> Axis] Here is the desired figure: 1. Is there any way to plot functions and inequalities on the same chart?
2. Is there any way to plot and calculate the squares of figures obtained by intersections of functions?
• How are you picking the intersections and regions? – Feyre Nov 10 '16 at 18:43
• The only one possible region that could be constructed by intersections of all the functions: res.cloudinary.com/invimind/image/upload/q_100/v1478804588/… – Elias Nov 10 '16 at 19:06
• I think you are after RegionPlot; see RegionPlot[ Reduce[x >= -2 && y <= 4 && y >= 6/(x + 5) && y >= Abs[x]], {x, -2, 4}, {y, 0, 4}]. Note, however, that FunctionDomain[4/Sqrt[4 - x^2], x] yields -2 < x < 2, so RegionPlot[Reduce[x >= -2 && y <= 4 && y >= 6/(x + 5) && y >= Abs[x] && y <= 4/Sqrt[4 - x^2]], {x, -2, 4}, {y, 0, 4}] will fail. – corey979 Nov 10 '16 at 21:36
• So how can I overcome that? I don't quite understand, why even such expression as RegionPlot[Reduce[y <= 4/Sqrt[4 - x^2]], {x, -1, 1}, {y, 0, 4}] yields an error – Elias Nov 11 '16 at 6:38
• Reduce in not needed here; see RegionPlot[ x >= -2 && y <= 4 && y >= 6/(x + 5) && y >= Abs[x] && y <= 4/Sqrt[4 - x^2], {x, -2, 4}, {y, 0, 4}]. The region $x\in(2,4)$ is empty because, via &&, the conditions are a logical conjuction; in that interval 4/Sqrt[4 - x^2] doesn't exist, so the whole condition is False, so RegionPlot won't plot anything there. You'd have to separately add what you want to achieve in that region, e.g. RegionPlot[ 2 <= x <= 4 && y <= 4 && y >= Abs[x], {x, -2, 4}, {y, 0, 4}]. – corey979 Nov 11 '16 at 11:01

I think you are after a RegionPlot in this case.

RegionPlot[
x >= -2 && y <= 4 && y >= 6/(x + 5) && y >= Abs[x] &&
y <= 4/Sqrt[4 - x^2] && 2 <= x <= 4 && y <= 4 &&
y >= Abs[x], {x, -2, 4}, {y, 0, 4}]


gives an empty plot; this is because

FunctionDomain[4/Sqrt[4 - x^2], x]


-2 < x < 2

so the function does not exist (in reals) in the region $x\in (2,4)$. 4/Sqrt[4 - x^2] /. x -> 3 gives -((4 I)/Sqrt), and there is no order among the complex numbers so you can't choose values smaller than this. The region specification is a logical conjunction, so the condition y <= 4/Sqrt[4 - x^2] yields False in $x\in (2,4)$, hence the whole conjunction is False and so RegionPlot won't plot anything there. Therefore (note the "or": ||)

RegionPlot[(-2 <= x <= 2 && y <= 4 && y >= 6/(x + 5) && y >= Abs[x] &&
y <= 4/Sqrt[4 - x^2]) || (2 <= x <= 4 && y <= 4 &&
y >= Abs[x]), {x, -2, 4}, {y, 0, 4}] gives the desired output.

Additionally, as a display of the line of reasoning, consider the disjoint regions separately:

plot1 = RegionPlot[
x >= -2 && y <= 4 && y >= 6/(x + 5) && y >= Abs[x] &&
y <= 4/Sqrt[4 - x^2], {x, -2, 4}, {y, 0, 4}]

plot2 = RegionPlot[
2 <= x <= 4 && y <= 4 && y >= Abs[x], {x, -2, 4}, {y, 0, 4}]

GraphicsRow[{plot1, plot2}] 