# Sine Integrals and Cosine Integrals

 Function Library Home Sin and Cos Integrals

## Table of the Sine and Cosine Integrals

### The Sine Integral

The sin integral Si(z) as a function of a complex variable is an entire function. Further
Si(z) = -Si(-z). There are five versions of the sine integral which are programmed all of which however require that the argument be real. Two versions differ only in that the arguments are of type double or of type long double with return type of type double or of type long double respectively. Another version just evaluates the power series expansion of Si(x) for an argument and return value of type long double. The final two versions calculate both Si(x) and Ci(x) the arguments and the corresponding return values are of type double and long double.

#### Function List

• long double xPower_Series_Si( long double x )

This function returns Si(x) = ∫0x ( sin(t) / t ) dt by evaluating the power series expansion for Si(x). This routine is used in the functions Sin_Integral_Si, xSin_Integral_Si, Sin_Cos_Integrals_Si_Ci, xSin_Cos_Integrals_Si_Ci, Auxiliary_Sin_Integral_fi, Auxiliary_Cos_Integral_gi, and Auxiliary_Sin_Cos_Integrals_fi_gi.

• double Sin_Integral_Si( double x )

This function returns Si(x) = ∫0x ( sin(t) / t ) dt.

• long double xSin_Integral_Si( long double x )

This function returns Si(x) = ∫0x ( sin(t) / t ) dt.

• void Sin_Cos_Integrals_Si_Ci( double x, double *Si, double *Ci )

This function returns Si(x) = ∫0x ( sin(t) / t ) dt and Ci(x) = - ∫x ( cos(t) / t) dt via the argument list. If x = 0 or if Ci(x) < -DBL_MAX, then -DBL_MAX is returned for Ci.

• void xSin_Cos_Integrals_Si_Ci( long double x, long double *Si, long double *Ci )

This function returns Si(x) = ∫0x ( sin(t) / t ) dt and Ci(x) = - ∫x ( cos(t) / t) dt via the argument list. If x = 0, then -LDBL_MAX is returned for Ci.

#### Source Code

C source code is available for these routines:
• The file, power_series_Si.c, contains the function xPower_Series_Si( ).

Dependencies: No external dependencies.

• The file, sin_cos_integrals.c, contains the functions Sin_Integral_Si( ), xSin_Integral_Si( ), Sin_Cos_Integrals_Si_Ci( ), xSin_Cos_Integrals_Si_Ci( ) as well as Entire_Cos_Integral_Cin( ), xEntire_Cos_Integral_Cin( ),
Cos_Integral_Ci( ), and xCos_Integral_Ci( ).

Dependencies: In addition to the file sin_cos_integrals.c, the functions Sin_Cos_Integrals_Si_Ci( ), xSin_Cos_Integrals_Si_Ci( ) as well as Entire_Cos_Integral_Cin( ), xEntire_Cos_Integral_Cin( ),
Cos_Integral_Ci( ), and xCos_Integral_Ci( ) require the following files:

### The Cosine Integral

The cosine integral, Ci(z), as a function of a complex variable is multivalued, in fact,
Ci(z) = γ + ln(z) - Cin(z)
where γ is the Euler constant, and Cin(z) is the entire cosine integral. The usual branch cut is along the negative real axis, i.e. the argument z is restricted to |arg(z)| < π. The argument of the versions of the cosine integral programmed here are real. Further the domain is extended to the negative real axis by defining
Ci(x) = γ + ln(|x|) - Cin(x).
This definition is equivalent to evaluating the integral Ci(x) = - ∫x ( cos(t) / t) dt when x is negative by taking the Cauchy principle value of the integral about the singularity at x = 0 . For real arguments x, then Ci(x) = Ci(-x) and as x → 0, Ci(x) → -∞.

#### Function List

• double Cos_Integral_Ci( double x )

This function returns Ci(x) = - ∫x ( cos(t) / t) dt. If x = 0 or if Ci(x) < -DBL_MAX, then -DBL_MAX is returned.

