0
$\begingroup$

This question already has an answer here:

If I have some arbitrary curve $f(x)$ and I want to integrate it with a set of limits, is it possible to colour the area under this curve that I have integrated based on the limits?

$\endgroup$

marked as duplicate by Michael E2 numerical-integration Jan 25 '18 at 12:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ I agree with "marked as duplicate". My answer is already on the post noted. No need to consider it, removing... $\endgroup$ – José Antonio Díaz Navas Jan 25 '18 at 12:57
1
$\begingroup$

Try this:

Manipulate[
 Show[{
   Plot[Sin[x], {x, 0, 2 \[Pi]}],
   Plot[Sin[x], {x, a, b}, PlotStyle -> Red, Filling -> 0],
   Graphics[{Red, Thickness[0.007], Line[{{a, 0}, {b, 0}}], 
     PointSize[0.015], Point[{a, 0}], Point[{b, 0}]}]
   }],
 {{b, 1}, a + 0.2, 2 \[Pi]}, {a, 0.1, 2 \[Pi]}]

showing the following:

enter image description here

Have fun!

$\endgroup$
  • $\begingroup$ Spot on! Nice solution! $\endgroup$ – Q.P. Jan 25 '18 at 11:41

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