• EquaDif( <f(t,x,y)>, <t0>, <x0 + i*y0> [, mode] ).
• Description: draw an approximate solution of the differential equation: ${x}^{\prime }\left(t\right)+i{y}^{\prime }\left(t\right)=f\left(t,x,y\right)$ with initial condition $x\left({t}_{0}\right)=x0$ and $y\left({t}_{0}\right)={y}_{0}$. The last parameter (optional) can be 0, 1 or 2:
• <mode>=0: the curve represents the points coordinate $\left(x\left(t\right),y\left(t\right)\right)$ (default value).
• <mode>=1: the curve represents the points coordinate $\left(t,x\left(t\right)\right)$.
• <mode>=2: the curve represents the points coordinate $\left(t,y\left(t\right)\right)$.

This is the RUNGE-KUTTA 4th order method that is used here.

• Exemple(s): the equation ${x}^{″}-{x}^{\prime }-tx=sin\left(t\right)$ with initial condition $x\left(0\right)=-1$ and ${x}^{\prime }\left(0\right)=1∕2$ is put in the form:
$\left(\begin{array}{c}\hfill {X}^{\prime }\hfill \\ \hfill {Y}^{\prime }\hfill \end{array}\right)=\left(\begin{array}{cc}\hfill 0\hfill & \hfill 1\hfill \\ \hfill t\hfill & \hfill 1\hfill \end{array}\right)\left(\begin{array}{c}\hfill X\hfill \\ \hfill Y\hfill \end{array}\right)+\left(\begin{array}{c}\hfill 0\hfill \\ \hfill sin\left(t\right)\hfill \end{array}\right)$

with $X=x$ and $Y={x}^{\prime }$:

 \begin{texgraph}[name=EquaDif,export=pgf]   view(-10.5,2.5,-1.5,4.5),Marges(0,0,0,0),   size(7.5,0), Arrows:=1, Width:=4,   Axes(0,1+i), Arrows:=0,   LabelAxe(y,4.25*i,"$x$"),   LabelAxe(x,2,"$t$",2),   Width:=8, Color:=red, tMin:=-10, tMax:=2,   EquaDif(y+i*(t*x+y+sin(t)),0,-1+i/2, 1),   Color:=black, LabelStyle:=stacked,   Label(-6+2*i,    "$x’’-x’-tx=\sin(t)$\\   with $x(0)=-1$ and $x’(0)=\frac12$")   \end{texgraph}

Differential equation