• long double xCos_Integral_Ci( long double x )

This function returns Ci(x) = - ∫x ( cos(t) / t) dt. If x = 0, then -LDBL_MAX is returned.

• void Sin_Cos_Integrals_Si_Ci( double x, double *Si, double *Ci )

This function returns Si(x) = ∫0x ( sin(t) / t ) dt and Ci(x) = - ∫x ( cos(t) / t) dt via the argument list. If x = 0 or if Ci(x) < -DBL_MAX, then -DBL_MAX is returned for Ci.

• void xSin_Cos_Integrals_Si_Ci( long double x, long double *Si, long double *Ci )

This function returns Si(x) = ∫0x ( sin(t) / t ) dt and Ci(x) = - ∫x ( cos(t) / t) dt via the argument list. If x = 0, then -LDBL_MAX is returned for Ci.

#### Source Code

C source code is available for these routines:
• The file, sin_cos_integrals.c, contains the functions Cos_Integral_Ci( ), xCos_Integral_Ci( ), Sin_Cos_Integrals_Si_Ci( ), xSin_Cos_Integrals_Si_Ci( ) as well as Entire_Cos_Integral_Cin( ), xEntire_Cos_Integral_Cin( ), Sin_Integral_Si( ), and xSin_Integral_Si( ).

Dependencies: In addition to the file sin_cos_integrals.c, the functions Sin_Cos_Integrals_Si_Ci( ), xSin_Cos_Integrals_Si_Ci( ) as well as Entire_Cos_Integral_Cin( ), xEntire_Cos_Integral_Cin( ),
Cos_Integral_Ci( ), and xCos_Integral_Ci( ) require the following files:

### The Entire Cosine Integral

The entire cosine integral Cin(z) as a function of a complex variable is an entire function. Further Cin(z) = Cin(-z). There are three versions of the entire cosine integral which are programmed all of which however require that the argument be real. Two versions differ only in that the arguments are of type double or of type long double with return type of type double or of type long double respectively. The final version just evaluates the power series expansion of Cin(x) for an argument and return value of type long double.

#### Function List

• long double xPower_Series_Cin( long double x )

This function returns Cin(x) = ∫0x ( 1 - cos(t) ) / t ) dt by evaluating the power series expansion for Cin(x). This routine is used in the functions Cos_Integral_Ci, xCos_Integral_Ci, Sin_Cos_Integrals_Si_Ci, xSin_Cos_Integrals_Si_Ci, Entire_Cos_Integral_Cin, xEntire_Cos_Integral_Cin, Auxiliary_Sin_Integral_fi, Auxiliary_Cos_Integral_gi, and Auxiliary_Sin_Cos_Integrals_fi_gi.

• double Entire_Cos_Integral_Cin( double x )

This function returns Cin(x) = ∫0x ( 1 - cos(t) ) / t ) dt.

• long double xEntire_Cos_Integral_Cin( long double x )

This function returns Cin(x) = ∫0x ( 1 - cos(t) ) / t ) dt.

#### Source Code

C source code is available for these routines:
• The file, power_series_Cin.c, contains the function xPower_Series_Cin( ).

Dependencies: No external dependencies.

• The file, sin_cos_integrals.c, contains the functions Entire_Cos_Integral_Cin( ), xEntire_Cos_Integral_Cin( ), Sin_Cos_Integrals_Si_Ci( ), xSin_Cos_Integrals_Si_Ci( ) as well as Cos_Integral_Ci( ), xCos_Integral_Ci( ), Sin_Integral_Si( ), and xSin_Integral_Si( ).

Dependencies: In addition to the file sin_cos_integrals.c, the functions Sin_Cos_Integrals_Si_Ci( ), xSin_Cos_Integrals_Si_Ci( ) as well as Entire_Cos_Integral_Cin( ), xEntire_Cos_Integral_Cin( ),
Cos_Integral_Ci( ), and xCos_Integral_Ci( ) require the following files:

### Auxiliary Sine Integral

