## Section5.3First Order Linear Differential Equations

### Subsection5.3.1Homogeneous DEs

A simple, but important and useful, type of separable equation is the first order homogeneous linear equation:

###### Definition5.21. First Order Homogeneous Linear DE.

A first order homogeneous linear differential equation is one of the form $\ds y' + p(t)y=0$ or equivalently $\ds y' = -p(t)y\text{.}$

We have already seen a first order homogeneous linear differential equation, namely the simple growth and decay model $y'=ky\text{.}$

Since first order homogeneous linear equations are separable, we can solve them in the usual way:

\begin{align*} y' \amp = -p(t)y\\ \int {1\over y}\,dy \amp = \int -p(t)\,dt\\ \ln|y| \amp = P(t)+C\\ y\amp = \pm\,e^{P(t)+C}\\ y\amp = Ae^{P(t)}\text{,} \end{align*}

where $P(t)$ is an antiderivative of $-p(t)\text{.}$ As in previous examples, if we allow $A=0$ we get the constant solution $y=0\text{.}$

###### Example5.22. Solving an IVP I.

Solve the initial value problem

\begin{equation*} \ds y' + y\cos t =0\text{,} \end{equation*}

subject to

1. $y(0)=1/2$

2. $y(2)=1/2$

Solution

\begin{equation*} P(t)=\int -\cos t\,dt = -\sin t\text{,} \end{equation*}

so the general solution to the differential equation is

\begin{equation*} y=Ae^{-\sin t}\text{.} \end{equation*}
1. To compute the constant coefficient $A\text{,}$ we substitute:

\begin{equation*} \frac{1}{2} = Ae^{-\sin 0} = A\text{,} \end{equation*}

so the solutions is

\begin{equation*} y = \frac{1}{2} e^{-\sin t}\text{.} \end{equation*}
2. To compute the constant coefficient $A\text{,}$ we substitute:

\begin{align*} \frac{1}{2} \amp = Ae^{-\sin 2}\\ A \amp = \frac{1}{2}e^{\sin 2} \end{align*}

so the solution is

\begin{equation*} y = {1\over 2}e^{\sin 2}e^{-\sin t}\text{.} \end{equation*}
###### Example5.23. Solving an IVP II.

Solve the initial value problem $ty'+3y=0\text{,}$ $y(1)=2\text{,}$ assuming $t>0\text{.}$

Solution

We write the equation in standard form: $y'+3y/t=0\text{.}$ Then

\begin{equation*} P(t)=\int -{3\over t}\,dt=-3\ln t \end{equation*}

and

\begin{equation*} y=Ae^{-3\ln t}=At^{-3}\text{.} \end{equation*}

Substituting to find $A\text{:}$ $\ds 2=A(1)^{-3}=A\text{,}$ so the solution is $\ds y=2t^{-3}\text{.}$

### Subsection5.3.2Non-Homogeneous DEs

As you might guess, a first order non-homogeneous linear differential equation has the form $\ds y' + p(t)y = f(t)\text{.}$ Not only is this closely related in form to the first order homogeneous linear equation, we can use what we know about solving homogeneous equations to solve the general linear equation.

###### Definition5.24. First Order Non-Homogeneous Linear DE.

A first order non-homogeneous linear differential equation is one of the form

\begin{equation*} y' + p(t)y = f(t)\text{.} \end{equation*}

Note: When the coefficient of the first derivative is one in the first order non-homogeneous linear differential equation as in the above definition, then we say the DE is in standard form.

Let us now discuss how we can find all solutions to a first order non-homogeneous linear differential equation. Suppose that $y_1(t)$ and $y_2(t)$ are solutions to $\ds y' + p(t)y = f(t)\text{.}$ Let $\ds g(t)=y_1-y_2\text{.}$ Then

\begin{align*} g'(t)+p(t)g(t)\amp = y_1'-y_2'+p(t)(y_1-y_2)\\ \amp = (y_1'+p(t)y_1)-(y_2'+p(t)y_2)\\ \amp = f(t)-f(t)=0\text{.} \end{align*}

In other words, $\ds g(t)=y_1-y_2$ is a solution to the homogeneous equation $\ds y' + p(t)y = 0\text{.}$ Turning this around, any solution to the linear equation $\ds y' + p(t)y = f(t)\text{,}$ call it $y_1\text{,}$ can be written as $y_2+g(t)\text{,}$ for some particular $y_2$ and some solution $g(t)$ of the homogeneous equation $\ds y' + p(t)y = 0\text{.}$ Since we already know how to find all solutions of the homogeneous equation, finding just one solution to the equation $\ds y' + p(t)y = f(t)$ will give us all of them.

#### Subsubsection5.3.2.1Variation of Parameters

We now introduce the first one of two methods discussed in these notes to solve a first order non-homogeneous linear differential equation. Again, it turns out that what we already know helps. We know that the general solution to the homogeneous equation $\ds y' + p(t)y = 0$ looks like $\ds Ae^{P(t)}\text{,}$ where $P(t)$ is an antiderivative of $-p(t)\text{.}$ We now make an inspired guess: Consider the function $\ds v(t)e^{P(t)}\text{,}$ in which we have replaced the constant parameter $A$ with the function $v(t)\text{.}$ This technique is called variation of parameters. For convenience write this as $s(t)=v(t)h(t)\text{,}$ where $\ds h(t)=e^{P(t)}$ is a solution to the homogeneous equation. Now let's compute a bit with $s(t)\text{:}$

\begin{align*} s'(t)+p(t)s(t)\amp = v(t)h'(t)+v'(t)h(t)+p(t)v(t)h(t)\\ \amp = v(t)(h'(t)+p(t)h(t)) + v'(t)h(t)\\ \amp = v'(t)h(t)\text{.} \end{align*}

