0
$\begingroup$

I'm a beginner. I would like to draw the plot of a certain function $f(n)$, n=1,2,...

Specifically, my function is

$$\int_0^\infty\left(\frac12 + \frac12\cdot\mathrm{erf}(x/\sqrt 2)\right)^n \exp(-x^2) \mathrm{d}x $$

Thanks!

$\endgroup$
  • 3
    $\begingroup$ Generally, you have a bigger chance of getting an answer if you show some effort of your own, e.g. some code that you got (but doesn't work), or some things you looked at $\endgroup$ – Lukas Lang Sep 7 '17 at 9:21
  • $\begingroup$ Please see asking guidelines. One of which is to be familiar with basic syntax. $\endgroup$ – Kuba Sep 7 '17 at 9:24
  • $\begingroup$ You need DiscretePlot, NIntegrate, how to define a function (in terms of n), and avoiding premature evaluation with NIntegrate $\endgroup$ – Szabolcs Sep 7 '17 at 9:51
2
$\begingroup$

You need DiscretePlot, NIntegrate, how to define a function (in terms of n), and avoiding premature evaluation with NIntegrate.

f[n_?NumericQ] := 
 NIntegrate[(1/2 + 1/2 Erf[x/Sqrt[x]])^n Exp[-x^2], {x, 0, Infinity}]

DiscretePlot[f[n], {n, 0, 10}, PlotRange -> {0, 1}]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.