# Custom function with integrate generating Plot\[ \] errors

**URL:** <https://community.wolfram.com/t/custom-function-with-integrate-generating-plot-errors/17554>\
**Category:** Questions\
**Tags:** calculus, graphics-and-visualization\
**Created:** [February 3, 2021, 8:21pm UTC](https://community.wolfram.com/t/custom-function-with-integrate-generating-plot-errors/17554 "2021-02-03T20:21:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![masandlin](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@masandlin](https://community.wolfram.com/u/masandlin)\
**Post date:** [February 3, 2021, 8:21pm UTC](https://community.wolfram.com/t/custom-function-with-integrate-generating-plot-errors/17554/1 "2021-02-03T20:21:59Z")

</div>

I am creating a user defined function f[t\_] := where I am evaluating an integral in the body of the function without any issues. I can subsequently evaluate the user function f[t] and obtain the correct answer. However, when I plot the expression using the Plot[] function, I get a number of errors - see attached notebook. For simplicity, I have omitted the constant from the indefinite integral.

My best guess is that there is some extra data being created in the integrate function that creating problems in the plot function. However, I do not know what it is, how to identify it and how to remove it. Again this problem is most likely because I don’t understand the functions so please point me in the correct direction.

Thanks,

Mitch Sandlin

[Integral\_Plot\_Question.nb](https://community.wolfram.com/uploads/short-url/35WMXgOyPfMiiCYmStN9xaTNFMS.nb) (18.1 KB)

---

<div class="post-metadata">

**Author:** ![ahmed](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/ahmed/32/5858_2.png) [@ahmed](https://community.wolfram.com/u/ahmed)\
**Post date:** [February 3, 2021, 8:40pm UTC](https://community.wolfram.com/t/custom-function-with-integrate-generating-plot-errors/17554/2 "2021-02-03T20:40:35Z")

</div>

Hi Mitch

Just use Evaluate in Plot to make sure the integration being evaluated first

```
Plot[Evaluate@f[t], {t, -5, 5}]

```
