Question is given: Consider the functions $f(x)=x \cos(x)$, $g(x)=-x^3+6$, $h(x)=-10x-50$, $k(x)=sin(x^2/3)+13$.
Plot the graphs of the four functions for x in the interval [-8,5]. You should see a region R enclosed by the graphs. Choose a scale for the y axis so that the region is clearly visible. Find the four intersection points that define the corners of the region, and draw a black dot at each point. Note: The region that must be calculated is approx between when x=-6, x=2, x=-1 and y=12, we're not interested in the region where g(x) and h(x) intersect at (5,-100)
Find the area of R given in numerical
My approach:
f = x*Cos[x]
g = -x^3 + 6
h = -10*x - 50
k = Sin[x^2/3] + 13
fCurves = Plot[{f, g, h, k}, {x, -8, 5}, PlotLegends -> "Expressions"]
ActReg = Curves = Plot[{f, g, h, k}, {x, -8, 2.5},
PlotLegends ->"Expressions"]
Area = RegionPlot[y > f && y < g && y > h && y < k, {x, -8, 3}, {y, -50,
50}, PlotPoints -> 200, FrameLabel -> {x, y}]
fg = x /. NSolve[f == g, x, Reals];
fh = x /. NSolve[f == h, x, Reals];
kg = x /. NSolve[k == g, x, Reals];
kh = x /. NSolve[k == h, x, Reals];
Column[{fg, fh, kg, kh}]
My problem was the intersection points. Since the equations are working with respect to x, how do you get the y coordinates for each intersected point?
I tried NSolve
but only gave me x coordinates, which looks correct in terms of the values for x but is missing the y coordinates.
x
satisfyingf[x]==g[x]
, the "y" value is justf[x]
no? $\endgroup$x /. NSolve
then you can also do{x, f} /. NSolve
$\endgroup$