This is the proof of Cauchy-Schwarz inequality given in "One variable calculus with introduction to linear algebra" by Tom M. Apostol.
In last paragraph It is said that the right hand side has smallest value when x=... etc!
so we proved.
My question is why we choose smallest value? why not largest value? are we allowed to choose like this? Is this logically correct to choose like this? we choose some particular x, doesn't it went wrong if we choose like this? please explain this.

We have $$A\left(x+\frac{B}{A}\right)^2+\frac{AC-B^2}{A}$$. $A$ is a sum of squares, it can never be negative, and we want $$Ax^2+2Bx+C\geq 0$$. The first summand is $$A\left(x+\frac {B}{A}\right)\geq 0$$ for all real $x$, then our whole sum is not negative if also the second summand is non negative if $$AC-B^2\geq 0$$