# Leapfrog Integration

## The Leapfrog Method

Consider a system of coupled ordinary differential equations of the form

\eqalign{ \frac{df}{dx} &= g(x, k(x)) \cr \frac{dk}{dx} &= h(x, f(x)). } \label{coupled}

The simplified Midpoint method can be exploited to solve these equations.

First, advance $f$ by half a step to get $f(x_{1/2})$:

$$f(x_{1/2}) = f(x_0) + \frac{\Delta x}{2} \cdot g(k(x_0)). \label{leapfrog1}$$

Then, repeat the following until $x = x_{\text{final}}$:

\eqalign{ k(x_{i+1}) &= k(x_i) + \Delta x \cdot h(f(x_{i+1/2})) \cr f(x_{i+3/2}) &= f(x_{i+1/2}) + \Delta x \cdot g(k(x_{i+1})). } \label{leapfrog2}

In this way, $f$ always stays a half step ahead of $k$. To evaluate the solution, a final half step must be taken by $k$ in order to bring both $f$ and $k$ to a common $x$.
{"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": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 3, "x-ck12": 0, "texerror": 0, "math_score": 0.9999899864196777, "perplexity": 2558.2221533078273}, "config": {"markdown_headings": true, "markdown_code": true, "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": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-22/segments/1526794865913.52/warc/CC-MAIN-20180524033910-20180524053910-00042.warc.gz"}