# Elliptic integrals with parameter outside 0<m<1

I'm attempting to implement an equation (for calculating magnetic forces between coils, eqs (22–24) in the linked paper) that requires the use of elliptic integrals.

Unfortunately these equations require the evaluation of the elliptic integrals far outside their standard parameter range of $0\le m\le 1$ and the numerical implementations I have available to evaluate them give inconsistent results.

I believe that Mathematica is correct in its answer:

EllipticF[ArcSin[Sqrt[1/c5]], c5] //. c5 -> 817.327
=> 0.054961 - 1.17196*10^-17 i

Whereas Matlab's MuPad engine gives:

mfun('EllipticF',asin(sqrt(1/817.327)),sqrt(817.327))
=> 0.054961 - 0.000707i

(Mma's function takes parameter $m=k^2$ whereas MuPad takes modulus $k$, explaining the sqrt) While I can use Mathematica for my own work, my colleagues only have Matlab available and I'd like them to be able to use this code.

I'm a pretty unfamiliar with the theory behind elliptic integrals, but Baker's ‘Elliptic Functions’ says

We shall see later on that the quantity $k^2$ [...] can always be considered real and less than unity.

Which leads me to ask: can the arguments to these elliptic integrals be re-stated in terms of an input of $k>1$, such as I seem to require above?

-

– J. M. Oct 31 '10 at 3:56
Lest people become confused with terminology: $k$ is a modulus, while $m$ is a parameter. – J. M. Oct 31 '10 at 8:10
I had a look at that paper you linked to; a lot of their elliptic integral expressions are a baroque mess, and I suspect they only wrote what Mathematica spat out without even pausing to look at what can be simplified. – J. M. Oct 31 '10 at 10:40
Thanks for the nudge on getting my naming straight. I edited the question slightly to improve my terminology there. Regarding the elliptic integrals, I'm sure you're right unfortunately; I'm actually having some further issues (my question only addresses one term of the equations, as you will have seen in the paper) but I need to get my head straight before I keep asking for help. Thanks again in the mean time! – Will Robertson Oct 31 '10 at 14:18

## 1 Answer

What you seem to require here are the so-called "reciprocal-modulus transformations".

In your specific case, upon applying the reciprocal-modulus transformation, your elliptic integral can actually be simplified to

$$\frac1{\sqrt{c_5}}F\left(\frac{\pi}{2}\vert \frac1{c_5}\right)=\frac1{\sqrt{c_5}}K\left(\frac1{c_5}\right)$$.

where $K(m)$ is the complete elliptic integral of the first kind with parameter $m$ (though I understand MuPAD uses $k=\sqrt{m}$ as argument, in which case you seem to know the conversion formulae already).

There are similar formulae for the elliptic integrals of the second and third kinds, and I direct you to the DLMF link I gave above for them.

-

For a Mathematica demonstration: With[{c5 = 817.327}, {EllipticK[1/c5]/Sqrt[c5], EllipticF[ArcSin[1/Sqrt[c5]], c5]}] // Chop – J. M. Oct 31 '10 at 3:54
Fantastic, thanks! This both fixes my Matlab code and makes the equation nicer. One of the downsides of equation derivation by a CAS, I suppose. I suspect there are some more simplifications that can then be made in the overall equation. – Will Robertson Oct 31 '10 at 4:34
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 10, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9058256149291992, "perplexity_flag": "middle"}