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:
- Is there any way to plot functions and inequalities on the same chart?
- Is there any way to plot and calculate the squares of figures obtained by intersections of functions?
RegionPlot
; seeRegionPlot[ Reduce[x >= -2 && y <= 4 && y >= 6/(x + 5) && y >= Abs[x]], {x, -2, 4}, {y, 0, 4}]
. Note, however, thatFunctionDomain[4/Sqrt[4 - x^2], x]
yields-2 < x < 2
, soRegionPlot[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. $\endgroup$ – corey979 Nov 10 '16 at 21:36RegionPlot[Reduce[y <= 4/Sqrt[4 - x^2]], {x, -1, 1}, {y, 0, 4}]
yields an error $\endgroup$ – Elias Nov 11 '16 at 6:38Reduce
in not needed here; seeRegionPlot[ 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 interval4/Sqrt[4 - x^2]
doesn't exist, so the whole condition isFalse
, soRegionPlot
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}]
. $\endgroup$ – corey979 Nov 11 '16 at 11:01