Solving $\frac{d \vec r}{dt} + \vec r =\begin{bmatrix} t \\ e^{-t}\end{bmatrix}$ Can you solve the differential equation $$\frac{d\vec r}{dt} + \vec r = \begin{bmatrix} t \\ e^{-t}\end{bmatrix}$$ subject to the initial condition $\vec r=\begin{bmatrix} 1 \\ 1\end{bmatrix}$ at $t=0$.
 A: Hint: $\vec r= \begin{bmatrix} x \\ y\end{bmatrix}$, so we've got two (de-coupled) equations:
$ \frac{dx}{dt}+x=t \tag{1}$
$ \frac{dy}{dt}+y=e^{-t}\tag{2}$
Now, solve each of these equations!
I'll help with $(1)$ and then you apply this method to $(2)$.
$\frac{dx}{dt}+\color{red}1x=t \tag{1}$
Integrating factor: $R=e^{\int \color{red}1dt} =e^t$.
Multiplying $(1) $through by $e^t$:
$$e^t\frac{dx}{dt}+xe^t=te^t \iff \frac{d}{dt}[e^tx]=te^t$$
$\impliedby e^tx=\int te^tdt=e^t(t-1)+C$, so $$x(t)=t-1 +c_1e^{-t}$$
Now the initial condition for $x$ is that $x=1$ when $t=0$.
Subbing these conditions into $(1)$ gives us $1=0-1+c_1\underbrace{e^{-0}}_{1} \iff c_1=2$
so $$\boxed{x(t)=t-1+2e^{-t}}.$$
Now, solve $(2)$ using the same method!
A: $r(t)=x(t)i+y(t)j$
$$x'(t)+x(t)=t$$
$$y'(t)+y(t)=e^{-t}$$
$$x(t)=t-1+c_1 e^{-t}$$
$$y(t)=e^{-t}(t+c_2)$$
$$1=x(0)=-1+c_1 \implies c_1=2$$
$$1=y(0)=c_2 \implies c_2=1$$
A: These equations can be solved using group theory, specifically Lie Theory.
For $\frac{dr}{dt}+r=t$, use G(t,r)=$(t+\lambda, r+\beta \lambda)$, where the unitary transformation occurs when $\lambda_0 =0$.  Note that if $t'=t+\lambda$ then $dt'=dt$, and likewise $dr'=dr$ which makes $\dot{r}'=\frac{dr'}{dt'}=\frac{dr}{dt}=\dot{r}$.  The map of our DEQ under G is:
$$
\dot{r}'+r'=t' \rightarrow \dot{r}+r+\beta \lambda=t+\lambda
$$
For invariance, if $\beta=1$ then the extra terms drop out.  Now that we have an invariant group G(t,r)=$(t+\lambda,r+\lambda)$, we can take advantage of Sophus Lie's Thm. 4.4.1 from his 1884 Differential Invariant Paper.  "Every infinite continuous group determines an infinite sequence of differential invariants, which can be defined as the solutions of complete systems."  He goes on to say, "If a system of differential equations of order q admits our infinite group, then in general that system can be written in the form of finitely many relations among the differential invariants of order $\leq$ q."  Here's how it works:
First take the infinitesimal transformation of the primed variables.
$$
\bigg(\frac{dt'}{d\lambda}\bigg)_{\lambda_o=0}=\frac{d}{d\lambda}(t+\lambda)\bigg|_0=1
$$
$$
\bigg(\frac{dr'}{d\lambda}\bigg)_{\lambda_o=0}=\frac{d}{d\lambda}(r+\beta \lambda)\bigg|_0=\beta
$$
$$
\bigg(\frac{d\dot{r}'}{d\lambda}\bigg)_{\lambda_o=0}=\frac{d}{d\lambda}(\dot{r})\bigg|_0=0
$$
Now use the method of characteristics to find the differential invariants.
$$
d\lambda=\frac{dt}{1}=\frac{dr}{\beta}=\frac{d\dot{r}}{0}
$$
$$
\frac{dt}{1}=\frac{dr}{\beta}\rightarrow \beta dt=dr \rightarrow \beta t=r-\mu \rightarrow \mu=r-\beta t
$$
$$
\frac{dt}{1}=\frac{d\dot{r}}{0} \rightarrow d\dot{r}=0 \rightarrow \nu=\dot{r}
$$
Here $\mu$ and $\nu$ are constants of integration, and because constants are stabilizers for the group of polynomials of which differential equations are a subgroup, these constants are group stabilizers.  This can easily be proved by applying the group G:
$$
G(\mu)=G(r-\beta t)=r+\beta\lambda -\beta(t+\lambda)=r-\beta t=\mu
$$
$$
G(\nu)=G(\dot{r})=\dot{r}'=\dot{r}=\nu
$$
As predicted by Sophus Lie, the equation may now be rewritten in terms of the group stabilizers.
$$
\dot{r}+r=t \rightarrow \dot{r}=-(r-t) \rightarrow \nu=-\mu
$$
If we differentiate $\mu$ w.r.t.$t$ we get another stabilizer equation.
$$
\frac{d\mu}{dt}=\frac{d}{dt}(r-\beta t)=\dot{r} -\beta=\nu -\beta
$$
For our DEQ, $\beta=1$, $\mu=r-t$, $\nu=\dot{r}$, and $\nu=-\mu$.  Therefore,
$$
\frac{d\mu}{dt}=-\mu-1 \rightarrow \frac{d\mu}{\mu+1}=-dt \rightarrow ln(\mu+1)=-t+C \rightarrow \mu+1=Ce^{-t}
$$
Substituting $\mu=r-t$, we have our general solution:
$$
r=t-1+Ce^{-t}
$$
Applying the condition r(t=0)=1 leads to C=2, so the solution to your first problem is
$$
r=t-1+2e^{-t}
$$ 
To solve the other DEQ: $\frac{dr}{dt}+r=e^{-t}$ use a different group $G(t,r)=(t+ln\lambda, \lambda^\beta r)\lambda_o=1$.  $dt'=dt$, $dr'=\lambda^\beta dr$, $d\dot{r}=\lambda^\beta d\dot{r}$, and the primed version of the DEQ is
$$
\lambda^\beta \dot{r}+\lambda^\beta r=e^{-(t+ln\lambda)}=\lambda^{-1}e^{-t}
$$
For invariance, $\beta=-1$.  Proceeding as before with infinitesimal transformations and the method of characteristics, the stabilizers for this group are $$\mu=\frac{r}{e^{\beta t}}=e^tr$$ $$\nu=\frac{\dot{r}}{e^{\beta t}}=e^t\dot{r}$$
Writing our DEQ in the form of differential invariants, it is easy to see that $\nu+\mu=1$. 
$$
\frac{d\mu}{dt}=\mu+\nu=\mu+1-\mu=1 \rightarrow d\mu=dt \rightarrow \mu=t+C
$$
Therefore the general solution is $r=(t+C)e^{-t}$.  Appying r(0)=1, we have C=1, so the final solution is
$$
r=(t+1)e^{-t}
$$
If you're still reading this magnum opus, you're probably saying to yourself, "Okay, that's pretty cool math, but why bother?"  Here's why: the process does not depend on the DEQ being linear.  I learned this technique from Dr. Lawrence Dresner, formerly of the Magnetics Division of the Y-12 lab in Oak Ridge, TN.  He used it in the study of superconductor stability to solve nonlinear PDE's.  It's powerful math, but very few people know about it so I try to beat the drum when I can.  Thanks for your time!  
