0

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?

user27119
  • 2,500
  • 13
  • 34

1 Answers1

1

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!

Alexei Boulbitch
  • 39,397
  • 2
  • 47
  • 96