<s>[INST] If $a,b$ are positive integers and $x^2+y^2\leq 1$ then find the maximum of $ax+by$ without differentiation. If $x^2+y^2\leq 1$ then maximum of $ax+by$
Here what I have done so far.
Let $ax+by=k$ . Thus $by=k-ax$.
So we can have that $$b^2x^2+(k-ax)^2 \leq b^2$$
$$b^2x^2+k^2-2akx +a^2x^2-b^2\leq 0 $$
By re-writing as a quadratic of $x$ ,
$$(a^2+b^2)x^2-2akx +k^2-b^2\leq 0 $$
Since $a^2+b^2$ is positive , above quadratic has a minimum. Thus it to be negeative it must have roots.
So $$(-2ak)^2-4(a^2+b^2)(k^2-b^2) \geq 0$$
$$a^2k^2-(a^2+b^2)k^2+(a^2+b^2)b^2 \geq 0$$
$$(a^2+b^2) \geq k^2$$
So maximum of $k$ is $\sqrt{a^2+b^2}$
Is this correct ? 
If it is correct any shorter method ? Thanks in advance.
 [/INST] You can consider $$(ax+by)^2+(bx-ay)^2=(a^2+b^2)(x^2+y^2)\le a^2+b^2$$ so that $$(ax+by)^2\le a^2+b^2-(bx-ay)^2$$
Equality is attained when $x^2+y^2=1$ and $bx=ay$

How did I get that second square? Well I wanted to work with the square of the target expression and to get a term in $x^2+y^2$, so I needed to swap $a$ and $b$ around so I had equivalent terms in $x$ and $y$. Then I wanted to eliminate the cross term, so I put the minus sign in to achieve that.
It is sometimes useful to pick out the cross term and eliminate the squares by doing something like $$(ax+by)^2-(ax-by)^2=4abxy$$ - for example in working with an area represented by the cross term.
</s>