# Plot  a numerical integration as a function of variable

**URL:** <https://community.wolfram.com/t/plot-a-numerical-integration-as-a-function-of-variable/24789>\
**Category:** Questions\
**Tags:** physics, calculus, graphics-and-visualization, numerical-computation\
**Created:** [November 16, 2024, 8:46am UTC](https://community.wolfram.com/t/plot-a-numerical-integration-as-a-function-of-variable/24789 "2024-11-16T08:46:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fatemealiyan1374](https://avatars.discourse-cdn.com/v4/letter/f/c89c15/32.png) [@fatemealiyan1374](https://community.wolfram.com/u/fatemealiyan1374)\
**Post date:** [November 16, 2024, 8:46am UTC](https://community.wolfram.com/t/plot-a-numerical-integration-as-a-function-of-variable/24789/1 "2024-11-16T08:46:53Z")

</div>

Hi, I hope you are doing well.

I was trying to get a numerical integration from the following function

```
(Nu)^3 r/(Exp[h Nu/(K T2)] - 1)

```

where T is a function of r and has quite a complexity  
I received the error after running the following code

```
\[Nu]1 = 0; \[Nu]2 = 1;
n = 50;
\[Nu] = Range[\[Nu]1, \[Nu]2, (\[Nu]2 - \[Nu]1)/(n - 1.)];
L1[\[Nu]_, r_] := (\[Nu]e[[1, 1]])^3 r/(h \[Nu]e[[1, 1]]/(K T1));

points = Map[{#, NIntegrate[L1[r, #], {r, 6.49, 71.39}]} &, \[Nu]]
ListLinePlot[points]...

```

the errors are as follows

NIntegrate::izero: Integral and error estimates are 0 on all integration subregions. Try increasing the value of the MinRecursion option. If value of integral may be 0, specify a finite value for the AccuracyGoal option.

Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered.

NIntegrate::precw: The precision of the argument function (Indeterminate if Re[r]\>0.\*10^-20||r[NotElement][DoubleStruckCapitalR]) is less than WorkingPrecision (MachinePrecision).

NIntegrate::inumri: The integrand Indeterminate if Re[r]\>0.\*10^-20||r[NotElement][DoubleStruckCapitalR] has evaluated to Overflow, Indeterminate, or Infinity for all sampling points in the region with boundaries {{6.49,71.39}}.

Power::infy: Infinite expression 1/0. encountered.

[Untitled-2.nb](https://community.wolfram.com/uploads/short-url/awOdPu45HyN8aZQ1no8NXrTWlmY.nb) (107 KB)

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [November 16, 2024, 11:09am UTC](https://community.wolfram.com/t/plot-a-numerical-integration-as-a-function-of-variable/24789/2 "2024-11-16T11:09:26Z")

</div>

First of all, beware of `MatrixForm`: this is for display only, never use it in in calculation. For example,

```
Y = Table[y, {a, {.1, .5, .8, .9, 1}}] // MatrixForm;

```

messes up all calculations involving `Y`, and the semicolon at the end suppresses display, which defeats the only purpose of `MatrixForm `. Either remove `MatrixForm` or write it this way:

```
(Y = Table[y, {a, {.1, .5, .8, .9, 1}}]) // MatrixForm

```

Next, when you define `L1[\[Nu]_, r_]`, the right-hand side does not contain `\[Nu]`. Are you sure this is what you mean? Also, the right-hand side evaluates to `Indeterminate`.

Your definition of `points` contains `L1[r, #]`, with `r` as first argument, after you defined `L1` with `r` as second argument.
