Given the function fun1[a, b, x]
, I want minimize this function over $a$ and $b$ such that $0\le a \le 2\pi$ and $0\le b\le 2\pi$, and plot the resulting function w.r.t. variable $x$. The following attempt doesn't seem to work:
fun1[a_, b_, x_] = -2 + Sqrt[1 + x^2 - 2 x Cos[a]] + Sqrt[
2 - 2 Cos[b]] + Sqrt[1 + x^2 + 2 x Cos[a + b]];
fun2[x_] := fun1[a, b, x] /. Last[NMinimize[fun1[a, b, x], {a, b}]]
tab = Table[fun2[x], {x, 0, 1, 0.001}];
ListPlot[tab]
Further, I need to find the values of $a$ and $b$ for which fun1[a, b, x]
is less or equal to zero.