# Plotting indefinite integral that has no closed form [duplicate]

How do I plot $\int \sin (\cos (x)) \, dx$ or any other indefinite integral that cannot be evaluated in terms of standard mathematical functions?

On the other hand Mathematica is able to plot this $\int_1^2 \sin (y \cos (x)) \, dx$ as a function of y:

Plot[\!$$\*SubsuperscriptBox[\(\[Integral]$$, $$1$$, $$2$$]$$Sin[ y*Cos[x]] \[DifferentialD]x$$\), {y, 0, 10}]


## marked as duplicate by J. M. will be back soon♦Mar 9 '18 at 12:47

Plot needs expressions that can be evaluated to numerical values when replacing the plot variable by a numerical value. In order to plot a stem function (note that it is not uniquely defined), you can use NIntegrate as follows:

F = t \[Function] NIntegrate[Sin[Cos[x]], {x, 0, t}];
Plot[F[t], {t, 0, 20}]


f[t_?NumericQ] := NIntegrate[Sin[Cos[x]], {x, 0, t}]

Plot[f[t], {t, 0, 20}]


To find the min and max

#[{f[t], 0 < t < 7}, t] & /@ {NMinimize, NMaximize}

(* {{-0.893244, {t -> 4.71239}}, {0.893244, {t -> 1.5708}}} *)


Or

{t, f[t]} /. (FindRoot[f'[t], {t, #}] & /@
Range[1.5, 17, 3]) // Column