Initial Value Problems

Itnitial value problems are solved by applying the initial conditions to the general solution of a differential equation. Note that the initial conditions are applied only to the general solution and not to the homogeneous solution $$${y}_{{h}}$$$, even though it is $$${y}_{{h}}$$$ that possesses all the arbitrary constants to be evaluated. The only exception is when the general solution is the homogeneous solution, that is when the differential equation under consideration is itself homogeneous.

Example 1. Solve $$${y}''+{y}'-{2}{y}={0}$$$, $$${y}{\left({0}\right)}={1}$$$, $$${y}'{\left({0}\right)}={2}$$$.

This is a homogeneous differential equation. The characteristic equation is $$${{r}}^{{2}}+{r}-{2}={0}$$$, or $$${\left({r}+{2}\right)}{\left({r}-{1}\right)}={0}$$$, which has the roots $$${r}_{{1}}=-{2},\ {r}_{{2}}={1}$$$.

So, the general solution is $$${y}={c}_{{1}}{{e}}^{{-{2}{x}}}+{c}_{{2}}{{e}}^{{x}}$$$.

Thus, $$${y}'=-{2}{c}_{{1}}{{e}}^{{-{2}{x}}}+{c}_{{2}}{{e}}^{{x}}$$$.

Applying the initial conditions gives

$$${\left\{\begin{array}{c}{y}{\left({0}\right)}={1}={c}_{{1}}{{e}}^{{-{2}\cdot{0}}}+{c}_{{2}}{{e}}^{{0}}\\{y}'{\left({0}\right)}={2}=-{2}{c}_{{1}}{{e}}^{{-{2}\cdot{0}}}+{c}_{{2}}{{e}}^{{0}}\\ \end{array}\right.}$$$,

Or

$$${\left\{\begin{array}{c}{c}_{{1}}+{c}_{{2}}={1}\\-{2}{c}_{{1}}+{c}_{{2}}={2}\\ \end{array}\right.}$$$.

Subtracting the second equation from the first gives $$${3}{c}_{{1}}=-{1}$$$, or $$${c}_{{1}}=-\frac{{1}}{{3}}$$$.

From the first equation, $$${c}_{{2}}={1}-{c}_{{1}}={1}-{\left(-\frac{{1}}{{3}}\right)}=\frac{{4}}{{3}}$$$.

So, the solution is $$${y}=-\frac{{1}}{{3}}{{e}}^{{-{2}{x}}}+\frac{{4}}{{3}}{{e}}^{{x}}$$$.

Now, let's do some more practice.

Example 2. Solve $$${y}''+{2}{y}'+{y}={\cos{{\left({t}\right)}}}$$$, $$${y}{\left({0}\right)}={3}$$$, $$${y}'{\left({0}\right)}={0}$$$.

First, solve the corresponding homogeneous equation $$${y}''+{2}{y}'+{y}={0}$$$. The characteristic equation is $$${{r}}^{{2}}+{2}{r}+{1}={0}$$$, or $$${{\left({r}+{1}\right)}}^{{2}}={0}$$$, which has the roots $$${r}_{{1}}=-{1},{r}_{{2}}=-{1}$$$.

There is one root of the multiplicity 2; so, the solution of the homogeneous equation is $$${y}_{{h}}={c}_{{1}}{{e}}^{{-{t}}}+{c}_{{2}}{t}{{e}}^{{-{t}}}$$$.

Once again, we don't apply the initial conditions on this stage. We first have to find the general solution (in this case, $$${y}_{{h}}+{y}_{{p}}$$$) and only then apply the initial conditions.

To find the particular solution, use the method of undetermined coefficients.

Assume that $$${y}_{{p}}={A}{\cos{{\left({t}\right)}}}+{B}{\sin{{\left({t}\right)}}}$$$. Then, $$${y}_{{p}}'=-{A}{\sin{{\left({t}\right)}}}+{B}{\cos{{\left({t}\right)}}}$$$, and $$${y}_{{p}}''=-{A}{\cos{{\left({t}\right)}}}-{B}{\sin{{\left({t}\right)}}}$$$.

Plugging this into the equation gives

$$$-{A}{\cos{{\left({t}\right)}}}-{B}{\sin{{\left({t}\right)}}}+{2}{\left(-{A}{\sin{{\left({t}\right)}}}+{B}{\cos{{\left({t}\right)}}}\right)}+{A}{\cos{{\left({t}\right)}}}+{B}{\sin{{\left({t}\right)}}}={2}{B}{\cos{{\left({t}\right)}}}-{2}{A}{\sin{{\left({t}\right)}}}$$$.

Equating the like terms with $$${\cos{{\left({t}\right)}}}$$$ gives

$$${\left\{\begin{array}{c}{2}{B}={1}\\-{2}{A}={0}\\ \end{array}\right.}$$$,

Which has solution $$${A}={0},{B}=\frac{{1}}{{2}}$$$.

So, $$${y}_{{p}}=\frac{{1}}{{2}}{\sin{{\left({t}\right)}}}$$$.

Thus, the general solution is $$${y}={y}_{{h}}+{y}_{{p}}={c}_{{1}}{{e}}^{{-{t}}}+{c}_{{2}}{t}{{e}}^{{-{t}}}+\frac{{1}}{{2}}{\sin{{\left({t}\right)}}}$$$.

Now, we can use the initial conditions.

For this, find the derivative of the general solution: $$${y}'=-{c}_{{1}}{{e}}^{{-{t}}}+{c}_{{2}}{{e}}^{{-{t}}}-{c}_{{2}}{t}{{e}}^{{-{t}}}+\frac{{1}}{{2}}{\cos{{\left({t}\right)}}}$$$.

So,

$$${\left\{\begin{array}{c}{y}{\left({0}\right)}={3}={c}_{{1}}{{e}}^{{-{0}}}+{c}_{{2}}\cdot{0}\cdot{{e}}^{{-{0}}}+\frac{{1}}{{2}}{\sin{{\left({0}\right)}}}\\{y}'{\left({0}\right)}={0}=-{c}_{{1}}{{e}}^{{-{0}}}+{c}_{{2}}{{e}}^{{-{0}}}-{c}_{{2}}\cdot{0}\cdot{{e}}^{{-{0}}}+\frac{{1}}{{2}}{\cos{{\left({0}\right)}}}\\ \end{array}\right.}$$$,

Or

$$${\left\{\begin{array}{c}{c}_{{1}}={3}\\-{c}_{{1}}+{c}_{{2}}=-\frac{{1}}{{2}}\\ \end{array}\right.}$$$,

Which has the solution $$${c}_{{1}}={3},\ {c}_{{2}}=\frac{{5}}{{2}}$$$.

Finally, the solution is $$${y}={3}{{e}}^{{-{t}}}+\frac{{5}}{{2}}{t}{{e}}^{{-{t}}}+\frac{{1}}{{2}}{\sin{{\left({t}\right)}}}$$$.