Extra credit

Get as a notebook

In the February 2014 issue of the Mathematics Magazine the following is stated (Connie Xu, Montgomery Blair High School):

Let $f(x)$ be a twice-differentiable function such that $f''(x)$ is continuous and positive for all $x$. Then the following are equivalent:

Furthermore, the sum of these two described areas depends on $b-a$ and not the values of $a$ and $b$.

You have the following assignment:

To get you started, the following shows how to plot the area between a function and the tangent lines:

using MTH229
plotly()

f(x) = x^2
a,b = -0.5, 1
plot([f, tangent(f,a), tangent(f,b)], a, b)

And this shows how to find the intersection point between two tangent lines:

g(x) = tangent(f, a)(x) - tangent(f,b)(x)    # g(x) = 0 is when two tangent lines intersect
c = fzero(g, a,b)
0.25

Finally the area between a function and the tangent line is found with

h(x) =  f(x) - tangent(f, a)(x)
area, error = quadgk(h, a, b) # area between a and b is for example only
(1.1249999999999998,0.0)

(This works as $f''(x) > 0$ implies that function is concave up, so that the tangent line is below the function.)

Okay, give it a go here: