Exponential Integral¶
- exponential_integral(first_constant, second_constant, precision=4)¶
Generates the integral of an exponential function
- Parameters
first_constant (int or float) – Constant multiple of the original exponential function; if zero, it will be converted to a small, non-zero decimal value (e.g., 0.0001)
second_constant (int or float) – Base rate of variable of the original exponential function; if zero, it will be converted to a small, non-zero decimal value (e.g., 0.0001); if one, it will be converted to a small, near-one decimal value (e.g., 1.0001)
precision (int, default=4) – Maximum number of digits that can appear after the decimal place of the resultant roots
- Raises
TypeError – First two arguments must be integers or floats
ValueError – Last argument must be a positive integer
- Returns
integral[‘constants’] (list of float) – Coefficients of the resultant integral
integral[‘evaluation’] (func) – Function for evaluating the resultant integral at any float or integer argument
See also
exponential_equation(),exponential_derivatives(),exponential_roots(),exponential_model()Notes
Standard form of an exponential function: \(f(x) = a\cdot{b^x}\)
Integral of an exponential function: \(F(x) = \frac{a}{\ln{b}}\cdot{b^x}\)
Examples
- Import exponential_integral function from regressions library
>>> from regressions.analyses.integrals.exponential import exponential_integral
- Generate the integral of an exponential function with coefficients 2 and 3, then display its coefficients
>>> integral_constants = exponential_integral(2, 3) >>> print(integral_constants['constants']) [1.8205, 3.0]
- Generate the integral of an exponential function with coefficients -2 and 3, then evaluate its integral at 10
>>> integral_evaluation = exponential_integral(-2, 3) >>> print(integral_evaluation['evaluation'](10)) -107498.7045
- Generate the integral of an exponential function with all inputs set to 0, then display its coefficients
>>> integral_zeroes = exponential_integral(0, 0) >>> print(integral_zeroes['constants']) [-0.0001, 0.0001]