# "LocallyExact" Method for NDSolve

## Introduction

A differential system can sometimes be solved by analytic means. The function DSolve implements many of the known algorithmic techniques.

However, differential systems that can be solved in closed form constitute only a small subset. Despite this fact, when a closed-form solution does not exist for the entire vector field, it is often possible to analytically solve a system of differential equations for part of the vector field. An example of this is the method "Splitting", which breaks up a vector field into subfields such that .

The idea underlying the method "LocallyExact" is that rather than using a standard numerical integration scheme, when a solution can be found by DSolve direct numerical evaluation can be used to locally advance the solution.

Since the method "LocallyExact" makes no attempt to adaptively adjust step sizes, it is primarily intended for use as a submethod between integration steps.

## Examples

In[1]:= |

### Harmonic Oscillator

### Global versus Local

The method "LocallyExact" is not intended as a substitute for a closed-form (global) solution.

Despite the fact that the method "LocallyExact" uses the analytic solution to advance the solution, it only produces solutions at the grid points in the numerical integration (or even inside grid points if called appropriately). Therefore, there can be errors due to sampling at interpolation points that do not lie exactly on the numerical integration grid.

### Simplification

The method "LocallyExact" has an option "SimplificationFunction" that can be used to simplify the results of DSolve.

In[8]:= |

In[12]:= |

The simplification is performed only once during the initialization phase that constructs the data object for the numerical integration method.