Max of $ax+by$ given that $x^2+y^2 \le 1$ If a and b a positive real numbers find the maximum value of ax+by in terms of a and b given that $x^2+y^2 \le 1$.
I started by letting $k = ax+by$ giving the line $y=\frac{-ax}{b} + \frac{k}{b}$. Now we want to find the largest value of k such that the line still intersects the unit circle. Graphically it can be seen that this occurs when the line is tangent to the circle. This results in a right triangle with $\frac{k}{b}$ as the hypotenuse and 1 as one of the side lengths. This is where I am stuck because in the solution they had the following triangle;

How do we know that the other side length of the triangle is the gradient of the line?
 A: Applying Cauchy-Schwarz Inequality
$$(ax+by)^2\leq (a^2+b^2)(x^2+y^2)\leq (a^2+b^2) \times 1 =(a^2+b^2)$$
$$ax+by \leq \sqrt{a^2+b^2}$$
A: I think your question is equivalent to proving the tangent of a circle always intersects the radius at a 90 degree angle. You can find the full proof here:
How to prove that the tangent to a circle is perpendicular to the radius drawn to the point of contact?
A: The right triangle you are looking at has one vertex $A$ at the origin, another vertex $B$ at the point $(0, k/b)$, and the third vertex $C$ (a right angle) at the point of tangency between the line and the circle. You've established two of the side lengths of this triangle. The third side length, call it $L$, satisfies
$$\tan B = \frac 1L.$$
But there is another right triangle, formed by the line and the two coordinate axes, that shares the same angle at $B$. The side lengths of this triangle are $k/b$ (the $y$-intercept of the line) and $k/a$ (the $x$-intercept of the line). Therefore
$$\tan B = \frac {k/a}{k/b}=\frac ba$$ which implies $L=\frac ab$.
