0
$\begingroup$

Trying to plot in Mathematica with an integral as the iterator

Plot[x, {Integrate[1/Sqrt[0.31*x + 0.68*x^4 + 0.01*x^2], x], 0, 10^7}]

But get the error that it the integral can't be used as an iterator. On the other hand if I try

Plot[Integrate[1/Sqrt[0.31*x + 0.68*x^4 + 0.01*x^2], x], {x, 0, 10^7}]

I get the 'invalid integration variable or limit' error.

$\endgroup$
1
  • $\begingroup$ You try to plot something like Plot[x,{f[x],f0,f1}]? That's only possible, I think, if you know the InverseFunction of f: Plot[InverseFunction[f[x]],{f ,f0,f1}] $\endgroup$ Commented Mar 21, 2020 at 16:12

1 Answer 1

3
$\begingroup$
  Plot[x, {Integrate[1/Sqrt[0.31*x + 0.68*x^4 + 0.01*x^2], x], 0, 10^7}]

This is not going to work, because Plot has the form Plot[f[x],{x,from,to}] and so you need a symbol in x and not Integrate in there.

   Plot[Integrate[1/Sqrt[0.31*x + 0.68*x^4 + 0.01*x^2], x], {x, 0, 10^7}]

For this one, you can make it to work like this

foo[to_?NumericQ] := 
 Module[{x}, NIntegrate[1/Sqrt[0.31*x + 0.68*x^4 + 0.01*x^2], {x, 0, to}]];

Plot[foo[x], {x, 0, 10}, AxesOrigin -> {0, 0}]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.