# Using integral in a fit function

**URL:** <https://root-forum.cern.ch/t/using-integral-in-a-fit-function/49743>\
**Category:** Newbie\
**Tags:** root\
**Created:** [April 25, 2022, 10:31pm UTC](https://root-forum.cern.ch/t/using-integral-in-a-fit-function/49743 "2022-04-25T22:31:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![omar](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/f0a364/32.png) [@omar](https://root-forum.cern.ch/u/omar)\
**Post date:** [April 25, 2022, 10:31pm UTC](https://root-forum.cern.ch/t/using-integral-in-a-fit-function/49743/1 "2022-04-25T22:31:32Z")

</div>

Hello,  
I am new to root and I have been trying to do a fit using Birks’ function which contains an integral. I know how to define my own function for the fit but I don’t know how to include the integral in it. If someone knows a simple example to understand or a solution I would really appreciate it. Thank you in advance. Note that the parameters are the S and kB circled in blue.  
 ![birks](https://root-forum.cern.ch/uploads/default/original/3X/e/4/e47242b5e1f8b77e62165135b1aa840a41d8cfae.png)

\_ROOT Version:6.24/06  
\_Platform:Ubuntu 20.04  
\_Compiler:gcc

* * *

---

<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:** [April 26, 2022, 7:34am UTC](https://root-forum.cern.ch/t/using-integral-in-a-fit-function/49743/2 "2022-04-26T07:34:51Z")

</div>

Hi  
See the example posted in [Fitting in ROOT with a function having two integrals in it - #10 by moneta](https://root-forum.cern.ch/t/fitting-in-root-with-a-function-having-two-integrals-in-it/49588/10)

Lorenzo
