Is this system of differential equations linear? Suppose I have a system of differential equations like below :
$\dot{x} = x + y + 5$
$\dot{y} = x - y $
Is this system linear or nonlinear differential equations?
 A: The system is linear, yes. It can be written as
$$\begin{bmatrix}\dot{x}\\ \dot{y}\end{bmatrix} = 
\begin{bmatrix}1 & 1\\ 1 & -1\end{bmatrix}\begin{bmatrix} x\\ y\end{bmatrix} + \begin{bmatrix}5\\ 0\end{bmatrix}$$
A: Strictly speaking, no. It is not linear because superposition does not apply: If we find two different solutions (starting from two different initial conditions) of the above system, the weighted sum of them does not constitute a solution.
Nevertheless, such equations are generally classified as "linear" in math texts, because they can be dealt with by using matrix theory.
A: You could write your system of equations as$$\begin{pmatrix}\dot{x}\\ \dot{y}\end{pmatrix} = 
\begin{pmatrix}1 & 1\\ 1 & -1\end{pmatrix}\begin{pmatrix} x\\ y\end{pmatrix} + \begin{pmatrix}5\\ 0\end{pmatrix}$$and solve it this way:


*

*Solve your homogeneous system. In this case, it would be$$\vec{x}_h=\begin{pmatrix}
c_1e^t+c_2e^{-t} \\
-2c_2e^{-t} \\
\end{pmatrix}.$$

*Solve for your particular solution. 
2.1. Rewrite your system as $\vec{x}(t)'=A\vec{x}(t)+\vec{g}$ where $\vec{g}=\begin{pmatrix}5\\0\\\end{pmatrix}$. Then guess a particular solution. In this case, $\vec{x}_p=\vec{a}.$
2.2. Take the derivative,$$\vec{x}_p=0,$$and plug things in.$$0=A\vec{a}+\vec{g}$$ $$A\vec{a}=-\vec{g}.$$
2.3. Solve the system.$$\begin{pmatrix}1&1\\1&-1\\\end{pmatrix}\begin{pmatrix}a_1\\a_2\\\end{pmatrix}=\begin{pmatrix}-5\\0\\\end{pmatrix}$$ $$\begin{cases}a_1+a_2=-5\\a_1-a_2=0\end{cases}$$ $$a_1=-2.5\text{ and }a_2=-2.5$$ $$\vec{a}=\begin{pmatrix}-2.5\\-2.5\\\end{pmatrix}.$$  
So, the solution is $$\vec{x}(t)=\begin{pmatrix}c_1e^t+c_2e^{-t}-2.5\\-2c_2e^{-t}-2.5\end{pmatrix}.$$
