Linear Differential Equations

Exercise 1.6
1. Solve the following differential equations.

(a) $\ y^{\prime}\cos{x} - y\sin{x} + e^{x} = 0$
(b) $\ y^{\prime} + 2xy = 2x$
(c) $\ xy^{\prime} + y = x\sin{x}$
(d) $\ xy^{\prime} + (1 + x)y = e^{-x}\sin{2x}$
2. Solve the following initial value problems.
(a) $ y^{\prime} + (\cos{x})y = e^{- \sin{x}},  y(0) = 2$
(b) $ (x\log{x})y^{\prime} - y = \log{x},  y(e) = -1$
(c) $ y^{\prime} + y = f(x),  y(0) = 0,  f(x) = \left\{\begin{array}{ll}
1, & 0 \leq x < 1\\
0, & x \geq 1
\end{array} \right. $
(d) $ y^{\prime} + (\tan{x})y = \cos^{2}{x},  y(0) = -1$
3. Given RL circuit with $i(0) = 0$.

$\displaystyle R = 10\Omega, E = 20V, L = \left\{\begin{array}{rl}
5-t,& 0 \leq t\leq 5\\
0,& 5 \leq t
\end{array} \right.$

Find i(t).

1. (a) This is a linear diffenretial equation. Now write this in the standard form.

$\displaystyle y^{\prime} - \frac{\sin{x}}{\cos{x}} y = - \frac{e^{x}}{\cos{x}} $

Now the integrating factor $\mu$ is given by

$\displaystyle \mu = \exp( -\int \frac{\sin{x}}{\cos{x}}dx) = \exp(\log{\cos{x}}) = \cos{x} $

Multiply $\mu$ to the standard form. Then

$\displaystyle \cos{x}y^{\prime} - \sin{x} y = - e^{x} $

Now the left-hand side is the derivative of the $\mu$ times the dependent variable $y$. Then

$\displaystyle (\cos{x} y)^{\prime} = - e^{x} $

Integrate both sides by $x$.

$\displaystyle \cos{x} y = - \int e^{x} dx = - e^{x} + c $

Therefore, the integrating factor is

$\displaystyle y = \frac{c - e^{x}}{\cos{x}} \ \ $

(b) This equation is a linear differential equation. So, the integrating factor $\mu$ is given by

$\displaystyle \mu = \exp( \int 2x dx) = \exp(x^2) = e^{x^2} $

Multiply this to the standard form, we have

$\displaystyle e^{x^{2}}y^{\prime} + 2xe^{x^2}y = 2x e^{x^2} $

Now the left-hand side is the derivative of $\mu$ times $y$.

$\displaystyle (e^{x^2} y)^{\prime} = 2x e^{x^2} $

Integrate both sides with respect to $x$, we have

$\displaystyle e^{x^2} y = \int 2x e^{x^2} dx = e^{x^2} + c $

Therefore, the general solution is

$\displaystyle y = 1 + ce^{-x^2} \ \ $

(c) This equation is a linear differntial equation. So, write in the standard form. Then

$\displaystyle y^{\prime} + \frac{1}{x} y = \sin{x} $

The integrating factor $\mu$ is

$\displaystyle \mu = \exp( \int \frac{1}{x}dx) = \exp(\log{x}) = x $

Multiply $\mu$ to the standard form. Then we have

$\displaystyle xy^{\prime} + y = x \sin{x} $

Now the left-hand side is the derivative of $\mu$ times $y$.

$\displaystyle (x y)^{\prime} = x \sin{x} $

Integrate both sides with respect to $x$.
$\displaystyle x y$ $\displaystyle =$ $\displaystyle \int x \sin{x} dx \ \ \left(\begin{array}{cc}
u = x & dv = \sin{x}\\
du = dx & v = - \cos{x}
\end{array}\right)$  
  $\displaystyle =$ $\displaystyle - x\cos{x} + \int \cos{x} + c = - x \cos{x} + \sin{x} + c$  

Therefore, the general solution is

$\displaystyle y = \frac{- x \cos{x} + \sin{x} + c}{x} \ \ $

(d) This equation is a linear differential equation. Now write in the standard form. Then

$\displaystyle y^{\prime} + \frac{1 + x}{x} y = \frac{e^{-x}\sin{2x}}{x} $

Integrating factor $\mu$ is

$\displaystyle \mu = \exp( \int \frac{1 + x}{x}dx) = \exp(\int (1 + \frac{1}{x})dx) = \exp(x + \log{x}) = xe^{x} $

Multiply this to the standard form.

$\displaystyle xe^{x}y^{\prime} + e^{x}(1+x) y = \sin{2x} $

Then the left-hand side is the derivative of $\mu$ times $y$.

$\displaystyle (xe^{x}y)^{\prime} = \sin{2x} $

Integrate both sides with respect to $x$.

$\displaystyle xe^{x}y = - \frac{\cos{2x}}{2} + c $

Therefore, the general solution is

$\displaystyle y = \frac{ \cos{2 x} + c}{2xe^{x}} \ \ $

2. (a) This equation is a linear differential equation. The integrating factor $\mu$ is given by

$\displaystyle \mu = \exp( \int \cos{x} dx) = \exp(\sin{x}) = e^{\sin{x}} $

Multiply this to the standard form.

$\displaystyle e^{\sin{x}}y^{\prime} + e^{\sin{x}}\cos{x} y = 1 $

The left-hand side is the derivative of $\mu$ times $y$.

$\displaystyle (e^{\sin{x}}y)^{\prime} = 1 $

Integrate both sides with respect to $x$.

$\displaystyle e^{\sin{x}}y = x + c $

Thus, the general solution is

$\displaystyle y = (x + c) e^{- \sin{x}} $

Now by the initial condition $y(0) = 2$, we have $2 = c e^{0} = c$ and

$\displaystyle y = (x + 2) e^{- \sin{x}} \ \ $

(b) This equation is a linear differential equation. So, write in the standard form.

$\displaystyle y^{\prime} - \frac{1}{x\log{x}} y = \frac{1}{x} $

The integrating factor $\mu$ is

$\displaystyle \mu = \exp(- \int \frac{1}{x\log{x}} dx) = \exp( - \log(\log{x})) = \frac{1}{\log{x}} $

Multiply this to the standard form.

$\displaystyle \frac{1}{x\log{x}}y^{\prime} - \frac{1}{x(\log{x})^{2}} y = \frac{1}{x\log{x}} $

The left-hand side is the derivative of $\mu$ times $y$.

$\displaystyle (\frac{1}{\log{x}}y)^{\prime} = \frac{1}{x\log{x}} $

Integrate both sides by $x$. Then

$\displaystyle \frac{1}{\log{x}}y = \log(\log{x}) + c $

Therefore, the general solution is

$\displaystyle y = \log{x}(\log\log{x} + c) $

BY the initial value $y(e) = -1$, we have $-1 = \log{e}(\log{1} + c) = c$ and

$\displaystyle y = \log{x}(\log\log{x} - 1) \ \ $

(c) This equation is a linear differential equation. So, the integrating factor $\mu$ is given by

$\displaystyle \mu = \exp(\int 1 dx) = e^{x} $

Multiply this to the standard form.

$\displaystyle e^{x}y^{\prime} + e^{x} y = e^{x} f(x) $

Then the left-hand side is the derivative of $\mu$ times $y$.

$\displaystyle (e^{x} y)^{\prime} = e^{x} f(x) $

Integrate both sides by $x$, we have

$\displaystyle e^{x} y = \left\{\begin{array}{ll}
e^{x} + c_{1} & 0 \leq x < 1\\
c_{2} & x \geq 1
\end{array} \right. $

Therefore, the general solution is

$\displaystyle y = \left\{\begin{array}{ll}
1 + c_{1}e^{-x} & 0 \leq x < 1\\
c_{2}e^{-x} & x \geq 1
\end{array} \right. $

Now by the initial value $y(0) = 0$, we have $0 = 1 + c_{1} $ and $c_{1} = -1$.Thus, for $0 \leq x < 1$ $y = 1 - e^{-x}$. Note that the solution of this differential equation must be continuous. Then $y(1) = 1 - e^{-1}$ and $1 - e^{-1} = c_{2} e^{-1}$.Thus, $c_{2} = e - 1$. From this, we have

$\displaystyle y = \left\{\begin{array}{ll}
1 - e^{-x} & 0 \leq x < 1\\
(e - 1)e^{-x} & x \geq 1
\end{array} \right. \ \ \ $

(d) This equation is a linear differential equation. Then the integrating factor $\mu$ is

$\displaystyle \mu = \exp( \int \tan{x} dx) = \exp( \int \frac{\sin{x}}{\cos{x}}dx ) = \exp(-\log{\cos{x}}) = \frac{1}{\cos{x}} $

Now multiply $\mu$ to the standard form. Then

$\displaystyle \frac{1}{\cos{x}}y^{\prime} + \frac{\sin{x}}{\cos{x})^{2}} y = \cos{x} $

The left-hand side is the derivative of the product of $\mu$ and $y$.

$\displaystyle (\frac{1}{\cos{x}}y)^{\prime} = \cos{x} $

Integrate both sides by $x$.

$\displaystyle \frac{1}{\cos{x}}y = \sin{x} + c $

Therefore, the general solution is

$\displaystyle y = \cos{x}(\sin{x} + c) $

Now using initial condition $y(0) = -1$, we have $-1 = 1(0 + c) = c$ and

$\displaystyle y = \cos{x}(\sin{x} - 1) \ \ $

3. The differential equation for the current running through RL-circuit is

$\displaystyle L\frac{di}{dt} + Ri = E $

Then we have the standard form.

$\displaystyle \frac{di}{dt} + \frac{10}{5 - t}i = \frac{20}{5-t} , \ 0 \leq t \leq 5 $

It is a linear differential equation. So, we find the integrating factor.

$\displaystyle \mu = \exp(\frac{10}{5 - t} dt) = \exp(- 10 \log{5 - t}) = (\frac{1}{5 - t})^{10} $

Multiply this to the standard form.

$\displaystyle (\frac{1}{5 - t})^{10}\frac{di}{dt} + (\frac{1}{5 - t})^{10}\frac{10}{5 - t} i = 20(\frac{1}{5 - t})^{11} $

The left-hand side is the derivative of the product of $\mu$ and $i$.

$\displaystyle ((\frac{1}{5 - t})^{10}i)^{\prime} = 20({5 - t})^{-11} $

Integrate both sides with respect to $t$.

$\displaystyle (\frac{1}{5 - t})^{10}i = 2(\frac{1}{5 - t})^{10} + c $

Then the general solution is

$\displaystyle i = 2 + c(5 - t)^{10} $

Now we use the initial condition $i(0) = 0$. Then we have $0 = 2 + c 5^{10}$ and $c = -2/5^{10}$. Therefore,

$\displaystyle i(t) = 2 - \frac{2}{5^{10}}(5 -t)^{10} $

Next we consider the case $t \geq 5$. Since $L = 0$, the differential equation for the current running through RL-circuit is $R i = E$ and $i = 20/10 = 2$