1
$\begingroup$

How can I fill the portion of the area between the functions $f(x) = 2x + 4$ and $g(x) = -6x-1$ in the interval $[-1, 3]$? I have searched over here but there are mostly examples that do involve the usual normal distribution, or a single integrated function. Sometimes I wonder if it weren't ways simpler to use the most istintive code like that:

enter image description here

$\endgroup$

1 Answer 1

5
$\begingroup$
plot1 = Plot[{2 x + 4, -6 x - 1}, {x, -2, 4}, PlotLegends -> "Expressions"];
plot2 = Plot[{2 x + 4, -6 x - 1}, {x, -1, 3}, Filling -> {1 -> {2}}];
Show[plot1, plot2]

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Thank you so much. I will try to learn as much as possible from you and from the Mathematica Guide. $\endgroup$
    – Enrico M.
    Commented Jan 18, 2022 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.