Skip to content
Advertisement

Plot with variable limit of integration in python

I have function f(x) and I want to integrate the function from 0 to some point x in the interval (0,2). I know how to solve the problem in mathematica, however I don’t know how to solve this problem in python.

Mathematica

JavaScript

My code in python:

JavaScript

How can I do exactly the same in python?

Advertisement

Answer

JavaScript

quads inputs are f, a, b, here you do integration from 0 to t for all t in y.

Advertisement