# About TF2 Integral

**URL:** <https://root-forum.cern.ch/t/about-tf2-integral/45423>\
**Category:** ROOT\
**Created:** [June 16, 2021, 8:55am UTC](https://root-forum.cern.ch/t/about-tf2-integral/45423 "2021-06-16T08:55:43Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [June 16, 2021, 9:50am UTC](https://root-forum.cern.ch/t/about-tf2-integral/45423/5 "2021-06-16T09:50:06Z")

</div>

Hi,  
There exists many example for this. A recent and simple one is this:

> [@Help with TF2 integral](https://root-forum.cern.ch/t/help-with-tf2-integral/45326/4):
>
> So, I’ve tried some functions. For instance, first I tried to compute Int\_0^2 dx Int\_0^2 dy x\*y using this code: double func2(const double \*x){ return x[0]\*x[1]; } void integral(){ ROOT::Math::Functor f2(& func2, 2); double a[2] = {0,2}; double b[2] = {1,2}; ROOT::Math::IntegratorMultiDim ig1(ROOT::Math::IntegrationMultiDim::kADAPTIVE); ig1.SetFunction(f2); double val = ig1.Integral(a,b); cout\<\<val\<\<endl; } It worked. Them, I tried to change the y integration limits to Blockquote…

---

_[View the full topic](https://root-forum.cern.ch/t/about-tf2-integral/45423)._
