# Solve the following initial-value problem: x' = x + e^{3 t}, x (0) = 2.

## Question:

Solve the following initial-value problem:

{eq}\displaystyle x' = x + e^{3 t},\ x (0) = 2 {/eq}.

## First-order Linear Differential Equation:

A differential equation of the form {eq}x' + p(t) x = q(t) {/eq} is a first-order linear differential equation. A formula for the solution is {eq}x(t) = e^{-\int p(t) \: dt} \left[ \int e^{\int p(t) \: dt} q(t) \: dt + C \right]. {/eq} To determine the value of {eq}C, {/eq} we need an initial condition.

Subtracting {eq}x {/eq} from both sides gives the equation {eq}x' - x = e^{3t}, {/eq} so this is a linear first-order differential equation with {eq}p(t) = -1, \: q(t) = e^{3t}. {/eq} Therefore

{eq}\begin{eqnarray*}x(t) & = & e^{\int dt} \left[ \int e^{-\int dt} e^{3t} \: dt + C \right] \\ & = & e^{t} \left[ \int e^{-t} \cdot e^{3t} \: dt + C \right] \\ & = & e^t \left[ \int e^{2t} \: dt + C \right] \\ & = & e^t \left[ \displaystyle\frac{e^{2t}}{2} + C \right] \\ & = & \displaystyle\frac{e^{3t}}{2} + C e^t \end{eqnarray*} {/eq}

Applying the initial condition {eq}x(0) = 2 {/eq} leads to the equation

{eq}\begin{eqnarray*}x(0) & = & \displaystyle\frac{e^0}{2} + C \\ 2 & = & C + \displaystyle\frac12 \\ C & = & \displaystyle\frac32 \end{eqnarray*} {/eq}

Therefore the solution to the differential equation is {eq}x(t) = \displaystyle\frac{e^{3t} + 3e^t}{2}. {/eq}