The last equality is true because $\ds h'(t)+p(t)h(t)=0\text{,}$ since $h(t)$ is a solution to the homogeneous equation. We are hoping to find a function $s(t)$ so that $\ds s'(t)+p(t)s(t)=f(t)\text{;}$ we will have such a function if we can arrange to have $\ds v'(t)h(t)=f(t)\text{,}$ that is, $\ds v'(t)=f(t)/h(t)\text{.}$ But this is as easy (or hard) as finding an antiderivative of $\ds f(t)/h(t)\text{.}$ Putting this all together, the general solution to $\ds y' + p(t)y = f(t)$ is

\begin{equation*} v(t)h(t)+Ae^{P(t)} = v(t)e^{P(t)}+Ae^{P(t)}\text{.} \end{equation*}
###### Method of Variation of Parameters.

Given a first order non-homogeneous linear differential equation

\begin{equation*} y' + p(t)y=f(t)\text{,} \end{equation*}

using variation of parameters the general solution is given by

\begin{equation*} y(t)=v(t)e^{P(t)} + Ae^{P(t)}\text{,} \end{equation*}

where $v'(t)=e^{-P(t)}f(t)$ and $P(t)$ is an antiderivative of $-p(t)\text{.}$

Note: The method of variation of parameters makes more sense after taking linear algebra since the method uses determinants. We therefore restrict ourselves to just one example to illustrate this method.

###### Example5.26. Solving an IVP Using Variation of Parameters.

Find the solution of the initial value problem $\ds y'+3y/t=t^2\text{,}$ $y(1)=1/2\text{.}$

Solution

First we find the general solution; since we are interested in a solution with a given condition at $t=1\text{,}$ we may assume $t>0\text{.}$ We start by solving the homogeneous equation as usual; call the solution $g\text{:}$

\begin{equation*} g=Ae^{-\int (3/t)\,dt}=Ae^{-3\ln t}=At^{-3}\text{.} \end{equation*}

Then as in the discussion, $\ds h(t)=t^{-3}$ and $\ds v'(t)=t^2/t^{-3}=t^5\text{,}$ so $\ds v(t)=t^6/6\text{.}$ We know that every solution to the equation looks like

\begin{equation*} y(t) = v(t)t^{-3}+At^{-3}={t^6\over6}t^{-3}+At^{-3}={t^3\over6}+At^{-3}\text{.} \end{equation*}

Finally we substitute $y(1)=\frac{1}{2}$ to find $A\text{:}$

\begin{align*} {1\over 2}\amp = {(1)^3\over6}+A(1)^{-3}={1\over6}+A\\ A\amp = {1\over 2}-{1\over6}={1\over3}\text{.} \end{align*}

The solution is then

\begin{equation*} y={t^3\over6}+{1\over3}t^{-3}\text{.} \end{equation*}

#### Subsubsection5.3.2.2Integrating Factor

Another common method for solving such a differential equation is by means of an integrating factor . In the differential equation $\ds y'+p(t)y=f(t)\text{,}$ we note that if we multiply through by a function $I(t)$ to get $\ds I(t)y'+I(t)p(t)y=I(t)f(t)\text{,}$ the left hand side looks like it could be a derivative computed by the Product Rule:

\begin{equation*} \frac{d}{dt}(I(t)y)=I(t)y'+I'(t)y\text{.} \end{equation*}

Now if we could choose $I(t)$ so that $I'(t)=I(t)p(t)\text{,}$ this would be exactly the left hand side of the differential equation. But this is just a first order homogeneous linear equation, and we know a solution is $\ds I(t)=e^{Q(t)}\text{,}$ where $\ds Q(t)=\int p(t)\,dt\text{.}$ Note that $Q(t)=-P(t)\text{,}$ where $P(t)$ appears in the variation of parameters method and $P'(t)=-p(t)\text{.}$ Now the modified differential equation is

\begin{align*} e^{-P(t)}y'+e^{-P(t)}p(t)y\amp = e^{-P(t)}f(t)\\ {d\over dt}(e^{-P(t)}y)\amp = e^{-P(t)}f(t)\text{.} \end{align*}

Integrating both sides gives

\begin{align*} e^{-P(t)}y\amp = \int e^{-P(t)}f(t)\,dt\\ y\amp = e^{P(t)}\int e^{-P(t)}f(t)\,dt\text{.} \end{align*}
Note: If you look carefully, you will see that this is exactly the same solution we found by variation of parameters, because $\ds e^{-P(t)}f(t)=f(t)/h(t)\text{.}$ Some people find it easier to remember how to use the integrating factor method, rather than variation of parameters. Since ultimately they require the same calculation, you should use whichever of the two methods appeals to you more.
###### Definition5.27. Integrating Factor.

Given a first order non-homogeneous linear differential equation

