# ellipticPi

Complete and incomplete elliptic integrals of the third kind

## Syntax

``ellipticPi(n,m)``
``ellipticPi(n,phi,m)``

## Description

````ellipticPi(n,m)` returns the complete elliptic integral of the third kind.```
````ellipticPi(n,phi,m)` returns the incomplete elliptic integral of the third kind.```

## Examples

### Compute the Incomplete Elliptic Integrals of Third Kind

Compute the incomplete elliptic integrals of the third kind for these numbers. Because these numbers are not symbolic objects, you get floating-point results.

```s = [ellipticPi(-2.3, pi/4, 0), ellipticPi(1/3, pi/3, 1/2),... ellipticPi(-1, 0, 1), ellipticPi(2, pi/6, 2)]```
```s = 0.5877 1.2850 0 0.7507```

Compute the incomplete elliptic integrals of the third kind for the same numbers converted to symbolic objects. For most symbolic (exact) numbers, `ellipticPi` returns unresolved symbolic calls.

```s = [ellipticPi(-2.3, sym(pi/4), 0), ellipticPi(sym(1/3), pi/3, 1/2),... ellipticPi(-1, sym(0), 1), ellipticPi(2, pi/6, sym(2))]```
```s = [ ellipticPi(-23/10, pi/4, 0), ellipticPi(1/3, pi/3, 1/2),... 0, (2^(1/2)*3^(1/2))/2 - ellipticE(pi/6, 2)]```

Here, `ellipticE` represents the incomplete elliptic integral of the second kind.

Use `vpa` to approximate this result with floating-point numbers:

`vpa(s, 10)`
```ans = [ 0.5876852228, 1.285032276, 0, 0.7507322117]```

### Differentiate Incomplete Elliptic Integrals of Third Kind

Differentiate these expressions involving the complete elliptic integral of the third kind:

```syms n m diff(ellipticPi(n, m), n) diff(ellipticPi(n, m), m)```
```ans = ellipticK(m)/(2*n*(n - 1)) + ellipticE(m)/(2*(m - n)*(n - 1)) -... (ellipticPi(n, m)*(- n^2 + m))/(2*n*(m - n)*(n - 1)) ans = - ellipticPi(n, m)/(2*(m - n)) - ellipticE(m)/(2*(m - n)*(m - 1))```

Here, `ellipticK` and `ellipticE` represent the complete elliptic integrals of the first and second kinds.

### Compute Integrals for Matrix Input

Call `ellipticPi` for the scalar and the matrix. When one input argument is a matrix, `ellipticPi` expands the scalar argument to a matrix of the same size with all its elements equal to the scalar.

`ellipticPi(sym(0), sym([1/3 1; 1/2 0]))`
```ans = [ ellipticK(1/3), Inf] [ ellipticK(1/2), pi/2]```

Here, `ellipticK` represents the complete elliptic integral of the first kind.

## Input Arguments

collapse all

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

collapse all

### Incomplete Elliptic Integral of the Third Kind

The incomplete elliptic integral of the third kind is defined as follows:

`$\Pi \left(n;\phi |m\right)=\underset{0}{\overset{\phi }{\int }}\frac{1}{\left(1-n{\mathrm{sin}}^{2}\theta \right)\sqrt{1-m{\mathrm{sin}}^{2}\theta }}d\theta$`

Note that some definitions use the elliptical modulus k or the modular angle α instead of the parameter m. They are related as m = k2 = sin2α.

### Complete Elliptic Integral of the Third Kind

The complete elliptic integral of the third kind is defined as follows:

`$\Pi \left(n,m\right)=\Pi \left(n;\frac{\pi }{2}|m\right)=\underset{0}{\overset{\pi /2}{\int }}\frac{1}{\left(1-n{\mathrm{sin}}^{2}\theta \right)\sqrt{1-m{\mathrm{sin}}^{2}\theta }}d\theta$`

Note that some definitions use the elliptical modulus k or the modular angle α instead of the parameter m. They are related as m = k2 = sin2α.

## Tips

• `ellipticPi` returns floating-point results for numeric arguments that are not symbolic objects.

• For most symbolic (exact) numbers, `ellipticPi` returns unresolved symbolic calls. You can approximate such results with floating-point numbers using `vpa`.

• All non-scalar arguments must have the same size. If one or two input arguments are non-scalar, then `ellipticPi` expands the scalars into vectors or matrices of the same size as the non-scalar arguments, with all elements equal to the corresponding scalar.

• `ellipticPi(n, pi/2, m) = ellipticPi(n, m)`.

 Milne-Thomson, L. M. “Elliptic Integrals.” Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. (M. Abramowitz and I. A. Stegun, eds.). New York: Dover, 1972.