# Exponential response formula

Differential equations :
Scope :
Fields
Natural sciencesEngineering
Astronomy
Physics
Chemistry
Biology
Geology
Applied mathematics
Continuum mechanics
Chaos theory
Dynamical systems
Social sciences
Economics
Population dynamics
List of named differential equations :
Classification :
Types
Ordinary
Partial
Differential-algebraic
Integro-differential
Fractional
Linear
Non-linear
By variable type
Dependent and independent variables
Autonomous
Coupled / Decoupled
Exact
Homogeneous / Nonhomogeneous
Features
Order
Operator
Notation :
Relation to processes
Difference (discrete analogue)
Stochastic
Stochastic partial
Delay :
Solution :
Existence and uniqueness
Picard–Lindelöf theorem
Peano existence theorem
Carathéodory's existence theorem
Cauchy–Kowalevski theorem :
General topics
Initial conditions
Boundary values
Dirichlet
Neumann
Robin
Cauchy problem
Wronskian
Phase portrait
Lyapunov / Asymptotic / Exponential stability
Rate of convergence
Series / Integral solutions
Numerical integration
Dirac delta function :
Solution methods
Inspection
Method of characteristics
Euler
Exponential response formula
Finite difference (Crank–Nicolson)
Finite element
Infinite element
Finite volume
Galerkin
Petrov–Galerkin
Green's function
Integrating factor
Integral transforms
Perturbation theory
Runge–Kutta
Separation of variables
Undetermined coefficients
Variation of parameters :
People :
List
Isaac Newton
Gottfried Leibniz
Jacob Bernoulli
Leonhard Euler
Joseph-Louis Lagrange
Józef Maria Hoene-Wroński
Joseph Fourier
Augustin-Louis Cauchy
George Green
Carl David Tolmé Runge
Martin Kutta
Rudolf Lipschitz
Ernst Lindelöf
Émile Picard
Phyllis Nicolson
John Crank :
vte :
In mathematics, the exponential response formula (ERF), also known as exponential response and complex replacement, is a method used to find a particular solution of a non-homogeneous linear ordinary differential equation of any order. The exponential response formula is applicable to non-homogeneous linear ordinary differential equations with constant coefficients if the function is polynomial, sinusoidal, exponential or the combination of the three. The general solution of a non-homogeneous linear ordinary differential equation is a superposition of the general solution of the associated homogeneous ODE and a particular solution to the non-homogeneous ODE. Alternative methods for solving ordinary differential equations of higher order are method of undetermined coefficients and method of variation of parameters.

## Context and method
### Applicability

The ERF method of finding a particular solution of a non-homogeneous differential equation is applicable if the non-homogeneous equation is or could be transformed to form $f(t)=B_{1}e^{\gamma _{1}t}+B_{2}e^{\gamma _{2}t}+\cdots +B_{n}e^{\gamma _{n}t}$; where $B,\gamma$ are real or complex numbers and $f(t)$ is homogeneous linear differential equation of any order. Then, the exponential response formula can be applied to each term of the right side of such equation. Due to linearity, the exponential response formula can be applied as long as the right side has terms, which are added together by the superposition principle.

### Complex replacement

Complex replacement is a method of converting a non-homogeneous term of equation into a complex exponential function, which makes a given differential equation a complex exponential.
Consider differential equation $y''+y=\cos(t)$.
To make complex replacement, Euler's formula can be used;
    ${\begin{aligned}\cos(t)&=\operatorname {Re} (e^{it})=\operatorname {Re} (\cos(t)+i\sin(t))\\\sin(t)&=\operatorname {Im} (e^{it})=\operatorname {Im} (\cos(t)+i\sin(t))\end{aligned}}$
