1
$\begingroup$

I am trying to plot M[x]=e^(x^2) and the integral solution of I= ∫x^2*M(x) dx on the same plot. I did the following:

F[x_] := e^(x^2)
Lamb = Plot[F[x], {x, 0, 10}] to get the one of the graphs.

Now to plot the integral solution I did this:

MI[x_] := x^2*F[x]
Integrate[MI[x], {x, 0, 20}]
46.3718

To plot it I did the following:

u[x_?NumericQ] := NIntegrate[(x^2*E^x^2), {x, 0, 2}]
Plot[u[x], {x, 0, 20}]

However, I am not getting a graph for the integral solution. Is it possible to get one? If it is, I want to plot F(x) and the integral solution on the same plot.

$\endgroup$
  • 2
    $\begingroup$ Your $F[x]$ should have $E^{x^2}$ or Exp[x^2], not the lower case $e$. $\endgroup$ – Moo Jul 27 at 15:13
1
$\begingroup$

Perhaps what you really want is:

Clear[u, x]
u[z_?NumericQ] = Integrate[(x^2*E^x^2), {x, 0, z}];
LogPlot[u[x], {x, 0, 20}]

plot

Doing the integral symbolically at top-level returns a expression with z as the independent variable and x eliminated since it is the variable over which the definite integral is evaluated.

| improve this answer | |
$\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.