The auxiliary sine integral, fi(t) = ∫0 ( sin(t) / ( t + x ) ) dt, is defined for x ≥ 0. There are four versions of the auxiliary sine integral which are programmed. Two versions differ only in that the arguments are of type double or of type long double with return type of type double or of type long double respectively. The final two versions calculate both fi(x) and gi(x) the arguments and the corresponding return values are of type double and long double.

#### Function List

• double Auxiliary_Sin_Integral_fi ( double x )

This function returns fi(t) = ∫0 ( sin(t) / ( t + x ) ) dt. The argument x must be nonnegative.

• long double xAuxiliary_Sin_Integral_fi ( long double x )

This function returns fi(t) = ∫0 ( sin(t) / ( t + x ) ) dt. The argument x must be nonnegative.

• void Auxiliary_Sin_Cos_Integrals_fi_gi ( double x, double *fi, double *gi )

This function returns fi(t) = ∫0 ( sin(t) / ( t + x ) ) dt and gi(t) = ∫0 ( cos(t) / ( t + x ) ) dt via the argument list. The argument x must be nonnegative if x = 0, then gi is set to DBL_MAX.

• void xAuxiliary_Sin_Cos_Integrals_fi_gi ( long double x, long double *fi, long double *gi )

This function returns fi(t) = ∫0 ( sin(t) / ( t + x ) ) dt and gi(t) = ∫0 ( cos(t) / ( t + x ) ) dt via the argument list. The argument x must be nonnegative if x = 0, then gi is set to LDBL_MAX.

#### Source Code

C source code is available for these routines:
• The file, auxiliary_sin_cos_integrals_fi_gi.c, contains Auxiliary_Sin_Integral_fi( ), xAuxiliary_Sin_Integral_fi( ), Auxiliary_Sin_Cos_Integrals_fi_gi( ), and xAuxiliary_Sin_Cos_Integrals_fi_gi( ) as well as Auxiliary_Cos_Integral_gi( ) and xAuxiliary_Cos_Integral_gi( ),

### Auxiliary Cosine Integral

The auxiliary cosine integral, gi(t) = ∫0 ( cos(t) / ( t + x ) ) dt, is defined for x > 0. As x → 0+, gi(x) → ∞.

#### Function List

• double Auxiliary_Cos_Integral_gi ( double x )

This function returns gi(t) = ∫0 ( cos(t) / ( t + x ) ) dt for integer s > 1. The argument x must be nonnegative, if x = 0, then DBL_MAX is returned.

• long double xAuxiliary_Cos_Integral_gi ( long double x )

This function returns gi(t) = ∫0 ( cos(t) / ( t + x ) ) dt for integer s > 1. The argument x must be nonnegative, if x = 0, then LDBL_MAX is returned.

• void Auxiliary_Sin_Cos_Integrals_fi_gi ( double x, double *fi, double *gi )

This function returns fi(t) = ∫0 ( sin(t) / ( t + x ) ) dt and gi(t) = ∫0 ( cos(t) / ( t + x ) ) dt via the argument list. The argument x must be nonnegative if x = 0, then gi is set to DBL_MAX.

• void xAuxiliary_Sin_Cos_Integrals_fi_gi ( long double x, long double *fi, long double *gi )

This function returns fi(t) = ∫0 ( sin(t) / ( t + x ) ) dt and gi(t) = ∫0 ( cos(t) / ( t + x ) ) dt via the argument list. The argument x must be nonnegative if x = 0, then gi is set to LDBL_MAX.

#### Source Code

C source code is available for these routines:
• The file, auxiliary_sin_cos_integrals_fi_gi.c, contains Auxiliary_Cos_Integral_gi( ), xAuxiliary_Cos_Integral_gi( ), Auxiliary_Sin_Cos_Integrals_fi_gi( ), and xAuxiliary_Sin_Cos_Integrals_fi_gi( ) as well as Auxiliary_Sin_Integral_fi( ) and xAuxiliary_Sin_Integral_fi( ),