This is worth 5 pts of extra credit, if turned in by last class of the term.
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:
is a quadratic polynomial
Suppose for any $a < b$ the tangent lines at $a$ and $b$ intersect at $x=c$. The area between $f(x)$ and the tangent line at $a$ between $a$ and $c$ is equal to that area between $f(x)$ and the tangent lines at $b$ between $c$ and $b$.
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:
For the function $f(x) = x^2$ verify numerically that the second part above holds for at least 4 pairs of different values of $a$ and $b$ with $b-a$ being a constant for all 4 pairs.
For some other function $f(x)$ satisfying the assumptions, show that you can find a pair $a$ and $b$ for which the second part does not hold (the two areas are different.)
To get you started, the following shows how to plot the area between a function and the tangent lines:
using MTH229 f(x) = x^2 a,b = -0.5, 1 plot(f, a, b) plot!(tangent(f,a)) plot!(tangent(f,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.)