\begin{equation*} y'+p(t)y=f(t)\text{,} \end{equation*}

the integrating factor is given by

\begin{equation*} I(t) = e^{\int p(t)\,dt}\text{.} \end{equation*}
###### Method of Integrating Factor.

Given a first order non-homogeneous linear differential equation

\begin{equation*} y'+p(t)y=f(t)\text{,} \end{equation*}

follow these steps to determine the general solution $y(t)$ using an integrating factor:

1. Calculate the integrating factor $I(t)\text{.}$

2. Multiply the standard form equation by $I(t)\text{.}$

3. Simplify the left-hand side to

\begin{equation*} \frac{d}{dt}\left[I(t)y\right]\text{.} \end{equation*}
4. Integrate both sides of the equation.

5. Solve for $y(t)\text{.}$

The solution can be compactly written as

\begin{equation*} y(t)=e^{-\int p(t)\,dt}\left[\int e^{\int p(t)\,dt} f(t)\,dt + C\right]\text{.} \end{equation*}

Using this method, the solution of the previous example would look just a bit different.

###### Example5.28. Solving an IVP Using Integrating Factor.

Find the solution of the initial value problem $\ds y'+3y/t=t^2\text{,}$ $y(1)=1/2\text{.}$

Solution

Notice that the differential equation is already in standard form. We begin by computing the integrating factor and obtain

\begin{equation*} I(t)=e^{\int \frac{3}{t}\,dt} = e^{3\ln t} = t^3 \end{equation*}

for $t>0\text{.}$

Next, we multiply both sides of the DE with $I(t)$ and get

