How can I use the pgf
maths engine to plot the integral of any function?
For example \addplot {int(cos(x))}
does not work.
pgfplots
How can I use the pgf
maths engine to plot the integral of any function?
For example \addplot {int(cos(x))}
does not work.
Best Answer
As was said in the comments, you PGF can't compute the antiderivative analytically. If the function is reasonably linear, you can quite easily compute the antiderivative numerically, similar to the approach in Get derivative of a function.
Here's an approach using PGFPlotstable to calculate the function values: