Message Boards Message Boards

Numerical and Analytic plots don't overlap.

Posted 10 years ago
I am a begginer on Mathematica integrations then i want to test the plot of simple functions like exponentials.
I have a problem with the following code:

A[r_, c_] := Exp[-c r]
IntNum[r_?NumericQ, c_] := Integrate[A[t, c], {t, 0, r}]
IntAnal[r_, c_] := -(1/c) Exp[-c r]
Plot[{IntNum[r, 1], IntAnal[r, 1]}, {r, 0, 3}]

Plot Image:

I wonder understand why the two functions don't give same plot.

Thank you!
POSTED BY: Davi Dantas
2 Replies
IntAnal seems off by a constant. Observe that
In[2]:= Integrate[Exp[-c t], {t, 0, r}]
Out[2]= (1 - E^((-c) r))/c
POSTED BY: Ilian Gachevski
Posted 10 years ago
Thank you Gachevski!
This constant is the value of integrate of function at origin.
POSTED BY: Davi Dantas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract