expint {VGAM}R Documentation

The Exponential Integral and Variants

Description

Computes the exponential integral Ei(x)Ei(x) for real values, as well as exp(x)×Ei(x)\exp(-x) \times Ei(x) and E1(x)E_1(x) and their derivatives (up to the 3rd derivative).

Usage

expint(x, deriv = 0)
expexpint(x, deriv = 0)
expint.E1(x, deriv = 0)

Arguments

x

Numeric. Ideally a vector of positive reals.

deriv

Integer. Either 0, 1, 2 or 3.

Details

The exponential integral Ei(x)Ei(x) function is the integral of exp(t)/t\exp(t) / t from 0 to xx, for positive real xx. The function E1(x)E_1(x) is the integral of exp(t)/t\exp(-t) / t from xx to infinity, for positive real xx.

Value

Function expint(x, deriv = n) returns the nnth derivative of Ei(x)Ei(x) (up to the 3rd), function expexpint(x, deriv = n) returns the nnth derivative of exp(x)×Ei(x)\exp(-x) \times Ei(x) (up to the 3rd), function expint.E1(x, deriv = n) returns the nnth derivative of E1(x)E_1(x) (up to the 3rd).

Warning

These functions have not been tested thoroughly.

Author(s)

T. W. Yee has simply written a small wrapper function to call the NETLIB FORTRAN code. Xiangjie Xue modified the functions to calculate derivatives. Higher derivatives can actually be calculated—please let me know if you need it.

References

https://netlib.org/specfun/ei.

See Also

log, exp. There is also a package called expint.

Examples

 ## Not run: 
par(mfrow = c(2, 2))
curve(expint, 0.01, 2, xlim = c(0, 2), ylim = c(-3, 5),
      las = 1, col = "orange")
abline(v = (-3):5, h = (-4):5, lwd = 2, lty = "dotted", col = "gray")
abline(h = 0, v = 0, lty = "dashed", col = "blue")

curve(expexpint, 0.01, 2, xlim = c(0, 2), ylim = c(-3, 2),
      las = 1, col = "orange")
abline(v = (-3):2, h = (-4):5, lwd = 2, lty = "dotted", col = "gray")
abline(h = 0, v = 0, lty = "dashed", col = "blue")

curve(expint.E1, 0.01, 2, xlim = c(0, 2), ylim = c(0, 5),
      las = 1, col = "orange")
abline(v = (-3):2, h = (-4):5, lwd = 2, lty = "dotted", col = "gray")
abline(h = 0, v = 0, lty = "dashed", col = "blue")

## End(Not run)

[Package VGAM version 1.1-11 Index]