# Plotting solution of an integral

I have used below code to plot the solution of an integral, but the code doesn't return anything. Could somebody please help me in this regard?

a=0.1;
Assuming[
t \[Element] Reals,
Plot[Integrate[-Sin[tp] Exp[-((
16 a  Cos[tp - 2 t + 3 Pi/2] Cos[
2 tp])/((1 - a^2) \[Pi]))], {tp, 0, 2 Pi}], {t, 0, 2 Pi}]]

• did you check before plotting if the integrate actually works and it produces solution? it might be that Mathematica could not integrate it. – Nasser Dec 6 '19 at 21:16
• It doesn't work! @Nasser – Marco Dec 6 '19 at 21:17
• Then this explains why the plot did not work. – Nasser Dec 6 '19 at 21:18
• But there might be a way to make it work @Nasser – Marco Dec 6 '19 at 21:19

## 1 Answer

Integrate does not seem to be able to do it. Try NIntegate

ClearAll[t, tp, a];
a = 0.1;
tick = {Range[0, 2 Pi, Pi/2], Automatic};
foo[t_?NumericQ] := NIntegrate[-Sin[tp] Exp[-((16 a Cos[tp - 2 t + 3 Pi/2]
Cos[2 tp])/((1 - a^2) Pi))], {tp, 0, 2 Pi}]

Plot[foo[t], {t, 0, 2 Pi}, Ticks -> tick, GridLines -> tick,
GridLinesStyle -> LightGray, PlotStyle -> Red] • what is foo[t_?NumericQ]? – Marco Dec 6 '19 at 21:26
• @Marco just function name. change it to something else you prefer. – Nasser Dec 6 '19 at 21:27
• Is it possible to plot a density plot with variables $a$ and $t$? – Marco Dec 6 '19 at 21:36
• @Marco it is probably possible. Please post separate question and and make it clear what is it you are asking for, someone should be able to help. – Nasser Dec 6 '19 at 21:38
• why is the argument of the function like this? t_?NumericQ – Marco Dec 6 '19 at 21:40