Therefore, given differential equation changes to $z''+z=e^{it}$. The solution of the complex differential equation can be found as $z(t)$, from which the real part is the solution of the original equation.
Complex replacement is used for solving differential equations when the non-homogeneous term is expressed in terms of a sinusoidal function or an exponential function, which can be converted into a complex exponential function differentiation and integration. Such complex exponential function is easier to manipulate than the original function.
When the non-homogeneous term is expressed as an exponential function, the ERF method or the undetermined coefficients method can be used to find a particular solution. If non-homogeneous terms can not be transformed to complex exponential function, then the Lagrange method of variation of parameters can be used to find solutions.

### Linear time-invariant operator

The differential equations are important in simulating natural phenomena. In particular, there are numerous phenomena described as high order linear differential equations, for example the spring vibration, LRC circuit, beam deflection, signal processing, control theory and LTI systems with feedback loops.
Mathematically, the system is time-invariant if whenever the input $f(t)$ has response $x(t)$ then for any constant "a", the input $f(t-a)$ has response $x(t-a)$. Physically, time invariance means system’s response does not depend on what time the input begins. For example, if a spring-mass system is at equilibrium, it will respond to a given force in the same way, no matter when the force was applied.
When the time-invariant system is also linear, it is called a linear time-invariant system (LTI system). Most of these LTI systems are derived from linear differential equations, where the non-homogeneous term is called the input signal and solution of the non-homogeneous equations is called the response signal. If the input signal is given exponentially, the corresponding response signal also changes exponentially.
Considering the following $n$th order linear differential equation
    $a_{n}{\frac {d^{n}y}{dt^{n}}}+a_{n-1}{\frac {d^{n-1}y}{dt^{n-1}}}+\cdots +a_{1}{\frac {dy}{dt}}+a_{0}y=f(t)\qquad \qquad \quad (1)$
and denoting
    $L=a_{n}D^{n}+a_{n-1}D^{n-1}+\cdots +a_{1}D^{1}+a_{0}I,$
    $D^{k}={\frac {d^{k}}{dt^{k}}}(k=1,2,\ldots ,n),$
where $a_{0},\ldots ,a_{n}$ are the constant coefficients, produces differential operator $L$, which is linear and time-invariant and known as the LTI operator. The operator, $L$ is obtained from its characteristic polynomial;
    $P(s)=a_{n}s^{n}+a_{n-1}s^{n-1}+\cdots +a_{0}$
by formally replacing the indeterminate s here with the differentiation operator $D$
    $L=P(D)$
    $P(D)=a_{n}D^{n}+a_{n-1}D^{n-1}+\cdots +a_{0}I$
Therefore, the equation (1) can be written as
    $P(D)y=f(t)\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad (2)$

### Problem setting and ERF method

Considering LTI differential equation above, with exponential input $f(t)=Be^{\gamma t}$, where $B$ and $\gamma$ are given numbers. Then, a particular solution is
$y_{p}={\frac {Be^{\gamma t}}{P(\gamma )}}\qquad$
provide only that $P(\gamma )\neq 0$.
Proof: Due to linearity of operator $P(D)$, the equation can be written as
    $P(D)(y_{p})=P(D)\left({\frac {Be^{\gamma t}}{P(\gamma )}}\right)={\frac {B}{P(\gamma )}}P(D)(e^{\gamma t})\qquad \qquad (3)$
On the other hand, since
    $P(D)\left(e^{\gamma t}\right)=P(\gamma )e^{\gamma t},$
substituting this into equation (3), produces
    $P(D)(y_{p})=P(D)\left({\frac {Be^{\gamma t}}{P(\gamma )}}\right)={\frac {B}{P(\gamma )}}P(D)\left(e^{\gamma t}\right)={\frac {B}{P(\gamma )}}P(\gamma )e^{\gamma t}=Be^{\gamma t}.$
