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

asked 2021-05-09 16:46:15 +0100

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.

edit retag flag offensive close merge delete

Comments

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

Try assigning what integrate returns to a variable :)

rburing gravatar imagerburing ( 2021-05-10 09:18:37 +0100 )edit