# Solving Linear Inhomogeneous System of Differential Equations

Let $$x(t),y\in \mathbb{R}^p,A\in \mathbb{R}^{p\times p}$$, I want to solve the following system \begin{align} \frac{dx(t)}{dt}&=-A(x(t)-y) \end{align} with known $$x(0)$$. I have 'something' but I suspect that it is wrong. I first take \begin{align} \frac{dx(t)}{dt}+Ax(t)&=Ay\\ \exp(At)\frac{dx(t)}{dt}+\exp(At)Ax(t)&=\exp(At)Ay\\ \frac{d}{dt}\exp(At)x(t)&=\exp(At)Ay\\ \exp(At)x(t)&=x(0)+\int_0^t \exp(As) ds Ay\\ \exp(At)x(t)&=x(0)+[\exp(At)-I]Ay\\ x(t)&=\exp(-At)[x(0)-Ay]+Ay \end{align}

However I have reason to believe (from looking at some other material) that the answer 'should' be \begin{align} x(t)&=\exp(-At)[x(0)-y]+y \end{align}

Are either of these answers (either the one I derived or the one I suspect) correct? If the latter is correct, why? If neither are correct, what is the true answer?

Note when computing the integral that $$\frac{d}{ds} \exp(As)$$ is equal to $$\exp(As) A$$, not just $$\exp(As)$$, so your second-to-last line should be $$\exp(At) x(t) = x(0) + [\exp(At)-I] y$$ (with just $$y$$, not $$Ay$$). So the second answer is the correct one.

• Thanks for pointing my mistake. My screen reader misses too often the super/under scripts Mar 29, 2022 at 7:17

There was some error in your calculation - I fixed it below..

I give complete calculation for everyone's understanding..

Let $$x(t),y\in \mathbb{R}^p,A\in \mathbb{R}^{p\times p}$$ .

To solve the differential equation: $${dx \over dt} = - A [x(t) - y]$$ with known $$x(0)$$.

We rewrite it as $${dx \over dt} + A x(t) = A y$$

$$\exp(A t) \ {dx \over dt} + \exp(A t) A x(t) = \exp(A t) A y$$ i.e. $${d \over dt}[\exp(A t) x(t)] = \exp(A t) A y$$

Integrating both sides, we get $$\exp(A t) x(t) = x(0) + \int\limits_{0}^t \exp(A s) A y ds$$ i.e. $$\exp(A t) x(t) = x(0) + \left[\exp(A s) y \right]_0^t = x(0) + \exp(A t) y - y$$

This can be rewritten as $$x(t) = \exp(-A t) [ x(0) + \exp(A t) y - y] = y + \exp(- A t) [x(0) - y]$$