expint3.RdComputes the exponential integral \(Ei(x)\) for real values, as well as \(\exp(-x) \times Ei(x)\) and \(E_1(x)\) and their derivatives (up to the 3rd derivative).
expint(x, deriv = 0)
expexpint(x, deriv = 0)
expint.E1(x, deriv = 0)The exponential integral \(Ei(x)\) function is the integral of \(\exp(t) / t\) from 0 to \(x\), for positive real \(x\). The function \(E_1(x)\) is the integral of \(\exp(-t) / t\) from \(x\) to infinity, for positive real \(x\).
Function expint(x, deriv = n) returns the
\(n\)th derivative of \(Ei(x)\) (up to the 3rd),
function expexpint(x, deriv = n) returns the
\(n\)th derivative of
\(\exp(-x) \times Ei(x)\) (up to the 3rd),
function expint.E1(x, deriv = n) returns the \(n\)th
derivative of \(E_1(x)\) (up to the 3rd).
These functions have not been tested thoroughly.
if (FALSE) { # \dontrun{
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")
} # }