Maximize inner product of two vectors of which end points are on two separate circles $$A=\{(x,y)\mid(x-3)^2+(y-4)^2=1\}$$
$$B=\{(x,y)\mid(x-5)^2+(y-2)^2=1\}$$
$$\text{Maximize}\space \overrightarrow{OA}\cdot \overrightarrow{OB}$$
What I tried so far is:
For a given $A$, the product is maximized when $\overrightarrow{OA}$ is parallel to $\overrightarrow{MB}$, $M=(5,2)$
Therefore $\overrightarrow{OB}=(5,2)+\frac{\overrightarrow{OA}}{\|OA\|}$
$A=(3+\cos \theta,4+\sin \theta)$
$\overrightarrow{OA} \cdot \overrightarrow{OB} = (5,2)\cdot\overrightarrow{OA} + \|OA\|=15+5\cos \theta+8+2\sin \theta+\sqrt{6\cos \theta+8\sin \theta+26}$
$\therefore \text{Maximize: }15+5\cos \theta+8+2\sin \theta+\sqrt{6\cos \theta+8\sin \theta+26}$
And I differentiated but it became extremely complicated and I gave up.
 A: I tried some different approach, but it relies heavily on wolfram alpha doing the calculations:
$$ f((x_0,y_0),(x_1,y_1)) = x_0 x_1 + y_0 y_1 $$
$$ g_1(\alpha) = (\cos{\alpha}+3, \sin{\alpha}+4) $$
$$ g_2(\beta) = (\cos{\beta}+5, \sin{\beta}+2) $$
$$ g(\alpha,\beta) = (g_1(\alpha), g_2(\beta)) $$
$$ c(\alpha,\beta) = f(g(\alpha,\beta)) = (\cos{\alpha} + 3)(\cos{\beta} + 5) + (\sin{\beta}+2)(\sin{\alpha}+4) $$
$$ \frac{\partial c}{\partial \alpha} = \cos{\alpha}(\sin{\beta}+2) - \sin{\alpha}(\cos{\beta}+5) $$
$$ \frac{\partial c}{\partial \beta} = \cos{\beta}(\sin{\alpha}+4) - \sin{\beta}(\cos{\alpha}+3) $$
Maximum and minimum are at points where:
$$ \frac{\partial c}{\partial \alpha} = \frac{\partial c}{\partial \beta} = 0 $$
Wolfram alpha gives this picture:

Also, I got large number of solutions:

Then the only thing to worry is whether these points are minimum or maximum.
Next I tried $\max{c(\alpha,\beta)}$ to get a local maximum:

Which seems to be at:

So the maximum value should be somewhere near 34.2783...
