Ask Your Question

Revision history [back]

How to format the output of integrate() function when printing?

I want to compute the integral of a function like this:

fi = -0.000004*x^4*y^3+0.000015*x^4*y^2
print(integrate(fi,x))

It prints:

-(8e-07)*x^5*y^3 + (3e-06)*x^5*y^2

Is there a way to format the output so that:

  • it uses normal decimal notation instead of exponential one (-0.0000008 instead of -(8e-07))
  • it has a given precision (it will print 0.000001 instead of 0.000001111 for example)

I know how to do this with a single variable but not when displaying what the integrate() function returns.