# NIntegrate Error?

**URL:** <https://community.wolfram.com/t/nintegrate-error/1430>\
**Category:** Questions\
**Tags:** mathematica, calculus, numerical-computation\
**Created:** [February 6, 2014, 12:51am UTC](https://community.wolfram.com/t/nintegrate-error/1430 "2014-02-06T00:51:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![triplealexxx](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@triplealexxx](https://community.wolfram.com/u/triplealexxx)\
**Post date:** [February 6, 2014, 12:51am UTC](https://community.wolfram.com/t/nintegrate-error/1430/1 "2014-02-06T00:51:19Z")

</div>

Hi Iam trying to use Nintegrate but I keep getting an error. Can somone explain how I can use it correctly. THanks.

```auto
Clear ["global'*"]
Nc = 2.8*10^19;
nexact [\[Eta]c_] := NIntegrate[Nc*(2/\[Sqrt]\[Pi])*(x^(1/2))/(1 + e^(x - \[Eta]c)), {x, 0, 20}]; nexact[1]

```

---

<div class="post-metadata">

**Author:** ![bsimpson141421356](https://avatars.discourse-cdn.com/v4/letter/b/ac91a4/32.png) [@bsimpson141421356](https://community.wolfram.com/u/bsimpson141421356)\
**Post date:** [February 6, 2014, 1:16am UTC](https://community.wolfram.com/t/nintegrate-error/1430/2 "2014-02-06T01:16:25Z")

</div>

```auto
In[1]:= Nc = 2.8*10^19;
nexact[nc_] := NIntegrate[Nc*2/Sqrt[Pi]*(x^(1/2))/(1 + e^(x - nc)), {x, 0, 20}];
nexact[1]

During evaluation of In[1]:= NIntegrate::inumr: The integrand (3.15946*10^19 Sqrt[x])/(1+e^(-1+x)) has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,20}}. >>

Out[3]= NIntegrate[(Nc 2 Sqrt[x])/(Sqrt[\[Pi]] (1 + e^(x - 1))), {x, 0, 20}]

In[4]:= Nc = 2.8*10^19;
nexact[nc_] := NIntegrate[Nc*2/Sqrt[Pi]*(x^(1/2))/(1 + E^(x - nc)), {x, 0, 20}];
nexact[1]

Out[6]= 4.41179*10^19

```

Compare the two definitions of nexact character by character to find the difference.

See the suggestion I added to the end of the new features suggestion list yesterday and a much older suggestion I made earlier about “novice mode”.

---

<div class="post-metadata">

**Author:** ![dreiss](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/dreiss/32/29094_2.png) [@dreiss](https://community.wolfram.com/u/dreiss)\
**Post date:** [February 6, 2014, 7:30pm UTC](https://community.wolfram.com/t/nintegrate-error/1430/3 "2014-02-06T19:30:30Z")

</div>

Just FYI, though the Clear function has no bearing on your quesiton, your

```auto
Clear ["global'*"]

```

should be

```auto
Clear ["Global'*"]

```

---

<div class="post-metadata">

**Author:** ![iliang](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/iliang/32/11263_2.png) [@iliang](https://community.wolfram.com/u/iliang)\
**Post date:** [February 6, 2014, 10:57pm UTC](https://community.wolfram.com/t/nintegrate-error/1430/4 "2014-02-06T22:57:10Z")

</div>

> _ **David Reiss wrote:** _  
> should be
> 
> ```auto
> Clear ["Global'*"]
> 
> ```

It would work better with a context mark, aka backtick:

```auto
Clear["Global`*"]

```
