\documentclass[12pt]{article}
\usepackage{amssymb,amsfonts,dsfont}


%\documentstyle[amsfonts,amssymb,12pt]{article}

\begin{document}


\def\b{\bigskip}
\def\d#1#2{ \frac{d #1}{d #2}}
\def\dn#1#2#3{\frac{d^{#3}{#1}}{d #2^{#3}}}
\def\dd#1#2{\dn{#1}{#2}{2}}

\setcounter{page}{28}

\centerline{{\sc Euler's method}}

\b

Often it is not possible to find a solution $y = \phi(x)$ to an initial value problem $\d{y}{x} = f(x,y)$, $\phi(x_0) = y_0$. In these cases, there are various ways of approximating a solution. This can mean that we can find an approximate value for $\phi(a)$ for some number $a$, or that we can find a function $y = \psi(x)$ which is close to $\phi(x)$, at least for values of $x$ which are close to $x_0$.  One such method is called \textit{Euler's method}.
To see how this works, let's suppose we want to find an approximate solution to the initial value problem $\d{y}{x} = f(x,y)$, $y(x_0) = y_0$, where the ODE $\d{y}{x} = f(x,y)$ has the direction field pictured below.

\begin{picture}(170,190)
\put(45,75){\vector(1,0){140}}
\put(100,20){\vector(0,1){120}}
\multiput(45,85)(10,0){12}{\line(1,0){7}}
\multiput(45,74)(10,0){12}{\line(5,-1){11}}
\multiput(45,64)(10,0){12}{\line(4,-1){11}}
\multiput(45,94)(10,0){12}{\line(5,1){11}}
\multiput(45,104)(10,0){12}{\line(4,1){11}}
\multiput(45,114)(10,0){12}{\line(3,1){11}}
\put(110,95){\circle*{3}}
\end{picture}

The dot is the point $(x_0,y_0)$.  Suppose we want to estimate the value  $\phi(a)$ of a solution $y = \phi(x)$ at some point $x = a$.  One thing we know about this solution is that $\phi(x_0) = y_0$, but we want $\phi(a)$ for some $a$ which might be larger (or smaller) than $x_0$.	

First we choose a (small) number $h$. The number $h$ is called the \textit{step size}.	Let's suppose for convenience that the number $a$ is $x_0 + nh$ for some positive integer $n$. Note that, since the tangent line approximates the function near $x = x_0$, $\phi(x_0 + h)$ is approximately the $y$-value of the point on the tangent line corresponding to $x = x_0 + h$. Let $x_1 = x_0 + h$ and let $y_1$ be the corresponding point on the tangent line.  Since the tangent line at $(x_0,y_0)$ has slope $f(x_0,y_0)$, the equation of the tangent line at $(x_0,y_0)$ is $y = y_0 + f(x_0,y_0)(x - x_0)$, so $y_1 = y_0 + f(x_0,y_0)(x_1 - x_0) = y_0 + f(x_0,y_0)h$.

What we have so far is that $y_1 \approx \phi(x_1)$, but $x_1$ is not necessarily $a$. We want to repeat the process replacing $x_0$ with $x_1$.	 However, we can't quite do that because we don't know what $\phi(x_1)$ is.	 However, we do know that $\phi(x_1)$ is \textit{approximately} $y_1$, so we use $f(x_1,y_1)$ (instead of $f(x_1,\phi(x_1))$) to repeat the process.	 We let $x_2 = x_1 + h$, and let $y_2$ be the corresponding point on the tangent line.	 The slope of the tangent line to a solution at $x_1$ is approximately $f(x_1,y_1)$, and repeating the process from before, we get that $y_2 = y_1 + f(x_1,y_1)h$.  In general, we get $$x_{k+1} = x_k + h = x_0 + kh$$ and	 $$y_{k+1} = y_k + f(x_k,y_k)h.$$ Now we repeat this process until we get to $x_k = a = x_0 + nh$.

If instead of approximating the value of $\phi(a)$ for a particular $a$ of the form $x_0 + nh$ we want an approximation to the function $\phi(x)$ for all $x$ near $x_0$, we connect the points $(x_k,y_k)$ by segments to get a piecewise linear function.  (On the segment $[x_k,x_{k+1}]$ the equation will be $y = y_k + \left( \frac{y_{k+1} - y_k}{h} \right)(x - x_k) $.)


\begin{picture}(170,190)
\put(45,75){\vector(1,0){140}}
\put(100,20){\vector(0,1){120}}
\multiput(45,85)(10,0){12}{\line(1,0){7}}
\multiput(45,74)(10,0){12}{\line(5,-1){11}}
\multiput(45,64)(10,0){12}{\line(4,-1){11}}
\multiput(45,94)(10,0){12}{\line(5,1){11}}
\multiput(45,104)(10,0){12}{\line(4,1){11}}
\multiput(45,114)(10,0){12}{\line(3,1){11}}
\put(110,95){\circle*{3}}
\put(110,95){\line(5,1){15}}
\put(125,99){\circle*{3}}
\put(125,99){\line(4,1){15}}
\end{picture}

\b

When approximating $\phi(x_0 + nh)$, we find $y_n$.	 For example, if $x_0 = 3$, $h = .2$, and we want to approximate $\phi(3.14)$, then we are looking for $y_7$ because $3.14 = 3 + 7(.2) = 3 + 7h$.

\b

In general, the smaller the step size, the better the approximation will be.  Also, it is possible to modify what we did to use different step sizes for the same problem.

\b

\textbf{Example.} Find an approximate value for $\phi(2.4)$ where $y = \phi(x)$ is a solution of the initial value problem $\d{y}{x} = x^2 + y^2$, $y(2) = 0$.

\b

(Note that we have no way of solving this ODE.)	 What we call $(x_0,y_0)$ is $(2,0)$, and what we call $f(x,y)$ is $x^2 + y^2$.	We take the step size $h = .1$.  (We could use, for example, $h = .2$, but then we would get a less accurate approximation.	 We could take $h = .01$, and we would get a better approximation, but that would be more work.)  Then $y_1$ approximates $\phi(x_0 + h) = \phi(2.1)$.	$y_2$approximates $\phi(x_1 + h) = \phi(2.2)$, and so on.  Therefore, the approximation we want is $y_4$.	

\b

$$y_1 = y_0 + f(x_0,y_0)h = 0 + f(2,0)(.1) = 4(.1) = .4.$$

$x_1 = 2.1$, so
$$y_2 = y_1 + f(x_1,y_1)h = .4 + f(2.1,.4)(.1) = .857.$$

$x_2 = 2.2$, so
$$y_3 = y_2 + f(x_2,y_2)h = .857+ f(2.2,.857)(.1) = 1.414449.$$


$x_3 = 2.3$, so
$$y_4 = y_3 + f(x_3,y_3)h = 1.414449 + f(2.3,1.414449)(.1) = 2.143515597.$$


\b

Therefore, $\phi(2.4) \approx 2.143510466.$


\b

In MAPLE, we can do the following:

\b
\noindent with(DEtoools);\\
phi:=dsolve($\{ \mbox{diff}(y(x),x) = x^2+y(x)^2,y(2)=0\}$,numeric,method = classical[foreuler],y(x),stepsize=.1);


\noindent phi(2.4);

\b

(We call this ``phi'' but we could use any name we want.)
\b

\{ Page 109 \hspace{1in} 1-4, 15, 16 \\

\pagebreak

\centerline{{\sc Second order homogeneous linear equations with constant coefficients}}

\b

A second order linear ODE has the form $$R(X)\dn{y}{x}{2} + P(x)\d{y}{x} + Q(x)y = G(x).$$	 If we can divide by $R(X)$, and let $p(x) = \frac{P(x)}{R(x)}$, $q(x) = \frac{Q(x)}{R(x)}$, and $g(x) = \frac{G(x)}{R(x)}$, this equation becomes
$$\dn{y}{x}{2} + p(x)\d{y}{x} + q(x)y = g(x).$$	   Sometimes we can solve these ODEs using the methods that we already have.

\b

\textbf{Examples.}

\begin{enumerate}

\item Solve the ODE $\dd{y}{t} +  \d{y}{t} = 2t$.

\b

We can let $x = \d{y}{t}$.	Then the ODE becomes $\d{x}{t} + x = 2t$. We can solve this by multiplying by the integrating factor $\mu(t) = e^{\int 1 dt} = e^{t}$, to get $\d{e^{t}x} = 2te^{t}$.  Integrating gives $e^tx = \int 2te^t dt = 2te^t - 2e^t + C_1$, so $x = 2t - 2 + C_1e^{-t}$.  But remember that we want $y$ where $\d{y}{t} = x$, so we get $\d{y}{t} = 2t - 2 + C_1e^{-t}$.	 Integrating gives $y = t^2 - 2t - C_1e^{-t} + C_2$.

\item Solve the initial value problem $\dd{y}{t} +	\d{y}{t} = 2t$, $y(0) = 1$, $y'(0) = 2$.

    \b

Notice that there are two initial conditions, one for $y$ and one for the derivative $y'$.  That is because we are going to have to find two constants.	We saw in the previous example that	 $y = t^2 - 2t - C_1e^{-t} + C_2$.	 Since $y(0) = 1$, we get $$-C_1 + C_2 = 1.$$  $y' = 2t - 2 + C_1e^{-t}$, and since $y'(0) = 2$, we get $$-2 + C_1 = 2.$$	 Therefore, $C_1 = 4$, so $C_2 = 5$.  This gives the solution $$y = t^2 - 2t - 4e^{-t} + 5.$$



\end{enumerate}


What we have done here is a special case.  There are certain cases that arise frequently that we can handle.

\b

If $g(x) = 0$, the ODE $\dn{y}{x}{2} + p(x)\d{y}{x} + q(x)y = g(x)$ is homogeneous, and the equation becomes $$\dn{y}{x}{2} + p(x)\d{y}{x} + q(x)y = 0.$$  More generally, if $G(x) = 0$, the ODE $R(X)\dn{y}{x}{2} + P(x)\d{y}{x} + Q(x)y = G(x)$ is homogeneous.  We will look now at the homogeneous case where each of the functions $R$, $P$, and $Q$ is a constant.	If $R = 0$, we have a first order equation.  Therefore, we can assume that $R \ne 0$, in which case we can divide by $R$ to get $$\dn{y}{x}{2} + p(x)\d{y}{x} + q(x)y = 0.$$  Since $p(x)$ and $q(x)$ are constant, we can write this as $$\dn{y}{x}{2} + b\d{y}{x} + cy = 0.$$	 We will look at ODEs of this form.	 Therefore, we will be looking at ODEs like $\dd{y}{x} + 3 \d{y}{x} -4y = 0$, or $\dd{y}{x} + 5 \d{y}{x} + 6y = 0$.

\b

To see how to handle something like this, let's see what happens when we look at the analogous first order ODEs.	The analog there is $\d{y}{x} + by = 0$, or $\d{y}{x} = -by$.  We know that the solution of something like this is $y = Ce^{-bx}$, that is, it is an exponential function.	So for the ODE $\dn{y}{x}{2} + b\d{y}{x} + cy = 0$ we will look for a solution which is an exponential function, say $y = e^{rx}$. The question is, what should $r$ be.

\b

\textbf{Example.} Find functions $y = e^{rx}$ which are solutions of the ODE  $\dd{y}{x} + 3 \d{y}{x} -4y = 0$.

\b

If $y = e^{rx}$ satisfies the ODE, then substituting in the equation gives $$r^2 e^{rx} + 3r e^{rx} - 4e^{rx} = 0,$$ and dividing by $e^{rx}$ gives $$r^2 + 3r - 4 = 0.$$ Since $r^2 + 3r - 4 = (r+4)(r-1)$, we get that there are two possibilities for $r$, namely, $r = -4$ and $r = 1$.  (If the polynomial did not factor, we could use the quadratic formula.)  Therefore, we get solutions $y_1 = e^{-4x}$ and $y_2 = e^x$.  We can check that either of these is a solution.  Furthermore, if we multiply either of these by a constant, we get a solution, and if we add any two of these solutions, we get a solution.	 Therefore, any function of the form $y = C_1 e^{-4x} + C_2 e^x$ is a solution. In fact, these are the only solutions.	

\b

This example generalizes.

\b

\textbf{Definition.} The equation $r^2 + br + c = 0$ is called the \textit{characteristic equation} of the ODE $\dn{y}{x}{2} + b\d{y}{x} + cy = 0$.	 (Here it is important that $b$ and $c$ are numbers. The polynomial $r^2 + br + c$ is called the \textit{characteristic polynomial} of the ODE

\b

\textbf{Example.} The characteristic equation of the ODE $\dn{y}{x}{2} + 7\d{y}{x} + 4y = 0$ is $r^2 + 7r + 4 = 0$.

\b

\textbf{Theorem.} Suppose that the characteristic equation $r^2 + br + c = 0$ of the ODE $\dn{y}{x}{2} + b\d{y}{x} + cy = 0$ has distinct real solutions $r_1$ and $r_2$.  (In other words, $r_1 \ne r_2$ and each of these is a real number.)  Then every function of the form $y = C_1 e^{r_1} + C_2 e^{r_2}$ is a solution of the ODE, and every solution has this form.	

\b

$y = C_1 e^{r_1} + C_2 e^{r_2}$ is called the \textit{general solution} of the ODE.  If $C_1$ and $C_2$ are replaced by numbers, we get a \textit{particular solution}. To find a particular solution, we need to be given two initial conditions.

\b

\textbf{Example.} Solve the initial value problem $\dd{x}{t} - 5 \d{x}{t} + 6x = 0$, $x(0) = 2$, $x'(0) = 1$.

\b

The characteristic equation is $r^2 - 5r + 6 = 0$, which has solutions $r = 2$ and $r = 3$.  Therefore, the general solutio of the ODE is $x = C_1e^{2t} + C_2 e^{3t}$.  Since $x(0) = 2$, $$C_1 + C_2 = 2.$$	$\d{x}{t} = 2C_1e^{2t} + 3C_2 e^{3t}$, and since $x'(0) = 1$, $$2C_1 + 3C_2 = 1.$$
Solving for $C_1$ and $C_2$ gives $C_1 = 5$ and $C_2 = -3$.	 This gives the solution $x = 5e^{2t} -3 e^{3t}$.

\b

Note that if the coefficient of $\dd{y}{x}$ is some non-zero constant, we can divide to get the equation in the correct form.



\b

\textbf{Example.} Find the general solution of the ODE $4\dd{y}{x} - y = 0$.

\b

Dividing by $4$ gives $\dd{y}{x} - ( \frac{1}{4}) y = 0$.  The characteristic equation is $r^2 - \frac{1}{4} = 0$, or $4r^2 - 1 = 0$.	 This has solutions $r = \pm(\frac{1}{2})$.  Therefore, the general solution is $y = C_1 e^{ (\frac{1}{2})} + C_2 e^{ -(\frac{1}{2})}$.

\b

\{ Page 144 \hspace{1in} 1-6, 9-13 \\

\pagebreak

\centerline{{\sc The Wronskian}}



\b


In dealing with second-order ODEs, we want to know that we are finding all solutions.	The following theorem on existence and uniqueness will give us that information.

\b


\textbf{Theorem.} (Existence and Uniqueness of Solutions) Suppose that $p(x)$, $q(x)$, and $h(x)$ are continuous functions defined on an open interval containing $x_0$.	 Then the initial value problem $\dd{y}{x} + p(x)\d{y}{x} + q(x)y = h(x)$, $y(x_0) = y_0$, $y'(x_0) = y_0'$ has a unique solution.

\b

\textbf{Example.} The function $y = x^3 + x$ is a solution of the initial value problem $\dd{y}{x}+2x\d{y}{x} - 6y = 2x$, $y(1) = 2$, $y'(1) = 4$.	The theorem says that this is the only solution.


\b




The next theorem says that the sum of two solutions of a homogeneous second-order linear ODE is again a solution.  We will generalize this later.

\b

\textbf{Superposition principle.}  Suppose that $y_1$ and $y_2$ are solutions of the ODE $\dd{y}{x}+p(x)\d{y}{x} - q(x)y = 0$.	 Then for any constants $C_1$ and $C_2$, the function $C_1y_1 + C_2y_2$ is also a solution.

\b

\textbf{Example.} Both of the functions $y = \cos x$ and $y = \sin x$ are solutions of the ODE $\dd{y}{x} + y = 0$.  It follows from the Superpositon Principle that $y = \cos x + \sin x$ is also solution.	Another solution is $y = 3 \cos x - 2 \sin x$.	 We get many solutions in this way.

\b

The next goal is to try to find functions $y_1$ and $y_2$ so that the expression $C_1y_1 + C_2y_2$ gives all solutions of the ODE.

\b

Two functions $f$ and $g$ are said to be \textit{linearly independent} on an interval $I$ the only way that $af(x) + bg(x)$ can be $0$ for all  $x \in I$, where $a$ and $b$ are constants, is if $a = b = 0$.	 Otherwise, $f$ and $g$ are \textit{linearly dependent} on $I$.

\b

It can be shown that $f$ and $g$ are linearly independent on $I$ if and only if neither function is a constant multiple of the other.

\pagebreak

\textbf{Examples.}

\begin{enumerate}


\item The functions $f(x) = e^x$ and $g(x) = e^{2x}$ are linearly independent on $(-\infty, \infty)$.	 To see this, suppose that $ae^x + be^{2x} = 0$ for all $x$.  Then, taking the derivative gives that $ae^x + 2be^{2x} = 0$ for all $x$.  In particular, letting $x = 0$ gives
    \begin{eqnarray*}
    a + b & = & 0\\
    a + 2b & = & 0\\
    \end{eqnarray*}


The only solution of this system of equations is $a = b = 0$.

\b

Notice the use of the derivative in this example.


\item The functions $f(x) = \sin x \cos x$ and $g(x) = \sin (2x)$ are linearly dependent on any interval $I$.	 The reason is that $\sin (2x) = 2 \sin x \cos x$ so $g(x) = 2 f(x)$.	 Therefore, $2 f(x) + (-1) g(x) = 0$, even though the coefficients are not all $0$.	

\end{enumerate}


Note that if $f(x) = 0$, then for any choice of $g(x)$, $f$ and $g$ are linearly dependent, because $1 \cdot f(x) + 0 \cdot g(x) = 0$ even though not both coefficients are $0$.	Alternatively, $f(x)$ is a number times $g(x)$, the number being $0$.



\b

\textbf{Theorem.}  Suppose that $p(x)$ and $q(x)$ are continuous functions.	 Let $y_1(x)$ and $y_2(x)$ be linearly independent solutions of the ODE $\dd{y}{x} + p(x) \d{y}{x} + q(x) y = 0$.  Then every solution of the ODE has the form $y = C_1 y_1 + C_2 y_2$, where $C_1$ and $C_2$ are constants.	

\b

Note that it is important that $y_1$ and $y_2$ are linearly independent.

\b

If $y_1$ and $y_2$ are linearly independent solutions of the ODE $\dd{y}{x} + p(x) \d{y}{x} + q(x) y = 0$, then $\{y_1, y_2\}$ is called a \textit{fundamental set of solutions}, and $y = C_1 y_1 + C_2 y_2$ is called the \textit{general solution} of the ODE.

\b

It is possible to show that there is always a fundamental set of solutions for the ODE $\dd{y}{x} + p(x) \d{y}{x} + q(x) y = 0$, where $p$ and $q$ are continuous.	 Specifically, we know by the existence theorem that the solutions of the initial value problem $\dd{y}{x} + p(x) \d{y}{x} + q(x) y = 0$, $y(x_0) = 0$, $y'(x_0) = 1$, has a solution $y_1$, and the initial value problem $\dd{y}{x} + p(x) \d{y}{x} + q(x) y = 0$, $y(x_0) = 1$, $y'(x_0) = 0$, has a solution $y_2$.	 It can be shown that $y_1$ and $y_2$ are linearly independent.


\b

We want to find a fundamental set of solutions	$\{y_1, y_2\}$ for the ODE $\dd{y}{x} + p(x) \d{y}{x} + q(x) y = 0$, so we want to find functions $y_1$ and $y_2$ that satisfy the ODE an which have the property that the only way $ay_1(x) + by_2(x)$ can be $0$ is if $a = b = 0$.  We won't find the functions now, but will concentrate on determining when functions are linearly independent.

\b

We will use a fact from algebra.  The system $$\left\{ \begin{array}{c} ax + by = 0 \\ cx + dy = 0
\end{array} \right.$$ always has a solution, namely, $x = y = 0$.  This will be the only solution if and only if the determinant $ \left| \begin{array}{cc} a & b \\ c & d
\end{array}\right| = ad - bc \ne 0$.

\b

Given functions $y_1(x)$ and $y_2(x)$, we want to see when there are numbers $a$ and $b$ not both $0$ such that $$ay_1(x) + by_2(x) = 0$$ for all $x$ in some open interval $I$.	 Suppose that $a$ and $b$ do satisfy this equation in an interval.  Then taking derivatives, we get $$ay_1'(x) + by_2'(x) = 0.$$	We want to see if the only numbers that satisfy both of these equations are $a = b = 0$.  By the algebra fact, this will happen if and only if $y_1 y2' - y_1'y_2 \ne 0$. This leads to a definition.

\b


\textbf{Definition.} Suppose that $y_1$ and $y_2$ are differentiable functions defined on an open interval $I$.  The \textit{Wronskian} of $y_1$, $y_2$, denoted $W(y_1,y_2)(x)$ is given by $$W(y_1,y_2)(x) =  \left| \begin{array}{cc} y_1(x) & y_2(x) \\ y_1'(x) & y_2'(x)
\end{array}\right| .$$

\b


\textbf{Example.} If $f(x) = x^3$ and $g(x) = e^{4x}$, then $W(f,g)(x) = \left| \begin{array}{cc} x^3 & e^{4x} \\ 3x^2 & 4e^{4x}
\end{array}\right|	= 4x^3e^{4x}-3x^2e^{4x}$.

\b

\textbf{Fact.} If $f$ and $g$ are functions defined on an interval $I$ and if $W(f,g)(x) \ne 0$ for any $x \in I$, then $f$ and $g$ are linearly independent on $I$.	

\b

\textbf{Note.} This fact says nothing in the case the $W(f,g)(x) = 0$ for some $x \in I$.	It is possible that $W(f,g)(x) = 0$ for some $x \in I$ even if the functions are linearly independent on $I$.

\b

Now we combine what we have.

\b

\textbf{Theorem.}  Suppose that $y_1$ and $y_2$ are solutions of the ODE $\dd{y}{x} + p(x) \d{y}{x} + q(x) y = 0$ on an interval $I$ containing $x_0$.  Then every initial value problem $\dd{y}{x} + p(x) \d{y}{x} + q(x) y = 0$, $y(x_0) = y_0$, $y'(x_0) = y_0$ has a solution of the form $y = C_1y_1 + C_2y_2$ if and only if $W(y_1,y_2)(x_0) \ne 0$.

\b


%\pagebreak

\textbf{Example.} The functions $y_1(x) = x$ and $y_2(x) = \frac{1}{x}$ are solutions of the ODE $\dd{y}{x} + \left( \frac{1}{x} \right)\d{y}{x} - \left( \frac{1}{x^2} \right)y = 0$ on the interval $(0,\infty)$. Find the solution of the initial value problem $\dd{y}{x} + \left( \frac{1}{x} \right)\d{y}{x} - \left( \frac{1}{x^2} \right)y = 0$, $y(1) = 0$, $y'(1) = 6$.

\b

$W(y_1,y_2)(x)	= \left| \begin{array}{cc} x & \frac{1}{x} \\ 1 & \frac{-1}{x^2}
\end{array}\right| = \frac{-2}{x}$, so $W(y_1,y_2)(1) = -2 \ne 0$.	By the theorem, there is a solution of the initial value problem of the form $y = C_1x + C_2( \frac{1}{x})$, and we only have to find $C_1$ and $C_2$.	Since $y(1) = 0$, $$C_1 + C_2 = 0.$$	$\d{y}{x} = C_1 - \frac{C_2}{x^2}$, and since $y'(1) = 6$, $$C_1 - C_2 = 6.$$	 Solving gives $C_1 = 3$ and $C_2 = -3$.	 Therefore, the solution is $$y = 3x - \frac{3}{x} .$$



\b

It is possible that two functions $y = y_1(x)$ and $y = y_2(x)$ are linearly independent on an interval $I$ even though the Wronskian $W(y_1,y_2)(x_0)$ is $0$ for some $x_0 \in I$.  For example, if $y_1(x) = x^2$ and $y_2 = x^3$, then $y_1$ and $y_2$ are linearly independent on the interval $(-\infty, \infty)$, but $W(y_1,y_2)(x) = x^4$, which is $0$ if $x = 0$.	 However, this cannot happen if $y_1$ and $y_2$ are solutions of an ODE $\dd{y}{x} + p(x) \d{y}{x} + q(x) y = 0$, where $p$ and $q$ are continuous.

\b

\textbf{Theorem.} (Abel)  Suppose that $p$ and $q$ are continuous $y_1$ and $y_2$ are solutions of the ODE $\dd{y}{x} + p(x) \d{y}{x} + q(x) y = 0$ on an interval $I$.  Then $W(y_1,y_2)(x) = -Ce^{\int p(x) dx}$, where $C$ is a constant depending on $y_1$ and $y_2$, but not on $x$.	In particular, if $C = 0$, $y_1$ and $y_2$ are linearly dependent on $I$, and if $C \ne 0$, then $\{y_1,y_2\}$ is a fundamental set of solutions on $I$.	 Furthermore, either $W(y_1,y_2)(x) = 0$ for all $x \in I$, or $W(y_1,y_2)(x) \ne 0$ for all $x \in I$.

\b

\{ Page 155 \hspace{1in} 1-6, 13, 17, 21, 24, 25 \\

\pagebreak

\centerline{{\sc Complex roots}}



\b

We have seen that if the characteristic polynomial $r^2 + ar + b$ of the ODE $\dd{y}{x} + a \d{y}{x} + by = 0$ has two distinct real roots, say $r_1$ and $r_2$ then the general solution of the ODE is $y = C_1 e^{r_1t} + C_2 e^{r_2t}$.	The next question we deal with is what happens if the characteristic equation has complex roots.	Then the roots are complex conjugates, $r_1 = \alpha + i \beta$ and $r_2 = \alpha - i \beta$.	It is reasonable to guess that in this case the general solution would be $y = C_1 e^{r_1x} + C_2 e^{r_2x}$, or $y = C_1e^{(\alpha + i \beta)x} + C_2e^{(\alpha - i \beta)x} = C_1 e^{\alpha x} e^{i\beta x} + C_2e^{\alpha x} e^{-i\beta x}$.  The question is, ``What does it mean to raise $e$ to an imaginary power?''


\b

To answer this, let's recall the fact that the initial value problem $\d{y}{x} = ky$, $y(0) = 1$, where $k$ is a constant, has \textit{a unique} solution, namely, $y = e^{kx}$.  In particular, the only solution of $\d{y}{x} = iy$, $y(0) = 1$ is $y = e^{ix}$. But notice that if $y = \cos x +i \sin x$, then $\d{y}{x} = - \sin x + i \cos x = i^2 \sin x + i \cos x = i (\cos x +i \sin x) = iy$, and $y(0) = 1$.	Therefore, $e^{ix} = \cos x +i \sin x$.	 We state this formally.

\b

\textbf{Euler's Formula.} If $\theta$ is a real number, then $e^{i\theta} = \cos \theta + i \sin \theta$.


\b

\textbf{Notes.}

\begin{enumerate}

\item This formula gives that $e^{-i\theta} = \cos \theta - i \sin \theta$.	

\item Adding this formula to Euler's formula gives $$\cos \theta =	 \frac{e^{i\theta} + e^{-i\theta}}{2}.$$

\item Subtracting this formula from Euler's formula gives $$\sin \theta =  \frac{e^{i\theta} - e^{-i\theta}}{2i}.$$

\item Recall that the hyperbolic cosine and hyperbolic sine are defined by $$\cosh \theta = \frac{e^{\theta} + e^{-\theta}}{2},$$ and
    $$\sinh \theta = \frac{e^{\theta} - e^{-\theta}}{2}.$$

\end{enumerate}

\b

Now suppose that we have an ODE $\dd{y}{x} + a \d{y}{x} + by = 0$ whose characteristic polynomial has complex conjugate roots $\alpha \pm i \beta$.	 As we saw before, the general solution should be $y = K_1 e^{\alpha x} e^{i\beta x} + K_2e^{\alpha x} e^{-i\beta x}$, where $K_1$ and $K_2$ are constants.  By Euler's formula, this can be written as $y = K_1e^{\alpha x} \cos (\beta x) + K_1e^{\alpha x} i \sin (\beta x) + K_2e^{\alpha x} \cos (\beta x) - K_2e^{\alpha x} i \sin (\beta x) = e^{\alpha x}(C_1 \cos (\beta x) + C_2 \sin (\beta x))$, where $C_1 = K_1 + K_2$ and $C_2 = K_1 - iK_2$ are constants.	We summarize.	It is straightforward to check that any function of this form is a solution.

\b

\textbf{Theorem.} Suppose that characteristic polynomial $r^2 + ar + b$ of the ODE $\dd{y}{x} + a \d{y}{x} + by = 0$ has complex conjugate roots $\alpha \pm i \beta$, where $\alpha$ and $\beta$ are real numbers, $\beta \ne 0$.	 Then the general solution of the ODE is $$y = e^{\alpha x}(C_1 \cos (\beta x) + C_2 \sin (\beta x)).$$


\b




\textbf{Examples.}

\begin{enumerate}

\item Find the general solution of the ODE $\dd{y}{x} +6\d{y}{x} + 13 y = 0$.

\b

The characteristic polynomial is $r^2 - 6r + 13$.  By the quadratic formula, the roots	of this polynomial are $r = \frac{6 \pm	 \sqrt{36 - 52} }{2} = 3 \pm 2i$.  By the theorem, the general solution of the ODE is $y = e^{3x}(C_1 \cos (2x) + C_2 \sin(2x))$.

\b

We can check that this is a solution.


\item Solve the initial value problems $\dd{y}{x} - y = 0$, $y(0) = 1$, $y'(0) = 0$, and $\dd{y}{x} + y = 0$, $y(0) = 1$, $y'(0) = 0$.

    \b

$\dd{y}{x} - y = 0$, $y(0) = 1$, $y'(0) = 1$: Here the characteristic polynomial is $r^2 - 1$, which has (distinct) real roots $\pm 1$, so the general solution of the ODE is $y = C_1 e^x + C_2 e^{-x}$.	Since $y(0) = 1$, we get $$C_1 + C_2 = 1.$$  $y' = C_1 e^x - C_2e^{-x}$, and since $y'(0) = 0$, we get $$C_1 - C_2 = 0.$$	 Solving this system gives $C_1 = C_2 = \frac{1}{2}$, so the solution is $$y = (\frac{1}{2})e^x + (\frac{1}{2})e^{-x} = \cosh x.$$



\b

$\dd{y}{x} + y = 0$, $y(0) = 1$, $y'(0) = 1$: Here the characteristic polynomial is $r^2 + 1$, which has complex roots $\pm i (= 0 \pm i)$, so the general solution of the ODE is $y = C_1 \cos x + C_2 \sin x$.  Since $y(0) = 1$, $C_1 = 1$.	$y' = -C_1 \sin x + C_2 \cos x$, and since $y'(0) = 0$, $C_2 = 0$.	 Therefore, we get the solution $$y = \cos x.$$

\end{enumerate}


\b

\{ Page 163 \hspace{1in} 1, 3, 5, 7-12, 17-20 \\

\pagebreak

\centerline{{\sc Repeated roots}}



\b



So far we have seen how to solve the ODE $\dd{y}{x} + b \d{y}{x} + cy = 0$ in the cases where the characteristic polynomial $r^2 + br + c$ has distinct roots, either real or complex.	The remaining possibility is that the characteristic polynomial has only one real root.  That situation arises when the characteristic polynomial has the form $r^2 - 2ar + a^2 = (r - a)^2$, in which case the only root is $r = a$.  This is the characteristic polynomial for the ODE	 $\dd{y}{x} -2a \d{y}{x} + a^2y = 0$.  In this case, we get the solution $y = e^{ax}$, but we need another solution which, along with this function, forms a fundamental set of solutions.

\b

To come up with another function, notice that not only is $y = e^{ax}$ a solution, but so is $y = Ce^{ax}$ for any constant $C$.	 We ask ourselves if it is possibly that there is a solution of the form $y = Ce^{ax}$ where $C$ is not a constant, but rather a function of $x$.  In other words, we look for a solution of the form $y = h(x)e^{ax}$.	Our goal, then, is to find a function $h(x)$ such that the function $y = h(x)e^{ax}$ is a solution of the ODE $\dd{y}{x} -2a \d{y}{x} + a^2y = 0$.

\b

Suppose $y = h(x)e^{ax}$.  Then $$\d{y}{x} = h'(x)e^{ax} + ah(x)e^{ax},$$ and
\begin{eqnarray*}
\dd{y}{x} & = & h''(x)e^{ax} + ah'(x) + ah'(x)e^{ax} + a^2h(x)e^{ax}\\ \ & = & h''(x)e^{ax} + 2ah'(x)e^{ax} + a^2h(x)e^{ax}.
\end{eqnarray*}

\b

Since we want $y$ to be a solution of the ODE $\dd{y}{x} -2a \d{y}{x} + a^2y = 0$, we want $$h''(x)e^{ax} + 2ah'(x)e^{ax} + a^2h(x)e^{ax} - 2a(h'(x)e^{ax} + ah(x)e^{ax}) + a^2h(x)e^{ax} = 0,$$ and simplifying gives $$h''(x) = 0.$$ By integrating twice, we get $$h(x) = K_1x + K_2$$ for constants $K_1$ and $K_2$.	 Taking $K_1 = 1$ and $K_2 = 0$ gives $h(x) = x$, so we get that another solution is $$y = xe^{ax}.$$	 We can check that this is a solution.	 But we still have to check that the set $\{e^{ax},xe^{ax}\}$ is linearly independent.	 For that we compute the Wronskian:
\begin{eqnarray*}
W(e^{ax},xe^{ax}) & = & \left| \begin{array}{cc} e^{ax} & xe^{ax} \\
                                                 ae^{ax} & e^{ax} + axe^{ax}
                               \end{array} \right|		 \\
\				  & = & e^{2ax} \ne 0.								
\end{eqnarray*}


Therefore, $\{ e^{ax}, xe^{ax}\}$ forms a fundamental set of solutions.	 We get the following.

\b

\textbf{Theorem.} Suppose that the characteristic polynomial $r^2 + br + c$ of the ODE $\dd{y}{x} + b\d{y}{x} + cy = 0$ has exactly one root, $r = a$.	 Then the general solution of the ODE is given by $$y = C_1e^{ax} + C_2xe^{ax}.$$

\b

\textbf{Examples.}


\begin{enumerate}


\item Find the general solution of the ODE $\dd{y}{x} - 6\d{y}{x} + 9y = 0$.	

\b	

Here the characteristic polynomial is $r^2 - 6r + 9 = (r - 3)^2$, so the only root is $r = 3$.  Therefore, the general solution of the ODE is $y = C_1e^{3x} + C_2xe^{3x}$.

\item Find the solution of the initial value problem $\dd{x}{t} + 8\d{x}{t} + 16x = 0$, $x(0) = 2$, $x'(0) = 1$.

\b

The characteristic polynomial is $r^2 + 8r + 16 = (r + 4)^2$, so the only root is $r = -4$.  Therefore, the general solution is $x(t) = C_1 e^{-4t} + C_2te^{-4t}$. Notice that $x'(t) = -4C_1e^{-4t} + C_2e^{-4t} - 4C_2te^{-4t}.$	Since $x(0) = 2$, $C_1(1) + 4C_2(0)(1) = 2$, so $C_1 = 2$.	 Since $x'(0) = 1$, $-4(C_1)(1)+C_2(1)-4(C_2)(0)(1) = 1$, so $-4C_1 + C_2 = 1$, and since $C_1 = 2$, we get $C_2 = 9$.	Therefore, we get the solution $$x(t) = 2e^{-4t} + 9te^{-4t}.$$  We can check that this works.

\b

Notice that we can gain a great deal of qualitative information from this solution.  For example, we can see that $x(t) \rightarrow 0$ as $t \rightarrow \infty$.  Also $x'(t) = -8e^{-4t} + 9e^{-4t} - 36te^{-4t} = e^{-4t}(1 - 36t)$.	Therefore, $x'(t) < 0$ if and only if $t > \frac{1}{36}$, so the solution of the initial value problem is decreasing for $t > \frac{1}{36}$.


\end{enumerate}



\b

The method we used to come up with a second solution of the ODE $\dd{y}{x} -2a \d{y}{x} + a^2y = 0$ was to start with one solution ($y_1 = e^{ax}$) and then look for another solution of the form $y_2 = h(x)y_1$.	This method can be used in other cases.

\b

\textbf{Example.} Find a fundamental set of solutions of the ODE $\dd{y}{x} + (\frac{1}{x})\d{y}{x} - (\frac{16}{x^2}) y = 0$, $x > 0$, given that one solution is $y_1 = \frac{1}{x^4}.$

\b

We look for a solution of the form $y = h(x)(\frac{1}{x^4}) = \frac{h(x)}{x^4}$.	Then $$\d{y}{x} = \frac{xh'(x) - 4h(x)}{x^5},$$ and $$\dd{y}{x} = \frac{x^2h''(x) - 8xh'(x) + 20h}{x^6}.$$	Since we want $y$ to satisfy the ODE, we want $$\frac{x^2h''(x) - 8xh'(x) + 20h}{x^6} + (\frac{1}{x})(\frac{xh'(x) - 4h(x)}{x^5}) - (\frac{16}{x^2})(h(x))(\frac{1}{x^4}) = 0.$$  This reduces to $$\frac{x^2h''(x) - 7xh'(x)}{x^6} = 0,$$ and since $x > 0$, this becomes $$xh''(x) - 7h'(x) = 0.$$  Now we let $g(x) = h'(x)$, so the ODE becomes $$xg'(x) - 7g(x) = 0,$$	 or $$\frac{g'(x)}{g(x)} = \frac{7}{x}.$$  Solving this we get $$g(x) = x^7,$$ and since $g(x) = h'(x)$, we get $$h(x) = \frac{x^8}{8}.$$	Therefore, we get the solution $y = h(x)y_1 = (\frac{x^8}{8})(\frac{1}{x^4}) = \frac{x^4}{8}$.  Since multiplying be a constant still gives a solution, we can take $$y_2 = x^4.$$ We can check that this is a solution, and the Wronskian $W(y_1,y_2) = \frac{8}{x} > 0$.  Therefore, $\{\frac{1}{x^4}, x^4\}$ forms a fundamental set of solutions, so the general solution of the ODE is $y = \frac{C_1}{x^4} + C_2x^4$.


\b

This method is called \textit{reduction of order} because we are trading a second-order ODE for a first-order ODE.

\b

\{ Page 171 \hspace{1in} 1-6, 11-14, 16, 23, 24 \\

\pagebreak

\centerline{{\sc Non-homogeneous ODEs}}



\b

We now work on solving a linear second-order ODE which might not be homogeneous.  Such an ODE has the form: $$\dd{y}{x} + p(x)\d{y}{x} + q(x)y = h(x).$$	 The key will be the following theorems.

\b

\textbf{Theorem.} (Superposition theorem) Suppose $G(x)$ is a solution of the ODE $\dd{y}{x} + p(x)\d{y}{x} + q(x)y = g(x)$ and $H(x)$ is a solution of the ODE $\dd{y}{x} + p(x)\d{y}{x} + q(x)y = h(x)$.	Then $G(x) + H(x)$ is a solution of the ODE $\dd{y}{x} + p(x)\d{y}{x} + q(x)y = g(x) + h(x)$.

\b

If we take $g(x) = 0$, we get the following.

\b

\textbf{Theorem.} Suppose the general solution of the homogeneous linear ODE $\dd{y}{x} + p(x)\d{y}{x} + q(x)y = 0$ is $y_{gen} = C_1 y_1 + C_2 y_2$ and a particular solution of the (nonhomogeneous) linear ODE $\dd{y}{x} + p(x)\d{y}{x} + q(x)y = h(x)$ is $y_{par}$.	Then the general solution of the ODE $\dd{y}{x} + p(x)\d{y}{x} + q(x)y = h(x)$ is $$y = y_{gen} + y_{par} = C_1 y_1 + C_2 y_2 + y_{par}.$$

\b

In words, what the theorem says is that the general solution of the nonhomogeneous ODE is the sum of the general solution of the homogeneous ODE and any solution of the nonhomogeneous ODE.

\b

\textbf{Example.} Given that a solution of the ODE $\dd{y}{x} - 4y = 6x - 4x^3$ is $y = x^3$, find the general solution of the ODE $\dd{y}{x} - 4y = 6x - 4x^3$.

\b

By the last theorem, the general solution will be $C_1y_1 + C_2y_2 + x^3$, where $C_1y_1 + C_2y_2$ is the general solution of the homogeneous ODE $\dd{y}{x} - 4y = 0$. (What we called $y_{par}$ is the function $x^3$.) The characteristic polynomial of the homogeneous ODE is $r^2 - 4 = (r -2 )(r + 2)$, so the general solution of the homogeneous ODE is $y_{gen} = C_1e^{2x} + C_2e^{-2x}$.  Therefore, the general solution of the given ODE is $y = C_1e^{2x} + C_2e^{-2x} + x^3$.

\b

The question is how to come up with any solution of the nonhomogeneous ODE.	 In many cases, we can use what is called the \textit{method of undetermined coefficients}.	This method works if the ODE has the form $$\dd{y}{x} + b \d{y}{x} + c y = h(x)$$ where $h(x)$ has the form  $h(x) = P(x) \cos (\alpha x)e^{\beta x}$ or $h(x) = P(x) \sin (\alpha x)e^{\beta x}$, where $\alpha $ and $\beta $ are constants (possibly 0) and $P(x)$ is a polynomial, or if $h(x)$ is a sum of functions of this sort.

\b

The idea is to try to find a solution which has the same form as that of $h(x)$. We will have to see what to try.


\b

\textbf{Theorem.} Suppose $f$ and $g$ are linearly independent functions.  If $Af + Bg = Cf + Dg$, where $A, B, C, D$ are numbers, then $A = C$ and $B = D$.

\b

\textbf{Examples.}

\begin{enumerate}

\item Find the general solution of the ODE $\dd{y}{x} - 5\d{y}{x} + 6y = 10e^{4x}$.

\b

The general solution of the homogeneous ODE $\dd{y}{x} - 5\d{y}{x} + 6y =0$ is $y = C_1e^{2x} + C_2e^{3x}$. We need to find a particular solution of the nonhomogeneous ODE.

We look for a solution $y = Ae^{4x}$, that is, a number times the right side.  If $y = Ae^{4x}$, then $y' = 4Ae^{4x}$, and $y'' = 16Ae^{4x}$, so if $y$ is a solution, then $$16Ae^{4x} - 5\cdot4Ae^{4x} + 6Ae^{4x} = 10e^{4x},$$ or $$2Ae^{4x} = 10E^{4x}.$$	 We solve this to get $A = 5$, which gives the solution $y = 5e^{4x}$.	 It follows from the theorem that the general solution of the ODE is $y = C_1e^{2x} + C_2e^{3x} + 5e^{4x}$.

\item Find the general solution of the ODE $\dd{y}{x} - y = \cos x$.

\b

The general solution of the homogeneous ODE $\dd{y}{x} - y = 0$ is $y = C_1 e^x + C_2e^{-x}$.  To find a particular solution of the nonhomogeneous ODE, we look for a solution of the form $y = A \cos x + B \sin x$.  If $y$ has this form, then $y' = -A \sin x + B \cos x$ and $y'' = -A \cos x - B \sin x$, so if $y$ is a solution $$(-A \cos x - B \sin x) - (A \cos x + B \sin x) = \cos x,$$ or $$-2A \cos x - 2B \sin x = \cos x.$$	Now we compare coefficients to get $-2A = 1, -2B = 0$, so $A = \frac{-1}{2}$ and $B = 0$. Therefore, we get the particular solution $y = (\frac{-1}{2})\cos x$, so the general solution is $$y = C_1 e^x + C_2e^{-x} - (\frac{1}{2})\cos x.$$


\item Find the general solution of the ODE $\dd{y}{x} - 5 \d{y}{x} + 6y = 10e^x \sin x$.

\b

The general solution of the homogeneous ODE $\dd{y}{x} - 5 \d{y}{x} + 6y = 0$ is $y = C_1e^{2x} + C_2e^{3x}$.	We look for a particular solution of the nonhomogeneous equation of the form $$y = Ae^x\cos x + Be^x \sin x.$$ Then $$y' = (A+B)e^x\cos x + (B-A)e^x \sin x,$$ and $$y'' = 2Be^x\cos x - 2Ae^x\sin x.$$	 Substituting in the ODE gives $$(A - 3B)e^x\cos x + (3A+B)e^x\sin x = 10e^x \sin x.$$ Comparing coefficients gives $$\begin{array}{c}A - 3B = 0. \\ 3A + B =10.\end{array}$$ Solving this system gives $A = 3, B = 1$, so we get the particular solution $y =	 3e^x\cos x +e^x \sin x.$	Therefore, the general solution is $$y = C_1e^{2x} + C_2e^{3x}+3e^x\cos x + e^x \sin x.$$

\end{enumerate}


\b

In general, if $h(x) = \left[ \begin{array}{c} Ce^{ax}\cos (bx) + De^{ax}\sin (bx) \\
a_0 + a_1x + \cdots + a_nx^n
\end{array}\right]$, look for a solution of the same form.	Here $a, b, C, D , a_i$ are all constants, possibly 0.	 In particular, even if $h(x)$ is just $\sin bx$, you still need to look for a solution of the form $C\cos (bx) + D \sin(bx)$.	If the right side is the sum of two of these functions, do them separately and add the results.

\b

\textbf{Example.} Find the general solution of the ODE $\dd{x}{t} + x = e^{2t} + 3e^{4t}$.	

\b

The general solution of the homogeneous ODE is $x = C_1 \cos t + C_2 \sin t.$
\b

To find a particular solution of $\dd{x}{t} + x = e^{2t}$ we look for a solution of the form $x = Ae^{2t}$.	 We find $A = \frac{1}{5}$ to get the solution $x = (\frac{1}{5})e^{2t}$.

\b

To find a particular solution of $\dd{x}{t} + x = 3e^{4t}$ we look for a solution of the form $x = Be^{4t}$.	 We find $B = \frac{3}{17}$ to get the solution $x = (\frac{3}{17})e^{4t}$.

\b

Adding these, we get that a particular solution of $\dd{x}{t} + x = e^{2t} + 3e^{4t}$ is $y = (\frac{1}{5})e^{2t} + (\frac{1}{5})e^{2t}$, so the general solution is $y = C_1 \cos t + C_2 \sin t + (\frac{1}{5})e^{2t} + (\frac{3}{17})e^{4t}$.

\b

There is a problem that arises when the form we choose for a solution is a solution of the homogeneous ODE.  In that case, we must multiply that form by a power of $x$ large enough that we do not get a solution of the homogeneous ODE.

\b

\textbf{Example.} Find the general solution of the ODE $\dd{y}{x} - 4 \d{y}{x} + 4y = 6e^{2x}$.

\b

The general solution of the homogeneous ODE $\dd{y}{x} - 4 \d{y}{x} + 4y = 0$ is $y = C_1e^{2x} + C_2xe^{2x}$.  We must find a particular solution.

\b

According to the method we have used so far, we would try to find a particular solution of the form $y = Ae^{2x}$, but if we try that, $\dd{y}{x} - 4 \d{y}{x} + 4y$ can not be $3e^{2x}$ because we know that we will get $0$.  The same thing happens if we try $y = Axe^{2x}$.	 Therefore, we look for a solution of the form $y = Ax^2e^{2x}$.	Then $y' = 2Axe^{2x} + 2Ax^2e^{2x}$ and $y'' = 2Ae^{2x} + 8Axe^{2x} + 4Ax^2e^{2x}$.  Substituting in the equation $\dd{y}{x} - 4 \d{y}{x} + 4y = 6e^{2x}$ and simplifying gives $2Ae^{2x} = 6e^{2x}$, so $A = 3$.	 This gives the particular solution $y = 3x^2e^{2x}$.  Therefore, the general solution if $y = C_1e^{2x} + C_2xe^{2x} +  3x^2e^{2x}$.


\b

\{ Page 183 \hspace{1in} 1-8, 13-16 \\

%\pagebreak



\end{document} 