<s>[INST] Determine point where area between tangent and curve is minimal Given a certain function, how do we determine a point on the function $(a,f(a))$ where the area between its tangent at that point and the function is minimal?
For example, the function given is $f(x)=-x^2 + 4x + 5$ on the interval $(0,3)$.
 [/INST] Step 1: find the slope of the tangent line:
\begin{align}f(x)=-x^2 + 4x + 5, m=(f(x))'=-2x+4  \end{align}
Step 2: find the intercept and equation of the tangent line at $x=a$:\begin{align} -a^2+4a+5=(-2a+4)a+b, b=a^2+5,y=(-2a+4)x+a^2+5\end{align}
Step 3: find the area bounded by $f(x)$,the tangent line, $x=0,$ and $x=3$ :
\begin{align}S=\int_0^3 (((-2a+4)x+a^2+5)-(-x^2+4x+5)) dx=\int_0^3 (x-a)^2 dx=3(a-\frac{3}{2})^2+\frac{9}{4}\end{align}
Conclusion: when  $x=\frac{3}{2}, S$ is minimum.

</s>