SAGE : Finding Tangent Lines & Calculating Area

For the function $f(x)=x^3-2x+3$, find two values, $x_1$ and $x_2$, where the tangent lines have a slope of 2, that is where $f'(x)=2$, and calculate the area under $f$ between those two values. Finally, plot the function, tangent lines, and show the area.



Next, we want to store the two solutions in $x_1$ and $x_2$

Let's graph all of the various graphical parts of the problem:

  1. The graph of $f$
  2. The shaded area
  3. Both tangent lines

Finally, calculate the area and display both the area and graph.