A simple method to calculate minimal area enclosed between a tangent to $f(x)$ and coordinate axes Given a function $y=f(x)$, take a tangent to the function at some point. We are to find the minimum area between this line and the coordinate axes. An example question is the coordinate axes have minimum area.
I faced two different algorithms to find the solution. The first one is straight-forward:

*

*Pick a point on the function: $(x_1, y_1) = (x_1, f(x_1))$.

*Find the derivative of the function at $x_1$ to calculate the slope of the line. ($m=f'(x_1)$)

*Derive the tangent-line formula. $y-y_1=m(x-x_1)$

*Find the formulations of intersections with coordinate axes $(0, y_0)$, $(x_0, 0)$.

*Calculate the formulation of the area of triangle as $A = x_0 y_0/2$.

*$A$ shall be a function of $x_1$, minimize that to calculate minimum area.

Second algorithm is very short compared to that:

*

*Take the function $g(x) = 2 x f(x)$.

*Minimize that function to calculate the result.

I cannot figure out how the second algorithm works, or when it works. I checked both against the following family of functions, and both algorithms give the same result:

*

*$f(x) = ax+b$

*$f(x) = k/x$

*$f(x) = 3b^2 - a^2 x^2$

*$f(x) = \frac{b}{a} \sqrt{a^2-x^2}$
Question is: Can we prove/disprove the second algorithm? If disproved, under what conditions does the second algorithm work?

Alternative proof with Lagrange Multipliers.
If $y=a(x)$, then, equivalently, we have a constraint function in x and y, $f(x,y)=y-a(x)=0$. So if $y=4-x^2$, $f(x,y)=y-4x^2=0$.
The slope of the tangent line to an arbitrary $f(x,y)$ is $m=\frac{-\delta f / \delta x}{\delta f / \delta y}$.
From above $\delta f/ \delta y =1$, and $\delta f / \delta x = -da/dx$.
Also: $\frac{\delta^2 f}{\delta x \delta y}=\frac{\delta ^2 f}{\delta y^2}=0. $
Area is:
$$A = \frac{(y+x\frac{\delta f / \delta x}{\delta f / \delta y})^2}{2}\frac{\delta f / \delta y}{\delta f / \delta x}$$
Cleaning up:
$$A = \frac{ (y\frac{\delta f}{\delta y}+x\frac{\delta f }{\delta x})^2  }{2\frac{\delta f}{\delta x}\frac{\delta f }{\delta y}}=\frac{(y+x \frac{\delta f}{\delta x})^2}{2 \frac{\delta f}{\delta x}}$$
$$A_x = \frac{2 \frac{\delta f}{\delta x}\cdot 2\cdot(y+x \frac{\delta f}{\delta x})(\frac{\delta f}{\delta x}+x\frac{\delta ^2f}{\delta x^2})-2\cdot \frac{\delta ^2 f}{\delta x^2}(y+x\frac{\delta f}{\delta x})^2 }{4(\frac{\delta f}{\delta x})^2}=y+x\frac{\delta f}{\delta x}-\frac{y^2 \frac{\delta ^2 f}{\delta x^2}}{2 (\frac{\delta f}{\delta x})^2}+\frac{x^2\frac{\delta ^2 f}{\delta x^2}}{2}$$
$$A_y =\frac{4\frac{\delta f}{\delta x}(y+x\frac{\delta f}{\delta x})(1+x\cdot \frac{\delta ^2 f}{\delta x \delta y})-2\frac{\delta ^2f}{\delta x \delta y}(y\frac{\delta f}{\delta y}+x\frac{\delta f}{\delta x})}{4(\frac{\delta f}{\delta x})^2} =\frac{y+x\frac{\delta f}{\delta x}}{ \frac{\delta f}{\delta x}}$$
By Lagrange Multipliers, $\lambda f_x=A_x$ and $\lambda f_y = A_y$
$f_y=1$, so $\lambda=\frac{y+x \frac{\delta f}{\delta x}}{\delta f/ \delta x} $, and $\lambda f_x=y+x\frac{\delta f}{\delta x}=y+x\frac{\delta f}{\delta x}-\frac{y^2 \frac{\delta ^2 f}{\delta x^2}}{2 (\frac{\delta f}{\delta x})^2}+\frac{x^2\frac{\delta ^2 f}{\delta x^2}}{2}$
So:
$$0=-\frac{y^2 \frac{\delta ^2 f}{\delta x^2}}{2 (\frac{\delta f}{\delta x})^2}+\frac{x^2\frac{\delta ^2 f}{\delta x^2}}{2}$$
And:
$$(x\frac{\delta f}{\delta x}-y)(x\frac{\delta f}{\delta x}+y)=0$$
If the second term is zero, we have zero area, so set the first term to zero.
But, $\frac{\delta f}{\delta x}=-\frac{dy}{dx}$, so $(x\frac{\delta f}{\delta x}-y)=0 \implies \frac{d(xy)}{dx}=0$
Since $y=x\frac{\delta f}{\delta x}$, $A=2x^2\frac{\delta f}{\delta x}=2xy$
