I suggest removing the Sqrt
.
Here the minima are derived in different ways:
f[u_, x_, t_] := u[(Sin[t*Pi/6] - x)^2 + (Pi/6 - x)^2]
p1 = Plot[Evaluate[f[Identity, x, #] & /@ Range[-5, 5]], {x, -4, 4}];
exp = x /. First@Solve[D[f[Identity, x, t], x] == 0, x];
pts = Table[{exp, f[Identity, exp, t]} /. t -> j, {j, -5, 5}];
p2 = ListPlot[List /@ pts, PlotMarkers -> {Automatic, 20}];
min = Minimize[f[Identity, x, t], x];
gm = t /. Last@Minimize[min[[1]], t];
cv = (x /. min[[2]]) /. t -> gm;
pi = Show[p1, p2,
Graphics[{Text[Style["x", 20], {cv, f[Identity, cv, gm]}]}],
PlotRange -> {{-1, 1}, {0, 5}}, ImageSize -> 300];
pc = Plot[Evaluate[f[Sqrt, x, #] & /@ Range[-5, 5]], {x, -4, 4},
Epilog -> {PointSize[0.03], Point[{cv, f[Sqrt, cv, gm]}]},
ImageSize -> 300];
Row[{pi, pc}]
Row[{"t=", gm, ", x=", cv}]
The family of curves is shown for illustration. The minimum of family of curves is black cross in no sqrt and black point in sqrt plot. The values of t and xare shown below.
FullSimplify[Minimize[f[x], x], Assumptions -> t > 0]
? $\endgroup$Minimize[f[t*x], {x,t}]
? $\endgroup$In[1582]:= NMinimize[{Sqrt[(Sin[t*Pi/6] - x)^2 + (Pi/6 - x)^2], Element[t, Integers]}, {x, t}] Out[1582]= {0.0166868542533, {x -> 0.511799387799, t -> 1}}
$\endgroup$