A line through the point (2,2) cuts the x and y axes at A and B. Find the minimum length of the segment AB.
OA=2+x x-distance from x=2 to the right
tg a = 2/x
OB=(2+x)tg a=2(2+x)/x
$\displaystyle |AB|^2=|OA|^2+|OB|^2$
f(x)=$\displaystyle |AB|^2=(2+x)^2+\frac{4(2+x)^2}{x^2}$
f'(x)=0
$\displaystyle x^3-8=0$
$\displaystyle x=2$
OA=4 (x)
OB=4 (y).
|AB| min=$\displaystyle 4\sqrt{2}$
The line has a negative slope.
If it had a positive slope, it could go through the origin making the distance
between A and B zero.
If you draw the line going through (2,2) with a negative slope,
we have similar triangles by drawing lines from (2,2) to the x and y axes.
hence $\displaystyle tan\theta=\frac{2}{x-2}=\frac{y-2}{2}$
$\displaystyle y-2=\frac{4}{x-2}$
let x-2=c, y-2=k
the length of the line segment is, using Pythagoras' theorem
$\displaystyle \sqrt{(k)^2+2^2}+\sqrt{(c)^2+2^2}=\sqrt{\frac{4^2} {c^2}+4}+\sqrt{c^2+4}$
You could differentiate this with respect to c and set the result = 0
to find the value of x causing the segment length to be a minimum.
Alternatively,
the segment length is
$\displaystyle \frac{2}{cos\theta}+\frac{2}{sin\theta}$
we can differentiate wrt the angle to find the minimum length
$\displaystyle \frac{2sin\theta}{cos^2\theta}-\frac{2cos\theta}{sin^2\theta}=0$
$\displaystyle \frac{2sin^3\theta-2cos^3\theta}{sin^2\theta\ cos^2\theta}=0$
$\displaystyle sin^3\theta-cos^3\theta=0$
this occurs when the angle is 45 degrees
hence the minimum segment length is $\displaystyle 2sin45^o+2cos45^o$
or $\displaystyle \sqrt{4^2+4^2}$