# Solving an integro-differential equation

I have a set of coupled integro-differential equations: $$\frac{dx_i(t)}{dt}=-x_i(t)+f_i(\mathbf{x}(t))+\sum_j{\partial_{x_j}f_i(\mathbf{x}(t))\int_{0}^{t}dt'f_j(\mathbf{x}(t'))e^{-(t-t')} }$$

The integrals, $\psi_j(t) =\int_{0}^{t}dt'f_j(\mathbf{x}(t'))e^{-(t-t')}$, are solutions of the differential equations $$\frac{d\psi_j(t)}{dt}+\psi_j(t)=f_j(\mathbf{x}(t))$$ with $\psi(0)=0$. I've been told by my supervisor that the numerical evaluation of the coupled system can be greatly sped up by using these differential equations but I don't understand how - does anyone have any ideas? I get the feeling I'm missing something obvious.

## migrated from mathematica.stackexchange.comMar 8 '17 at 17:32

This question came from our site for users of Wolfram Mathematica.

• Why don't you ask your supervisor for clarifications? – MarcoB Mar 7 '17 at 23:49
• What is $f(\mathbf{x}(t))$? Is this in some way related to $x_i(t)$? – zhk Mar 8 '17 at 5:45
• $f(\mathbf{x}_i(t))$ is a messy function of the set $\mathbf{x}$ except $x_i(t)$ – StressedOutStudent Mar 8 '17 at 12:13
• I asked my supervisor and he explained: the idea is that you solve for the system of equations ${\mathbf{x},\mathbf{\psi}}$ instead of just $\mathbf{x}$, so you have a larger system but can use standard methods. Seems obvious now -_- – StressedOutStudent Mar 8 '17 at 13:03
• Duplicate to the same unmigrated question (as of now only comments, no answer): math.stackexchange.com/questions/2176087/… – LutzL Mar 8 '17 at 17:44

## 1 Answer

To explain the why and maybe not how part of the question.

A differential numerical approximation:

$$\left[\begin{array}{cccccc} 1&-1&0&0&0&0\\ 0&1&-1&0&0&0\\ 0&0&1&-1&0&0\\ 0&0&0&1&-1&0\\ 0&0&0&0&1&-1\\ 0&0&0&0&0&1 \end{array}\right]$$ Two non-zero values per output. Corresponding integral numerical approximation matrix:

$$\left[\begin{array}{cccccc} 1&1&1&1&1&1\\ 0&1&1&1&1&1\\ 0&0&1&1&1&1\\ 0&0&0&1&1&1\\ 0&0&0&0&1&1\\ 0&0&0&0&0&1 \end{array}\right]$$

Spreads out non-0 values all over. On average half signal wide.

Integrals are often nastier than derivatives numerically. An integral is global, a derivative is local. If not implemented carefully, any integrals can easily eat up all available memory and slow things down due to lots of calculations required. Instead in some cases you can pose it inversely as a derivative.