Hi,
this should work numerically in Matlab - just define your function and use this:
https://de.mathworks.com/help/matlab/ref/integral.html
If you want a analytical solution you will need to use symbolic Toolbox.
PS: if that helped, please accept answer ;-)