# Solving non-autonomous system of differential equations

Given the following 2x2 system of differential equations,

$$\begin{cases} \dot{x} = 4x-y \\ \dot{y} = 2x+y \end{cases}$$

A solution is easy to fins by computing eigenvalues and eigenvectors of the associated matrix A

$$A = \begin{bmatrix} 4 & -1 \\ 2 & 1 \end{bmatrix}$$.

Therefore, knowing that eigenvalues are 2 and 3, and the related eigenvectors are $$\begin{bmatrix} 1 \\ 2 \end{bmatrix}$$ and $$\begin{bmatrix} 1 \\ 1 \end{bmatrix}$$ respectively, the solution is of the form

$$Ae^{2t}\begin{bmatrix} 1 \\ 2 \end{bmatrix}+Be^{3t}\begin{bmatrix} 1 \\ 1 \end{bmatrix}$$.

What about if I make the initial system of equations non-autonomous? Resulting in something as follows

$$\begin{cases} \dot{x} = 4x-y \\ \dot{y} = 2x+y +f(t) \end{cases}$$

where f(t) can be either a polynomial on t, an exponential ($$e^{at}$$) or a trigonometric function ($$sin(at)$$ or $$cos(at)$$).

What is now the procedure to follow this system of differential equations? For example, let $$f(t)=t^2$$.

How do I solve the following system of differential equations?

$$\begin{cases} \dot{x} = 4x-y \\ \dot{y} = 2x+y+t^2 \end{cases}$$

• Hint: Use Laplace transform. Dec 5, 2020 at 18:12

$$\begin{cases} x' = 4x-y \\ {y'} = 2x+y +f(t) \end{cases}$$ Note that if you substract both DE you have: $$x'-y' =2(x-y) -f(t)$$ $$u' -2u= -f(t)$$ $$(u(t)e^{-2t})'= -e^{-2t}f(t)$$ $$u(t)e^{-2t}= -\int e^{-2t}f(t) \,dt$$ Where $$u(t)=x-y$$. $$x(t)=y(t)-e^{2t}\int e^{-2t}f(t) \,dt$$ Plug this in the second equation and solve.

Continuing from your result of integration in the comment:

$$u(t)=\frac{1}{4}(2t^2+2t+1)+Ce^{2t}$$ $$x-y=\frac{1}{4}(2t^2+2t+1)+Ce^{2t}$$ We have the first differential equation: $$x'=4x-y$$ $$x'-4x=-x+\frac{1}{4}(2t^2+2t+1)+Ce^{2t}$$ $$x'-3x=\frac{1}{4}(2t^2+2t+1)+Ce^{2t}$$ $$(xe^{-3t})'=e^{-3t}\frac{1}{4}(2t^2+2t+1)+Ce^{-t}$$ Integrate. Don't forget the second constant of integration.

• @AnindyaPrithvi Integration factor Dec 5, 2020 at 20:10
• then i reach to $u(t)=\frac{1}{4}(2t^2+2t-1)$, and this can't help me to find $x(t)$ and $y(t)$, and these have to be dependent on constants determined by some initial conditions, and $u(t)$ is not dependent on constants. where am i going wrong? Dec 6, 2020 at 16:33
• Add a constant for $u$ @JenaRayner You always need a constant for integration when you integrate. Dec 6, 2020 at 16:36
• I added some lines and corrected also the result of the integration it's $u(t)=\frac{1}{4}(2t^2+2t+1)+Ce^{2t}$ @JenaRayner Dec 6, 2020 at 16:47
• Yes when you have intial conditions with the system of DE'syou can use that information to find the constants of integration @JenaRayner Dec 6, 2020 at 17:09

You can express your non$$-$$autonomous differential equation in the form $$\frac{d\vec{x}}{dt}-A\vec{x}=\vec{f}(t)$$ where $$\vec{x}=\big(\begin{smallmatrix} x \\ y \end{smallmatrix}\big)$$, $$A=\big(\begin{smallmatrix} 4 & -1\\ 2 & 1 \end{smallmatrix}\big)$$, and $$f(t)=\big(\begin{smallmatrix} 0 \\ t^2 \end{smallmatrix}\big)$$. It turns out that $$\vec{x}=e^{At}\int e^{-At}f(t)dt$$ just as you might expect!

• how am i supposed to integrate the exponential of a matrix? Dec 6, 2020 at 16:14
• Do you know how to compute $e^{At}$? Dec 6, 2020 at 16:58
• i dont, i've never seen the exponential of a matrix Dec 6, 2020 at 17:03
• Note $A=\big(\begin{smallmatrix} 1 & 1\\ 2 & 1\end{smallmatrix}\big)\big(\begin{smallmatrix} 2 & 0\\ 0 & 3\end{smallmatrix}\big)\big(\begin{smallmatrix} 1 & 1\\ 2 & 1 \end{smallmatrix}\big)^{-1}$ and so $$e^{At}=\big(\begin{smallmatrix} 1 & 1\\ 2 & 1\end{smallmatrix}\big)\big(\begin{smallmatrix} e^{2t} & 0\\ 0 & e^{3t}\end{smallmatrix}\big)\big(\begin{smallmatrix} 1 & 1\\ 2 & 1 \end{smallmatrix}\big)^{-1}$$ Dec 6, 2020 at 17:26
• Also $$e^{-At}=\big(\begin{smallmatrix} 1 & 1\\ 2 & 1\end{smallmatrix}\big)\big(\begin{smallmatrix} e^{-2t} & 0\\ 0 & e^{-3t}\end{smallmatrix}\big)\big(\begin{smallmatrix} 1 & 1\\ 2 & 1 \end{smallmatrix}\big)^{-1}$$ Dec 6, 2020 at 17:31