Therefore, $y_{p}$ is a particular solution to the non-homogeneous differential equation.
Thus, the above equation for a particular response $y_{p}$ is called the exponential response formula (ERF) for the given exponential input.
In particular, in case of $P(\gamma )=0$, a solution to equation (2) is given by
    $y_{p}={\frac {Bte^{\gamma t}}{P'(\gamma )}},\qquad P'(\gamma )\neq 0$
and is called the resonant response formula.

## Example

Let's find the particular solution to 2nd order linear non-homogeneous ODE;
    $2x''+x'+x=1+2e^{t}+e^{-t}\cos(t).$
The characteristic polynomial is $P(s)=2s^{2}+s+1$. Also, the non-homogeneous term, $f(t)=1+2e^{t}+e^{-t}\cos(t)$ can be written as follows
    $f(t)=f_{1}(t)+f_{2}(t)+f_{3}(t),f_{1}(t)=1,f_{2}(t)=2e^{t},f_{3}(t)=e^{-t}\cos(t).$
Then, the particular solutions corresponding to $f_{1}(t),f_{2}(t)$ and $f_{3}(t)$, are found, respectively.
First, considering non-homogeneous term, $f_{1}(t)=1$. In this case, since $f_{1}(t)=1=e^{0\cdot t},\gamma =0$ and $P(\gamma )=P(0)=1\neq 0$.
from the ERF, a particular solution corresponding to $f_{1}(t)$ can be found.
    $x_{1p}={\frac {f_{1}(t)}{P(0)}}={\frac {1}{1}}=1$.
Similarly, a particular solution can be found corresponding to $f_{2}(t)$.
    $x_{2p}={\frac {f_{2}(t)}{P(1)}}={\frac {2e^{t}}{4}}={\frac {e^{t}}{2}}.$
Let's find a particular solution to DE corresponding to 3rd term;
    $2x''+x'+x=e^{-t}\cos(t).$
In order to do this, equation must be replaced by complex-valued equation, of which it is the real part:
    $2z''+z'+z=e^{(-1+i)t}.$
Applying the exponential response formula (ERF), produces
    ${\begin{aligned}z_{p}&={\frac {e^{(-1+i)t}}{P(-1+i)}}\\&={\frac {ie^{(-1+i)t}}{3}}&&P(-1+i)=2(-1+i)^{2}+(-1+i)+1=-3i\end{aligned}}$
and the real part is
    $x_{3p}=-{\frac {1}{3}}e^{-t}\sin(t).$
Therefore, the particular solution of given equation, $x_{p}$ is
    $x_{p}=x_{1p}+x_{2p}+x_{3p}=1+{\frac {e^{t}}{2}}-{\frac {1}{3}}e^{-t}\sin(t).$

## Comparison with method of undetermined coefficients

The undetermined coefficients method is a method of appropriately selecting a solution type according to the form of the non-homogeneous term and determining the undetermined constant, so that it satisfies the non-homogeneous equation. On the other hand, the ERF method obtains a special solution based on differential operator. Similarity for both methods is that special solutions of non-homogeneous linear differential equations with constant coefficients are obtained, while form of the equation in consideration is the same in both methods.
For example, finding a particular solution of $y''+y=e^{t}$ with the method of undetermined coefficients requires solving the characteristic equation $\lambda ^{2}+1=0,\lambda =\pm i$. The non-homogeneous term $f(t)=Be^{\gamma t},B=1,\gamma =1$ is then considered and since $\gamma =1$ is not a characteristic root, it puts a particular solution in form of $y_{p}(t)=Ae^{\gamma t}$, where $A$ is undetermined constant. Substituting into the equation to determine the tentative constant yields
    $\lambda ^{2}Ae^{\lambda t}+Ae^{\lambda t}=e^{\lambda t}$
therefore
    $A={\frac {1}{\lambda ^{2}+1}}.$
The particular solution can be found in form:
    $y_{p}(t)=Ae^{\lambda t}={\frac {e^{\lambda t}}{\lambda ^{2}+1}}.$
On the other hand, the exponential response formula method requires characteristic polynomial $P(s)=s^{2}+1$ to be found, after which the non-homogeneous terms $f(t)=Be^{\gamma t},B=1,\gamma =1$ is complex replaced. The particular solution is then found using formula
    $y_{p}(t)={\frac {e^{\lambda t}}{P(\lambda )}}={\frac {e^{\lambda t}}{\lambda ^{2}+1}}.$

## Generalized exponential response formula

The exponential response formula method was discussed in case of $P(\gamma )\neq 0$. In the case of $P(\gamma )=0,P'(\gamma )\neq 0$, the resonant response formula is also considered.
In the case of $P(\gamma )=P'(\gamma )=\cdots =P^{(k-1)}(\gamma )=0,P^{k}(\gamma )\neq 0$, we will discuss how the ERF method will be described in this section.
Let $P(D)$ be a polynomial operator with constant coefficients, and $P^{(m)}$ its $m$-th derivative. Then ODE
    $P(D)y=Be^{\gamma t}$, where $\gamma$ is real or complex.
has the particular solution as following.
* $P(\gamma )\neq 0$. In this case, a particular solution will be given by $y_{p}(t)={\tfrac {Be^{\gamma t}}{P(\gamma )}}$.(exponent response formula)
* $P(\gamma )=0$ but $P'(\gamma )\neq 0$. In this case, a particular solution will be given by $y_{p}(t)={\tfrac {Bte^{\gamma t}}{P'(\gamma )}}$.(resonant response formula)
* $P(\gamma )=P'(\gamma )=\cdots =P^{(k-1)}(\gamma )=0$ but $P^{k}(\gamma )\neq 0$. In this case, a particular solution will be given by
$y_{p}(t)={\frac {Bt^{k}e^{\gamma t}}{P^{(k)}(\gamma )}},k=2,\ldots ,m$
Above equation is called generalized exponential response formula.

