<s>[INST] Extreme Values of $f(P)$ When $P$ Lies Inside a Triangle with Vectices $A$,$B$, $C$ I would appreciate if somebody could help me with the following problem
Q:$P(x,y)$ given point lie inside or on the boundary of triangle $\triangle ABC$.

Find maximum and minimum $f(a,b,c)$
$$f(P)=\vec{PA}\cdot \vec{PB}+\vec{PB}\cdot \vec{PC}+\vec{PC}\cdot \vec{PA}$$
 [/INST] I rewrite my friend H. R's answer and reach to solution by simpler math. First you should notice that f is a function of $\overrightarrow P$ not a,b,c ! you want to find appropriate vector $\overrightarrow P$ for fixed triangle.
$$\eqalign{
  & f\left( {\overrightarrow P } \right) = \overrightarrow {PA} .\overrightarrow {PB}  + \overrightarrow {PB} .\overrightarrow {PC}  + \overrightarrow {PC} .\overrightarrow {PA}   \cr 
  & \overrightarrow {PA} .\overrightarrow {PB}  = \left( {\overrightarrow A  - \overrightarrow P } \right).\left( {\overrightarrow B  - \overrightarrow P } \right) = {\left| {\overrightarrow P } \right|^2} - \left( {\overrightarrow A  + \overrightarrow B } \right).\overrightarrow P  + \overrightarrow A .\overrightarrow B   \cr 
  & \overrightarrow {PB} .\overrightarrow {PC}  = \left( {\overrightarrow B  - \overrightarrow P } \right).\left( {\overrightarrow C  - \overrightarrow P } \right) = {\left| {\overrightarrow P } \right|^2} - \left( {\overrightarrow B  + \overrightarrow C } \right).\overrightarrow P  + \overrightarrow B .\overrightarrow C   \cr 
  & \overrightarrow {PC} .\overrightarrow {PA}  = \left( {\overrightarrow C  - \overrightarrow P } \right).\left( {\overrightarrow A  - \overrightarrow P } \right) = {\left| {\overrightarrow P } \right|^2} - \left( {\overrightarrow C  + \overrightarrow A } \right).\overrightarrow P  + \overrightarrow C .\overrightarrow A  \cr} $$
Hence, you may have
$$f\left( {\overrightarrow P } \right) = 3\overrightarrow P .\overrightarrow P  - 2\overrightarrow P .\left( {\overrightarrow A  + \overrightarrow B  + \overrightarrow C } \right) + \left( {\overrightarrow A .\overrightarrow B  + \overrightarrow B .\overrightarrow C  + \overrightarrow C .\overrightarrow A } \right)$$
or
$$f\left( {\overrightarrow P } \right) = 3\left( {\overrightarrow P  - {1 \over 3}\left({\overrightarrow A  + \overrightarrow B  + \overrightarrow C}\right) } \right).\left( {\overrightarrow P  - {1 \over 3}\left({\overrightarrow A  + \overrightarrow B  + \overrightarrow C}\right) } \right)-{1 \over 3}\left({\overrightarrow A  + \overrightarrow B  + \overrightarrow C}\right).\left({\overrightarrow A  + \overrightarrow B  + \overrightarrow C}\right) + \left( {\overrightarrow A .\overrightarrow B  + \overrightarrow B .\overrightarrow C  + \overrightarrow C .\overrightarrow A } \right)$$
or
$$f\left( {\overrightarrow P } \right) =3 {\left| {\overrightarrow P  - {1 \over 3}\left({\overrightarrow A  + \overrightarrow B  + \overrightarrow C}\right) } \right|^2}-{1 \over 3}{\left| {\overrightarrow A  + \overrightarrow B  + \overrightarrow C } \right|^2}+\left( {\overrightarrow A .\overrightarrow B  + \overrightarrow B .\overrightarrow C  + \overrightarrow C .\overrightarrow A } \right)$$
Finally, you conclude easily that the minimum of $f$ happens when $\overrightarrow P $ is at the centroid of the triangle. (last two sentences are constant and first one is always equal or greater than zero.)
</s>