\begin{equation*} \begin{split} t^3 \left[y'+\frac{3}{y}y\right] \amp = t^3t^2 \\ y^3y' + 3t^2y \amp = t^5 \end{split} \end{equation*}

which simplifies to

\begin{equation*} \frac{d}{dt} \left[t^3y\right] = t^5\text{.} \end{equation*}

Now we integrate both sides with respect to $t$ and solve for $y\text{:}$

\begin{equation*} \begin{split} \int \frac{d}{dt}\left[t^3y\right] \,dt \amp = \int t^5 \,dt \\ t^3 y \amp = \frac{t^6}{6} + C\\ y \amp = \frac{t^3}{6} + \frac{C}{t^3}. \end{split} \end{equation*}

Lastly, we use the initial value $y(1)=1/2$ to find $C\text{:}$

\begin{equation*} y(1)=\frac{1^3}{6}+\frac{C}{1^3} = \frac{1}{2} \implies C = \frac{1}{3}\text{.} \end{equation*}

Hence, the solution to the DE is

\begin{equation*} y = \frac{t^3}{6} +\frac{1}{3t^2}\text{.} \end{equation*}
###### Example5.29. General Solution Using Integrating Factor.

Determine the general solution of the differential equation

\begin{equation*} \frac{dy}{dt} +3t^2y = 6t^2\text{.} \end{equation*}
Solution

We see that the differential equation is in standard form. We then compute the integrating factor as

\begin{equation*} I(t) = e^{\int 3t^2 \,dt} = e^{t^3}\text{,} \end{equation*}

where we took the arbitrary constant of integration to be zero.

Therefore, we can write the DE as

\begin{equation*} \begin{split} e^{t^3}\left[y' +3t^2y\right] \amp = 6t^2e^{t^3} \\ \frac{d}{dt}\left[e^{t^3}y\right] \amp = 6t^2e^{t^3}. \end{split} \end{equation*}

Integrating both sides with respect to $t$ gives

\begin{equation*} e^{t^3}y = 6\int t^2e^{t^3}\,dt \end{equation*}

We solve this integral by making the substitution $u=t^3, \ du = 3t^2\,dt\text{:}$

\begin{equation*} \int t^2e^{t^3}\,dt = \frac{1}{3}\int e^u\,du = \frac{1}{3}e^u + C= \frac{1}{3}e^{t^3} + C\text{.} \end{equation*}

Thus,

\begin{equation*} \begin{split} e^{t^3}y \amp = 2e^{t^3} + C \\ y \amp = 2 + Ce^{-t^3}. \end{split} \end{equation*}

The general solution to the DE is therefore

\begin{equation*} y = 2 + Ce^{-t^3}\text{,} \end{equation*}

for $C \in \R\text{.}$

##### Exercises for Section 5.3.

Find the general solution of the following homogeneous differential equations.

1. $\ds y'+5y=0$

$\ds y=Ae^{-5t}$
Solution
This is a first order homogeneous linear differential equation. Therefore, we separate variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= -5y \\ \int \frac{1}{y}\,dy \amp= -5 \int \,dt \\ \ln |y| \amp= -5t + C \\ y(t) \amp= e^{-5t+C} = Ae^{-5t},\end{split} \end{equation*}
for any constant $A\text{.}$
2. $\ds y'-2y=0$

$\ds y=Ae^{2t}$
Solution
This is a first order homogeneous linear differential equation. Therefore, we separate variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= 2y \\ \int \frac{1}{y}\,dy \amp= 2 \int \,dt \\ \ln |y| \amp= 2t + C \\ y(t) \amp= e^{2t+C} = Ae^{2t},\end{split} \end{equation*}
for any constant $A\text{.}$
3. $\ds y'+{y\over 1+t^2}=0$

$\ds y=Ae^{-\arctan t}$
Solution
This is a first order homogeneous linear differential equation. Therefore, we separate variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= -\frac{y}{1+t^2} \\ \int \frac{1}{y}\,dy \amp= - \int \frac{1}{1+t^2} \,dt \\ \ln |y|\amp= -\tan^{-1}(t) + C \\ y(t) \amp= e^{-\tan^{-1}(t)+C} = Ae^{-\tan^{-1}(t)},\end{split} \end{equation*}
for any constant $A\text{.}$
4. $\ds y'+t^2y=0$

$\ds y=Ae^{-t^3/3}$
Solution
This is a first order homogeneous linear differential equation. Therefore, we separate variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= -t^2 y \\ \int \frac{1}{y}\,dy \amp= - \int t^2 \,dt \\ \ln |y| \amp= -\frac{t^3}{3} + C \\ y(t) \amp= e^{-\frac{t^3}{3}+C} = Ae^{-\frac{t^3}{3}},\end{split}s \end{equation*}
for any constant $A\text{.}$

Solve the following initial value problems concerning homogeneous DEs.

1. $\ds y' + y=0\text{,}$ $y(0)=4$

$\ds y=4e^{-t}$
Solution
We first find the general solution by separating variables. Notice that $y=0$ is a constant solution, but is not a solution to the IVP.
\begin{equation*} \begin{split} \diff{y}{t} \amp= -y \\ \int \frac{1}{y} \,dy \amp= -\int \,dt \\ \ln |y| \amp= -t + C\\ y(t) \amp= A e^{-t}. \end{split} \end{equation*}
We now apply the initial condition:
\begin{equation*} y(0) = 4 \implies A = 4. \end{equation*}
Hence, the solution to the IVP is
\begin{equation*} y(t) = 4e^{-t}. \end{equation*}
2. $\ds y' -3y=0\text{,}$ $y(1)=-2$

$\ds y=-2e^{3t-3}$
Solution
We first find the general solution by separating variables. Notice that $y=0$ is a constant solution, but is not a solution to the IVP.
\begin{equation*} \begin{split} \diff{y}{t} \amp= 3y \\ \int \frac{1}{y} \,dy \amp= \int 3\,dt \\ \ln |y| \amp= 3t + C\\ y(t) \amp= A e^{3t}. \end{split} \end{equation*}
We now apply the initial condition:
\begin{equation*} y(1) = -2 \implies A = -2e^{-3}. \end{equation*}
Hence, the solution to the IVP is
\begin{equation*} y(t) = -2e^{3(t-1)}. \end{equation*}
3. $\ds y' + y\sin t = 0\text{,}$ $y(\pi)=1$

$\ds y=e^{1+\cos t}$
Solution
We first find the general solution by separating variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= -y\sin t \\ \int \frac{1}{y} \,dy \amp= -\int \sin t \,dt \\ \ln |y| \amp= \cos t + C\\ y(t) \amp= A e^{\cos t}. \end{split} \end{equation*}
We now apply the initial condition:
\begin{equation*} y(\pi) = 1 \implies A = \frac{1}{e^{-1}} = e. \end{equation*}
Hence, the solution to the IVP is
\begin{equation*} y(t) = e^{\cos(t) +1}. \end{equation*}
4. $\ds y' +ye^t=0\text{,}$ $y(0)=e$

$\ds y=e^2e^{-e^t}$
Solution
We first find the general solution by separating variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= -ye^t \\ \int \frac{1}{y} \,dy \amp= -\int e^t \,dt \\ \ln |y| \amp= -e^t + C\\ y(t) \amp= A e^{-e^t}. \end{split} \end{equation*}
We now apply the initial condition:
\begin{equation*} y(0) = e \implies A = \frac{e}{e^{-1}} = e^2. \end{equation*}
Hence, the solution to the IVP is
\begin{equation*} y(t) = e^{2-e^t}. \end{equation*}
5. $\ds y' +y\sqrt{1+t^4}=0\text{,}$ $y(0)=0$

$\ds y=0$
Solution
We notice that $y=0$ is a constant solution to the IVP.
6. $\ds y' + y\cos(e^t)=0\text{,}$ $y(0)=0$

$\ds y=0$
Solution
We notice that $y=0$ is a constant solution to the IVP.
7. $\ds ty' - 2y = 0\text{,}$ $y(1)=4$

$\ds y=4t^2$
Solution
We first find the general solution by separating variables.
\begin{equation*} \begin{split} t\diff{y}{t} \amp= 2y \\ \int \frac{1}{y} \,dy \amp= 2\int \frac{1}{t}\,dt \\ \ln |y| \amp= 2\ln|t| + C\\ y(t) \amp= e^{2\ln |t| + C}\\ \amp= Ae^{2\ln |t|}\\ \amp= A e^{\ln t^2}\\ \amp= At^2 \end{split} \end{equation*}
We now apply the initial condition:
\begin{equation*} y(1) = 4 \implies A = 4. \end{equation*}
Hence, the solution to the IVP is
\begin{equation*} y(t) = 4t^2. \end{equation*}
8. $\ds t^2y' + y = 0\text{,}$ $y(1)=-2\text{,}$ $t>0$

$\ds y=-2e^{(1/t)-1}$
Solution
We first find the general solution by separating variables.
\begin{equation*} \begin{split} t^2\diff{y}{t} \amp= -y \\ \int \frac{1}{y} \,dy \amp= -\int \frac{1}{t^2}\,dt \\ \ln |y| \amp= \frac{1}{t} + C\\ y(t) \amp= e^{1/t + C}\\ \amp= Ae^{1/t} \end{split} \end{equation*}
We now apply the initial condition:
\begin{equation*} y(1) = -2 \implies A = -2e^{-1}. \end{equation*}
Hence, the solution to the IVP is
\begin{equation*} y(t) = -2e^{1/t-1}. \end{equation*}
9. $\ds t^3y' = 2y\text{,}$ $y(1)=1\text{,}$ $t>0$

$\ds y=e^{1-t^{-2}}$
Solution
We first find the general solution by separating variables.
\begin{equation*} \begin{split} t^3\diff{y}{t} \amp=2y \\ \int \frac{1}{y} \,dy \amp= 2\int \frac{1}{t^3}\,dt \\ \ln |y| \amp= -2\frac{1}{2t^2} + C\\ y(t) \amp= e^{-1/(t^2) + C}\\ \amp= Ae^{-1/t^2} \end{split} \end{equation*}
We now apply the initial condition:
\begin{equation*} y(1) = 1 \implies A = e^{1}. \end{equation*}
Hence, the solution to the IVP is
\begin{equation*} y(t) = e^{1-1/t^2}. \end{equation*}
10. $\ds t^3y' = 2y\text{,}$ $y(1)=0\text{,}$ $t>0$

$\ds y=0$
Solution
We first find the general solution by separating variables.
\begin{equation*} \begin{split} t^3\diff{y}{t} \amp =2y \\ \int \frac{1}{y} \,dy \amp = 2\int \frac{1}{t^3}\,dt \\ \ln |y| \amp = -2\frac{1}{2t^2} + C\\ y(t) \amp = e^{-1/(t^2) + C}\\ \amp= Ae^{-1/t^2} \end{split} \end{equation*}
We now apply the initial condition:
\begin{equation*} y(1) = 0 \implies A = 0. \end{equation*}
Hence, the solution to the IVP is
\begin{equation*} y(t) = 0, \end{equation*}
but in order to separate variables we had to assume that $y\neq 0\text{.}$ However, by inspection, we notice that $y(t) = 0$ is indeed a solution to this IVP.

Find the general solution of the following non-homogeneous differential equations.

1. $\ds y' +4y=8$

$\ds y=Ae^{-4t}+2$
Solution
We first solve the corresponding homogeneous equation using separation of variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= -4y \\ \int \frac{1}{y}\,dy \amp= -4\int \,dt \\ \ln|y| \amp= -4t+ C\\ y(t) \amp= Ae^{-4t}.\end{split} \end{equation*}
We now notice that $y=2$ is a particular solution to the DE:
\begin{equation*} \diff{}{t} (2) + 4(2) = 8. \end{equation*}
Hence, the general solution is
\begin{equation*} y(t) = Ae^{-4t} + 2. \end{equation*}
2. $\ds y'-2y=6$

$\ds y=Ae^{2t}-3$
Solution
We first solve the corresponding homogeneous equation using separation of variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= 2y \\ \int \frac{1}{y}\,dy \amp= 2\int \,dt \\ \ln|y| \amp= 2t+ C\\ y(t) \amp= Ae^{2t}.\end{split} \end{equation*}
We now notice that $y=-3$ is a particular solution to the DE:
\begin{equation*} \diff{}{t} (-3) -2(-3) = 6. \end{equation*}
Hence, the general solution is
\begin{equation*} y(t) = Ae^{2t} -3.\ \end{equation*}
3. $\ds y' +ty=5t$

$\ds y=Ae^{-(1/2)t^2}+5$
Solution
We first solve the corresponding homogeneous equation using separation of variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= -ty \\ \int \frac{1}{y}\,dy \amp= -\int t \,dt \\ \ln|y| \amp= -\frac{t^2}{2} + C\\ y(t) \amp= Ae^{-t^2/2}.\end{split} \end{equation*}
We now notice that $y=5$ is a particular solution to the DE:
\begin{equation*} \diff{}{t} (5) + t(5) = 5t. \end{equation*}
Hence, the general solution is
\begin{equation*} y(t) = Ae^{-t^2/2} + 5. \end{equation*}
4. $\ds y'+e^ty=-2e^t$

$\ds y=Ae^{-e^t}-2$
Solution
We first solve the corresponding homogeneous equation using separation of variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp=-e^t y \\ \int \frac{1}{y}\,dy \amp= -\int e^t \,dt \\ \ln|y| \amp= -e^t + C\\ y(t) \amp= Ae^{-e^t}.\end{split} \end{equation*}
We now notice that $y=-2$ is a particular solution to the DE:
\begin{equation*} \diff{}{t} (-2) + e^t (-2) = -2e^t. \end{equation*}
Hence, the general solution is
\begin{equation*} y(t) = Ae^{-e^t} -2 . \end{equation*}
5. $\ds y'-y=t^2$

$\ds y=Ae^{t}-t^2-2t-2$
Solution
We first solve the corresponding homogeneous equation using separation of variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp=y \\ \int \frac{1}{y}\,dy \amp= \int \,dt \\ \ln|y| \amp= t + C\\ y(t) \amp= Ae^{t}.\end{split} \end{equation*}
It is difficult to guess a particular solution to this DE (notice that there are no constant solutions which satisfy the DE). Therefore, we use the method of variation of parameters: since the right-hand side is a quadratic polynomial, we guess that a particular solution is of the form $y = at^2 +bt + c\text{.}$ Now apply the DE:
\begin{equation*} y' - y = 2at + b - (at^2+bt+c) = -at^2 +(2a-b)t + b-c. \end{equation*}
Therefore, we require
\begin{equation*} -a = 1, 2a-b = 0, b=c. \end{equation*}
Hence, a particular solution is
\begin{equation*} y = -t^2 - 2t - 2. \end{equation*}
All together, we find that the general solution is
\begin{equation*} y(t) = Ae^{t} -t^2 - 2t - 2. \end{equation*}
6. $\ds 2y' +y=t$

$\ds y=Ae^{-t/2}+t-2$
Solution
We first solve the corresponding homogeneous equation using separation of variables:
\begin{equation*} \begin{split} 2\diff{y}{t} \amp=-y \\ \int \frac{1}{y}\,dy \amp= \int \frac{-1}{2} \,dt \\ \ln|y| \amp= -\frac{t}{2} + C\\ y(t) \amp= Ae^{-t/2}.\end{split} \end{equation*}
We now use variation of parameters to find a particular solution. The right-hand side is linear, and so a particular solution must be of the form $y = at+b.$ Now apply the DE:
\begin{equation*} 2 \diff{}{t} (at+b) + (at+b) = at + 2a+b. \end{equation*}
Therefore, a particular solution must satisfy
\begin{equation*} a = 1, 2a+b = 0 \implies a = 1, b = -2. \end{equation*}
All together, we find that the general solution is
\begin{equation*} y(t) = Ae^{-t/2} + t-2. \end{equation*}

Find the general solution of the following non-homogeneous differential equations on the restricted domain.

1. $\ds ty' -2y=1/t\text{,}$ $t>0$

$\ds y=At^2-{1\over3t}$
Solution
We first solve the corresponding homogeneous equation:
\begin{equation*} \begin{split} t\diff{y}{t} \amp= 2y\\ \int \frac{1}{y} \,dy \amp= \int \frac{2}{t} \,dt \\ \ln|y| \amp= 2\ln|t| + C\\ y \amp= Ae^{\ln(t^2)}\\ \amp= At^2. \end{split} \end{equation*}
We now look for a particular solution on the restricted domain. We look for a solution of the form $b/t + c\text{:}$
\begin{equation*} t\left(- \frac{b}{t^2}\right) - 2\left(\frac{b}{t} + c\right) = \frac{-3b}{t} + 2c. \end{equation*}
Therefore, we need $b=-1/3$ and $c=0\text{.}$ Hence, the general solution is
\begin{equation*} y(t) = At^2 -\frac{1}{3t}. \end{equation*}
2. $\ds ty'+y=\sqrt{t}\text{,}$ $t>0$

$\ds y={c\over t}+{2\over3}\sqrt t$
Solution
We first solve the corresponding homogeneous equation:
\begin{equation*} \begin{split} t\diff{y}{t} \amp= -y\\ \int \frac{1}{y} \,dy \amp= -\int \frac{2}{t} \,dt \\ \ln|y| \amp= -\ln|t| + C\\ y \amp= Ae^{\ln(t)^{-1}}\\ \amp= \frac{A}{t}. \end{split} \end{equation*}
We now look for a particular solution on the restricted domain. We look for a solution of the form $a\sqrt{t} + c\text{:}$
\begin{equation*} t\left(\frac{a}{2\sqrt{t}}\right) + \left(a\sqrt{t} + c\right) = \left(\frac{a}{2} + a\right)\sqrt{t} + c. \end{equation*}
Therefore, we need $a=2/3$ and $c=0\text{.}$ Hence, the general solution is
\begin{equation*} y(t) = \frac{A}{t} + \frac{2}{3}\sqrt{t}. \end{equation*}
3. $\ds y'\cos t+y\sin t=1\text{,}$ $-\pi/2\lt t\lt \pi/2$

$\ds y= A\cos t+\sin t$
Solution
We first solve the corresponding homogeneous equation:
\begin{equation*} \begin{split} \cos(t)\diff{y}{t}\amp= -y\sin(t)\\ \int \frac{1}{y} \,dy \amp= -\int \frac{\sin (t)}{\cos(t)} \,dt \\ \ln|y| \amp= -\int \tan(t) \,dt \end{split} \end{equation*}
On this restricted domain, we know that
\begin{equation*} \int \tan(t) \,dt = \ln|\cos(t)|\,dt + C. \end{equation*}
Therefore, the general solution is
\begin{equation*} y = A\cos(t). \end{equation*}
To find a particular solution, we notice that when $y=\sin(t)\text{,}$ we have
\begin{equation*} (\sin(t)')\cos(t) + \sin^2(t) = \cos^2(t) + \sin^2(t) = 1. \end{equation*}
Hence, this is a particular solution and so the general solution is
\begin{equation*} y(t) = A\cos(t) +\sin(t). \end{equation*}
4. $\ds y' + y\sec t=\tan t\text{,}$ $-\pi/2\lt t\lt \pi/2$

$\ds y= {A\over\sec t+\tan t}+1-{t\over\sec t+\tan t}$

Solve the following initial value problems concerning non-homogeneous DEs.

1. $\ds y' +4y=8, y(0)=1$

$\ds y=2-e^{-4t}$
Solution
We first solve the corresponding homogeneous equation using separation of variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= -4y \\ \int \frac{1}{y}\,dy \amp= -4\int \,dt \\ \ln|y| \amp= -4t+ C\\ y(t) \amp= Ae^{-4t}.\end{split} \end{equation*}
We now notice that $y=2$ is a particular solution to the DE:
\begin{equation*} \diff{}{t} (2) + 4(2) = 8. \end{equation*}
Hence, the general solution is
\begin{equation*} y(t) = Ae^{-4t} + 2. \end{equation*}
We now apply the initial condition:
\begin{equation*} y(0) = 1 \implies A + 2 = 1. \end{equation*}
Therefore, the solution to the IVP is
\begin{equation*} y(t) = -e^{-4t} + 2. \end{equation*}
2. $\ds y'-2y=6,y(0)=3$

$\ds y=6e^{2t}-3$
Solution
We first solve the corresponding homogeneous equation using separation of variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= 2y \\ \int \frac{1}{y}\,dy \amp= 2\int \,dt \\ \ln|y| \amp= 2t+ C\\ y(t) \amp= Ae^{2t}.\end{split} \end{equation*}
We now notice that $y=-3$ is a particular solution to the DE:
\begin{equation*} \diff{}{t} (-3) -2(-3) = 6. \end{equation*}
Hence, the general solution is
\begin{equation*} y(t) = Ae^{2t} -3.\ \end{equation*}
We now apply the initial condition:
\begin{equation*} y(0) = 3 \implies A -3 = 3. \end{equation*}
Therefore, the solution to the IVP is
\begin{equation*} y(t) =6e^{2t} -3. \end{equation*}
3. $\ds y' +ty=5t, y(2)=1$

$\ds y=5-4e^{2-(1/2)t^2}$
Solution

We first look for the general solution to the corresponding homogeneous problem,

\begin{equation*} y' + ty = 0\text{.} \end{equation*}

Separating variables, we find

\begin{equation*} \begin{split} \diff{y}{t} \amp = -ty \\ \implies \int \frac{dy}{y} \amp = -\int t\,dt \\ \implies \ln |y| \amp = -\frac{1}{2}t^2+ C \\ \implies y \amp = A e^{-\frac{1}{2}t^2} \end{split} \end{equation*}

So we take $h(t)=A e^{-\frac{1}{2}t^2}\text{.}$ It remains to find any particular solution $g(t)\text{:}$ we notice that $g(t)=5$ is one such solution, since

\begin{equation*} \diff{}{t} (5) + t \cdot 5 = 5t\text{.} \end{equation*}

Therefore, the general solution is

\begin{equation*} y(t) = h(t) + g(t) = A e^{-\frac{1}{2}t^2} + 5\text{.} \end{equation*}

Now apply the initial condition:

\begin{equation*} y(2) = 1 \implies Ae^{-2} + 5 = 1 \implies A = -4e^2\text{.} \end{equation*}

Altogether, we find that

\begin{equation*} y(t) = 5-4e^{2-\frac{1}{2}t^2}\text{.} \end{equation*}
4. $\ds y'+e^ty=-2e^t, y(0)=e^{-1}$

$\ds y=e^{-e^t}-2$
5. $\ds y'-y=t^2, y(0)=4$

$\ds y=6e^{t}-t^2-2t-2$
Solution

We use the method of integrating factors. Let

\begin{equation*} I(t) = e^{\int -1 \,dt} = e^{-t}\text{,} \end{equation*}

where we took the arbitrary constant of integration to be zero. Multiplying the DE by $I(t)$ gives

\begin{equation*} e^{-t}y' - e^{-t}y = e^{-t}t^2 \implies \diff{}{t}\left[e^{-t}y\right] = e^{-t}t^2\text{.} \end{equation*}

Integrating, we find

\begin{equation*} e^{-t}y = \int e^{-t}t^2\,dt\text{.} \end{equation*}

We solve using integration by parts with

\begin{equation*} \begin{array}{ll} u = t^2 \amp dv = e^{-t}\,dt \\ du = 2t\,dt \amp v = -e^{-t} \end{array} \end{equation*}

So,

\begin{equation*} \int t^2 e^{-t}\,dt = -t^2e^{-t} + 2\int t e^{-t}\,dt\text{,} \end{equation*}

and apply integration by parts again to find

\begin{equation*} \int t^2 e^{-t}\,dt = -e^{-t} \left(t^2+2t+2\right) + C\text{.} \end{equation*}

Thus, we have

\begin{equation*} e^{-t}y = -e^{-t}\left(t^2+2t+2\right) + C \implies y(t) = Ce^t - (t^2+2t+2)\text{.} \end{equation*}

(Notice that the particular solution, $g(t)=-t^2-2t-2$ may have been difficult to “guess” .) We now apply the initial condition:

\begin{equation*} y(0) = -2 + C = 4 \implies C = 6\text{.} \end{equation*}

Therefore, the solution to the initial value problem is

\begin{equation*} y(t) = 6e^t - (t^2+2t+2)\text{.} \end{equation*}
6. $\ds 2y' +y=t, y(1)=-1$

$\ds y=t-2$
Solution
We first solve the corresponding homogeneous equation using separation of variables:
\begin{equation*} \begin{split} 2\diff{y}{t} \amp=-y \\ \int \frac{1}{y}\,dy \amp= \int \frac{-1}{2} \,dt \\ \ln|y| \amp= -\frac{t}{2} + C\\ y(t) \amp= Ae^{-t/2}.\end{split} \end{equation*}
We now use variation of parameters to find a particular solution. The right-hand side is linear, and so a particular solution must be of the form $y = at+b.$ Now apply the DE:
\begin{equation*} 2 \diff{}{t} (at+b) + (at+b) = at + 2a+b. \end{equation*}
Therefore, a particular solution must satisfy
\begin{equation*} a = 1, 2a+b = 0 \implies a = 1, b = -2. \end{equation*}
All together, we find that the general solution is
\begin{equation*} y(t) = Ae^{-t/2} + t-2. \end{equation*}
We now apply the initial condition:
\begin{equation*} y(1) = -1 \implies Ae^{1/2} + 1 -2 = -1 \implies A= 0. \end{equation*}
Therefore, the general solution is
\begin{equation*} y(t) = t-2. \end{equation*}
A function $y(t)$ is a solution of $\ds y' + ky=0\text{.}$ Suppose that $y(0)=100$ and $y(2)=4\text{.}$ Find $k$ and find $y(t)\text{.}$ Answer
$k=\ln 5\text{,}$ $\ds y=100e^{-t\ln 5}$
Solution
We solve the DE using separation of variables:
\begin{equation*} \begin{split} \diff{y}{t} \amp= -ky \\ \int\frac{1}{y}\,dt \amp= -k\int \,dt \\ \ln|y| \amp= -kt + C\\ y(t) \amp= Ae^{-kt} \end{split} \end{equation*}
We now apply the two initial conditions:
\begin{equation*} y(0) = 100 \implies A = 100, \end{equation*}
and
\begin{equation*} y(2) = 4 \implies 100e^{-2k} = 4 \implies k = \frac{1}{2}\ln(25). \end{equation*}
Therefore, we have found that
\begin{equation*} y(t) = 100 e^{-t\ln(25)/2} = 100 e^{-t\ln(5)}. \end{equation*}
A function $y(t)$ is a solution of $\ds y' + t^ky=0\text{.}$ Suppose that $y(0)=1$ and $y(1)=e^{-13}\text{.}$ Find $k$ and find $y(t)\text{.}$ Answer
$k=-12/13\text{,}$ $\ds y=\exp(-13 t^{1/13})$
Solution
We first find the general solution using separation of variables. Assume that $k \neq -1\text{:}$
\begin{equation*} \begin{split} \diff{y}{t} \amp= -t^ky \\ \int\frac{1}{y}\,dt \amp= -\int t^k\,dt \\ \ln|y| \amp= -\frac{t^{k+1}}{k+1} + C\\ y(t) \amp= Ae^{-t^{k+1}/(k+1)}. \end{split} \end{equation*}
Now apply the initial conditions:
\begin{equation*} y(0) = 1 \implies A = 1. \end{equation*}
Then,
\begin{equation*} y(1) = e^{-\frac{1}{k+1}} = e^{-13} \implies k = -\frac{12}{13}. \end{equation*}
All together, we have
\begin{equation*} y(t) = e^{-13t^{1/13}}. \end{equation*}
A bacterial culture grows at a rate proportional to its population. If the population is one million at $t=0$ and 1.5 million at $t=1$ hour, find the population as a function of time.Answer
$\ds y=e^{t\ln(3/2)}$
Solution
If the population is growing at a rate proportional to its curent size, then the population $y$ as a function of time can be described by the DE
\begin{equation*} \diff{y}{t} = k y \implies y(t) = Ae^{kt}. \end{equation*}
Let $y$ be measured in millions and $t$ in hours. Then since $y(0) = 1\text{,}$ we need $A=1\text{.}$ Furthermore, if $y(1) = 1.5\text{,}$ then we need
\begin{equation*} 1.5 = e^{k} \implies k = \ln(1.5). \end{equation*}
All together, we have found that the population size in millions can be described by the function
\begin{equation*} y(t) = e^{1.5t}. \end{equation*}
A radioactive element decays with a half-life of 6 years. If a mass of the element weighs ten pounds at $t=0\text{,}$ find the amount of the element at time $t\text{.}$ Answer
$\ds y=10e^{-t\ln(2)/6}$
Solution
The amount of radioactive material (measured in lbs) left after $t$ years can be described by
\begin{equation*} \diff{y}{t} = ky \implies y(t) = Ae^{-kt}. \end{equation*}
Therefore, if the initial mass was 10lbs, then we need $A=10\text{.}$ If the half-life of the element if 6 years, then we must have
\begin{equation*} \frac{10}{2} = 10 e^{-k(6)} \implies k = \frac{1}{6} \ln(2). \end{equation*}
Thus, the amount left of the element at time $t$ is given by
\begin{equation*} y(t) = 10 e^{-t\ln(2)/6}. \end{equation*}