### Example

To find a particular solution of the following ODE;
    $y'''-3y'+2y=6e^{t}.$
the characteristic polynomial is $P(s)=s^{3}-3s+2$.
By the calculating, we get the following:
    $P(1)=0,P'(1)=0,P''(1)=6\neq 0.$
Original exponential response formula is not applicable to this case due to division by zero. Therefore, using the generalized exponential response formula and calculated constants, particular solution is
    $y_{p}(t)={\frac {6t^{2}e^{t}}{P''(1)}}={\frac {6t^{2}e^{t}}{6}}=t^{2}e^{t}.$

## Application examples
### Motion of object hanging from a spring

Object hanging from a spring with displacement $d$. The force acting is gravity, spring force, air resistance, and any other external forces.
From Hooke’s law, the motion equation of object is expressed as follows;
    $m{\frac {d^{2}x}{dt^{2}}}+r{\frac {dx}{dt}}+kx=F(t),$
where $F(t)$ is external force.
Now, assuming drag is neglected and $F(t)=F_{0}\cos(\omega t)$, where $\omega ={\sqrt {\tfrac {k}{m}}}$ (the external force frequency coincides with the natural frequency). Therefore, the harmonic oscillator with sinusoidal forcing term is expressed as following:
    $m{\frac {d^{2}x}{dt^{2}}}+kx=F(t).$
Then, a particular solution is
    $x_{p}={\frac {F_{0}}{2{\sqrt {km}}}}t\sin(\omega t).$
Applying complex replacement and the ERF: if $z_{p}$ is a solution to the complex DE
    $m{\frac {d^{2}z}{dt^{2}}}+kz=F_{0}e^{i\omega t},$
then $x_{p}=\operatorname {Re} (z_{p})$ will be a solution to the given DE.
The characteristic polynomial is $P(s)=ms^{2}+k$, and $\gamma =i\omega$, so that $P(\gamma )=0$. However, since $P'(s)=2ms$, then $P'(\gamma )=P'(i\omega )=2m\omega i\neq 0$. Thus, the resonant case of the ERF gives
    ${\begin{aligned}y_{p}&=\operatorname {Re} \left({\frac {F_{0}te^{i\omega t}}{P'(\gamma )}}\right)\\[4pt]&=\operatorname {Re} \left({\frac {F_{0}t(\cos(\omega t)+i\sin(\omega t))}{2mi\omega }}\right)\\[4pt]&=\operatorname {Re} \left({\frac {-F_{0}t(i\cos(\omega t)-\sin(\omega t))}{2m\omega }}\right)\\[4pt]&={\frac {F_{0}t\sin(\omega t)}{2m\omega }}\\[4pt]&={\frac {F_{0}}{2{\sqrt {km}}}}t\sin(\omega t).\end{aligned}}$

### Electrical circuits

Considering the electric current flowing through an electric circuit, consisting of a resistance ($R$), a capacitor ($C$), a coil wires ($L$), and a battery ($E$), connected in series.
This system is described by an integral-differential equation found by Kirchhoff called Kirchhoff’s voltage law, relating the resistor $R$, capacitor $C$, inductor $L$, battery $E$, and the current $I$ in a circuit as follows,
    $LI'(t)+RI(t)+{\frac {1}{C}}\int _{t_{0}}^{t}I(s)\,ds=\int _{t_{0}}^{t}E(s)\,ds$
Differentiating both sides of the above equation, produces the following ODE.
    $LI''(t)+RI'(t)+{\frac {1}{C}}I(t)=E(t)$
Now, assuming $E(t)=E_{0}\sin(\omega _{0}t)$, where $\omega _{0}={\sqrt {\tfrac {1}{LC}}}$. ($\omega _{0}$ is called resonance frequency in LRC circuit). Under above assumption, the output (particular solution) corresponding to input $E(t)$ can be found. In order to do it, given input can be converted in complex form:
    $E(t)=E_{0}\sin(\omega _{0}t)=\operatorname {Im} (E_{0}e^{i\omega _{0}t})$
The characteristic polynomial is $P(s)=Ls^{2}+Rs+{\frac {1}{s}}$, where $P(i\omega _{0})=i\omega _{0}R\neq 0$. Therefore, from the ERF, a particular solution can be obtained as follows;
    ${\begin{aligned}I_{p}&=\operatorname {Im} \left({\frac {E_{0}e^{i\omega _{0}t}}{P(i\omega _{0})}}\right)\\&=\operatorname {Im} \left({\frac {E_{0}e^{i\omega _{0}t}}{i\omega _{0}R}}\right)\\&=\operatorname {Im} \left({\frac {-E_{0}(i\cos(\omega _{0}t)-\sin(\omega _{0}t))}{\omega _{0}R}}\right)\\[4pt]&={\frac {-E_{0}\cos(\omega _{0}t)}{\omega _{0}R}}\end{aligned}}$

### Complex gain and phase lag

Considering the general LTI system
    $P(D)x=Q(D)f(t)$
where $f(t)$ is the input and $P(D),Q(D)$ are given polynomial operators, while assuming that $P(s)\neq 0$. In case that $f(r)=F_{0}\cos(\omega t)$, a particular solution to given equation is
    $x_{p}(t)=\operatorname {Re} \left(F_{0}{\frac {Q(i\omega )}{P(i\omega )}}e^{i\omega t}\right).$
Considering the following concepts used in physics and signal processing mainly.
* The amplitude of the input is $F_{0}$. This has the same units as the input quantity.
* The angular frequency of the input is $\omega$. It has units of radians/time. Often it will be referred to it as frequency, even though technically frequency should have units of cycles/time.
* The amplitude of the response is $A=F_{0}|Q(i\omega )/P(i\omega )|$. This has the same units as the response quantity.
* The gain is $g(\omega )=|Q(i\omega )/P(i\omega )|$. The gain is the factor that the input amplitude is multiplied by to get the amplitude of the response. It has the units needed to convert input units to output units.
* The phase lag is $\phi =-\operatorname {Arg} (Q(i\omega )/P(i\omega ))$. The phase lag has units of radians, i.e. it’s dimensionless.
* The time lag is $\phi /\omega$. This has units of time. It is the time that peak of the output lags behind that of the input.
* The complex gain is $Q(i\omega )/P(i\omega )$. This is the factor that the complex input is multiplied by to get the complex output.