# DE Tutorial - Part I: First Order Equations and Homogeneous Second Order Equations

• May 12th 2008, 11:12 PM
Chris L T521
DE Tutorial - Part I: First Order Equations and Homogeneous Second Order Equations
Once in a while, differential equation questions pop up, so I'm going to point out the various techniques on how to solve them:

1. Direct Integration:

If you have a differential equation in the form $\dfrac{dy}{dx}=f(x)$, we can use direct integration to solve the DE.

Example 1:

Solve $\dfrac{dy}{dx}=3x^2.$

To solve, simply integrate both sides of the equation:

$\displaystyle\int\frac{dy}{dx}\,dx=\int 3x^2\,dx \implies y+C_1=x^3+C_2 \implies \boxed{y=x^3+C}.$ Note that we can combine the two constants into a new constant C.

Also, we may encounter differential equations with given conditions. These types of differential equations are called initial value problems (IVP). When solving a DE without conditions, we always find the General Solution to the DE. When an initial condition is applied, then we are finding a Particular Solution. Let's go through a quick example.

Example 2:

Solve $\dfrac{dy}{dx}=xe^{-x};\quad y(0)=0.$

Directly integrate the DE:

$\displaystyle\int\frac{dy}{dx}\,dx=\int xe^{-x}\,dx.$

We need to apply integration by parts to the integral on the right side:

$\displaystyle \int xe^{-x}\,dx.$

let $u=x$ and $dv=e^{-x}\,dx.$ Therefore, $du=dx$ and $v=-e^{-x}.$

$\displaystyle\therefore \int xe^{-x}\,dx=-xe^{-x}+\int e^{-x}\,dx=-xe^{-x}-e^{-x}+C=-e^{-x}(x+1)+C.$

Now apply the initial condition $y(0)=1:$

$1=-e^{0}(0+1)+C \implies C=2.$

Thus, our particular solution is $\boxed{y=-e^{-x}(x+1)+2}.$

-------------------------------------------------------------------------

2. Separation of Variables

Another technique in solving differential equations is separation of variables. As the name suggests, we "separate" one variable from another in order to find a solution. Some of these are very straight-forward, whereas some of the DE's require some thought. I will go through an easier example, and then a harder one.

Example 3:

Solve $\dfrac{dy}{dx}=4x^3y-y;\quad y(1)=-3.$

First, factor out a $y$ and then separate the variables:

$\displaystyle\frac{dy}{dx}={\left(4x^3-1\right)}y \implies \frac{dy}{y}={\left(4x^3-1\right)}\,dx.$

Integrate both sides and solve for y.

$\displaystyle\int\frac{dy}{y}=\int{\left(4x^3-1\right)}\,dx \implies \ln\left|y\right|=x^4-x+C \implies \left|y\right|=e^{C}e^{x^4-x} \implies y=Ce^{x^4-x}.$

Apply the initial condition $y(1)=-3:$

$-3=Ce^{0} \implies C=-3.$

$\therefore \boxed{y=-3e^{x^4-x}}.$

Example 4:

Solve $x^2\dfrac{dy}{dx}=1-x^2+y^2-x^2y^2.$

Factor the right hand side of the equation:

$\displaystyle x^2\frac{dy}{dx}=1-x^2+(1-x^2)y^2 \implies x^2\frac{dy}{dx}=(1-x^2)(1+y^2).$

Separate the variables and integrate:

$\displaystyle\frac{dy}{1+y^2}=\frac{1-x^2}{x^2}\,dx\implies \int \frac{dy}{1+y^2}= \int\frac{1-x^2}{x^2}\,dx\implies \tan^{-1}(y)=-\frac{1}{x}-x+C.$

Solve for y:

$\boxed{y=\tan{\left(-\frac{1}{x}-x+C\right)}}.$

-------------------------------------------------------------------------

I will post more later on today...after I sleep (Sleepy)
• May 13th 2008, 10:30 AM
Chris L T521
3. The Integrating Factor

The method of the integrating factor is used when we have differential equations in the form $\dfrac{dy}{dx}+P(x)y=Q(x).$ Multiplying the equation through by the integrating factor $e^{\int P(x)\,dx},$ we would have the equation $\left[e^{\int P(x)\,dx}y\right]'=Q(x)e^{\int P(x)\,dx}.$ Integrating both sides and solving for $y$, we get:

$\displaystyle y=e^{-\int P(x)\,dx}\left[\int Q(x)e^{\int P(x)\,dx}\,dx\right]+C e^{-\int P(x)\,dx}.$

Let us go through an easy example, and then a challenging one.

Example 5:

Solve $\displaystyle x\frac{dy}{dx}+y=3xy;\quad y(1)=0.$

$x\dfrac{dy}{dx}+y=3xy \implies x\dfrac{dy}{dx}+(1-3x)y=0.$

In order to apply the integrating factor, the coefficient of $\dfrac{dy}{dx}$ must be equal to 1.

$\displaystyle x\frac{dy}{dx}+(1-3x)y=0 \implies \frac{dy}{dx}+\left(\frac{1}{x}-3\right)y=0.$

Now find the integrating factor:

$\rho(x)=e^{\int P(x)\,dx}=e^{\int {\left(\frac{1}{x}-3\right)}\,dx}=e^{\ln(x)-3x}=xe^{-3x}.$

Multiplying through, we should get

$\left[xe^{-3x}y\right]'=0.$

Integrating, we find that

$xe^{-3x}y=C.$

Imposing the initial condition $y\left(1\right)=0,$ we see that $e^{-3}\cdot 0=C\implies C=0.$

Therefore, the solution to the differential equation is $y=0\cdot x^{-1}e^{3x}\implies \boxed{y \equiv 0}.$

Example 6:

Solve $(x^2+1)\dfrac{dy}{dx}+3x^3y=6xe^{-3x^{2}/2};\quad y(0)=1.$

Divide through by $x^2+1:$

$\displaystyle \frac{dy}{dx}+\frac{3x^3}{x^2+1}\,y=\frac{6xe^{-3x^{2}/2}}{x^2+1}.$

Now find the integrating factor:

$\displaystyle \rho(x)=e^{\int P(x)\,dx}=e^{\int \frac{3x^3}{x^2+1}\,dx}.$

Apply long division to simplify the integrand:

(Verify): $\displaystyle \rho(x)=e^{\int{\left(3x-\frac{3x}{x^2+1}\right)}\,dx}=e^{3x^{2}/2-3\ln(x^2+1)/2}=(x^2+1)^{-3/2}e^{3x^{2}/2}.$

Multiplying through by the integrating factor, we should get

(Verify): $\displaystyle \left[(x^2+1)^{-3/2}\,e^{3x^{2}/2}\,y\right]'=\frac{6x}{(x^2+1)^{5/2}}.$

Integrating both sides and then solving for $y$, we get

$(x^2+1)^{-3/2}e^{3x^{2}/2}y=-\frac{2}{(x^2+1)^{3/2}}+C \implies y=e^{-3x^2/2}{\left(C(x^2+1)^{3/2}-2\right)}.$

Now apply the initial condition $y(0)=1:$

$1=C-2 \implies C=3.$

Therefore, our particular solution will be

$\boxed{y=e^{-3x^2/2}\left(3(x^2+1)^{3/2}-2\right)}.$

--------------------------------------------------------------------------

4. Exact Equations

In order to use the technique to solve exact equations, the equations must be in the form:

$M(x,y)\,dx+N(x,y)\,dy=0,$

And they must satisfy this one condition:

$\dfrac{\partial M}{\partial y}=\dfrac{\partial N}{\partial x}.$

If this relationship is true, we'll continue on with this technique. If its not true, we will resort to 2 other possible techniques which will be discussed later.

When we go about solving this, we should make known that $\dfrac{\partial f}{\partial x}=M(x,y)$ and that $\dfrac{\partial f}{\partial y}=N(x,y).$

Step one: find $f(x,y).$ You can do it two ways, but I will do it this way because it's the most common way:

$\displaystyle \frac{\partial f}{\partial x}=M(x,y) \implies \int\frac{\partial f}{\partial x}\,dx=\int M(x,y)\,dx \implies f(x,y)=\int M(x,y)\,dx + g(y).$

Step 2: Find $g(y).$ To do this, partially differentiate $f(x,y)$ with respect to $y:$

$\displaystyle \frac{\partial f}{\partial y}=\frac{\partial}{\partial y}\int M(x,y)\,dx+g'(y).$

Since $N(x,y)=\dfrac{\partial f}{\partial y},$

$\displaystyle N(x,y)=\frac{\partial}{\partial y}\int M(x,y)\,dx+g'(y).$

Solving for $g'(y),$ we get

$\displaystyle N(x,y)-\frac{\partial}{\partial y}\int M(x,y)\,dx=g'(y).$

Integrate to find $g(y):$

$\displaystyle g(y)=\int\left(N(x,y)-\frac{\partial}{\partial y}\int M(x,y)\,dx\right)\,dy.$

Step 3: write solution in general form.

The general solution of an exact equation will have the form

$f(x,y)=C.$

Since $\displaystyle f(x,y)=\int M(x,y)\,dx + \int\left(N(x,y)-\frac{\partial}{\partial y}\int M(x,y)\,dx\right)\,dy,$ the general solution will be

$\displaystyle \int M(x,y)\,dx + \int\left(N(x,y)-\frac{\partial}{\partial y}\int M(x,y)\,dx\right)\,dy=C.$

Example 7:

Solve $\displaystyle (\cos(x)+\ln(y))\,dx+\left(\frac{x}{y}+e^{y}\right )dy=0.$

Let

$M(x,y)=\cos(x)+\ln(y),$ and

$\displaystyle N(x,y)=\frac{x}{y}+e^{y}.$

Test for exactness:

$\displaystyle \frac{\partial M}{\partial y}=\frac{1}{y},$ and

$\displaystyle \frac{\partial N}{\partial x}=\frac{1}{y}.$

They are equal, so the DE is exact.

Find $f(x,y):$

$\displaystyle f(x,y)=\int (\cos(x)+\ln(y))\,dx \implies f(x,y)=\sin(x)+x\ln(y)+g(y).$

Now find $g(y):$

$\displaystyle \frac{\partial f}{\partial y}=\frac{x}{y}+g'(y).$

Since $N(x,y)=\dfrac{\partial f}{\partial y},$

$\displaystyle \frac{x}{y}+e^{y}=\frac{x}{y}+g'(y) \implies g'(y)=e^{y} \implies g(y)=e^{y}.$

Therefore,

$f(x,y)=\sin(x)+x\ln(y)+e^{y},$

and the general solution is

$\boxed{\sin(x)+x\ln(y)+e^{y}=C}.$

-------------------------------------------------------------------------

I will be back later with more...
• May 13th 2008, 05:08 PM
Chris L T521
5. Bernoulli Equations

A differential equation that has the form $\dfrac{dy}{dx}+P(x)y=Q(x)y^n$ is known as a Bernoulli's Equation. When $n=0$ or $n=1,$ the equation is linear. However, when $n>1,$ we make a substitution $v=y^{n-1},$ which then transforms it into a linear DE of the form : $\dfrac{dv}{dx}+(1-n)P(x)v=(1-n)Q(x).$

Example 8:

Solve $x\dfrac{dy}{dx}+6y=3xy^{4/3}.$

This can easily be recognized as a Bernoulli's Equation where $n=\frac{4}{3}.$ Therefore, $1-n=-\frac{1}{3}.$

Make the substitution $v=y^{-1/3} \implies y=v^{-3}.$

Find $\dfrac{dy}{dx}:$

$\displaystyle \frac{dy}{dx}=\frac{dy}{dv}\frac{dv}{dx}=-3v^{-4}\frac{dv}{dx}.$

Substituting these values into the differential equation, we get

$\displaystyle -3xv^{-4}\frac{dv}{dx}+6v^{-3}=3xv^{-4} \implies \frac{dv}{dx}-\frac{2}{x}v=-1.$ We now have a linear DE, which we already know how to solve.

Find the integrating factor:

$\displaystyle \rho(x)=e^{\int P(x)\,dx}=e^{-2\int \frac{\,dx}{x}}=x^{-2}.$

Multiply throughout by the integrating factor, and then simplify:

$\displaystyle \left[x^{-2}v\right]'=-\frac{1}{x^2} \implies x^{-2}v=\frac{1}{x}+C \implies v=x+Cx^2.$

We don't want to know what $v$ is. We want to know what $y$ is. Since $v=y^{-1/3},$ we see that

$y^{-1/3}=x+Cx^2 \implies \boxed{y=\frac{1}{(x+Cx^2)^3}}.$

-------------------------------------------------------------------------

Second Order Differential Equations

A homogeneous second order differential equation has the form :

$\displaystyle a\frac{d^2y}{dx^2}+b\frac{dy}{dx}+cy=0.$

If we assume that a solution has the form $y=e^{rx},$ then the differential equation becomes

$\displaystyle ar^2e^{rx}+bre^{rx}+ce^{rx}=0.$ Knowing that $e^{rx}>0,$ we can divide both sides by $e^{rx},$ which gives us

$ar^2+br+c=0.$

The equation above is know as the characteristic or auxillary equation. Solving for $r$, we use the quadratic formula:

$\displaystyle r=\frac{-b\pm \sqrt{b^2-4ac}}{2a}.$

Depending on the value of the discriminant $b^2-4ac,$ we have three different ways of finding the particular solution to a DE.

$\bold{b^2-4ac>0:}$

If this is the case, then we have 2 real distinct roots: $r_1=\dfrac{-b+\sqrt{b^2-4ac}}{2a}$ and $r_2=\dfrac{-b-\sqrt{b^2-4ac}}{2a}.$

Due to the principle of superposition, if $f$ and $g$ are a solution to a DE, then any linear combination of $f$ and $g$ is also a solution (I will not prove this). Since $y_1=e^{\left(-b+\sqrt{b^2-4ac}\right)x/(2a)}$ and $y_2=e^{\left(-b-\sqrt{b^2-4ac}\right)x/(2a)}$ are solutions to the DE, then any linear combination of the two is a solution. Thus the general solution in this case will be:

$\displaystyle y(x)=c_1y_1+c_2y_2=c_1e^{\left(-b+\sqrt{b^2-4ac}\right)x/(2a)}+c_2e^{\left(-b-\sqrt{b^2-4ac}\right)x/(2a)}.$

$\bold{b^2-4ac=0:}$

If this is the case, we have real, repeated roots $r_1=r_2=r=-\dfrac{b}{2a}.$ However, it will have a different solution, due to the fact that each of the solutions must be linearly independent of each other (this will be discussed later). As a result, the solutions will be $y_1=e^{-bx/(2a)}$ and $y_2=\bold{x} e^{-bx/(2a)}.$ (This is known as reduction of order, which will be proved when we discuss linear independence). Thus, the general solution in this case will be:

$y=c_1e^{-bx/(2a)}+c_2xe^{-bx/(2a)}.$

$\bold{b^2-4ac<0:}$

If this is the case, then we have a pair of complex conjugate roots:

$r_1=\alpha+\beta i$ and $r_2=\alpha - \beta i.$

Thus, the solutions to the DE will be $y_1=e^{(\alpha+\beta i)x}=e^{\alpha x}e^{i\beta x}$ and $y_2=e^{(\alpha-\beta i)x}=e^{\alpha x}e^{-i\beta x}.$ Thus, the general solution will have the form

$y=e^{\alpha x}{\left(c_1e^{i\beta x}+c_2e^{-i\beta x}\right)}.$

We really don't want the complex numbers in here, so what we will do is use Euler's Formula to clean it up.

Euler's Formula states that $e^{i\theta}=\cos(\theta)+i\sin(\theta).$

Thus,

$e^{i\beta x}=\cos(\beta x)+i\sin(\beta x),$ and

$e^{-i\beta x}=\cos(\beta x)-i\sin(\beta x).$

Substituting this back into the general solution, we have

$y=e^{\alpha x}\left(c_1(\cos(\beta x)+i\sin(\beta x))+c_2(\cos(\beta x)-i\sin(\beta x))\right)$

$=e^{\alpha x}\left((c_1+c_2)\cos(\beta x)+i(c_1-c_2)\sin(\beta x))\right).$

By defining new constants $C_1=c_1+c_2$ and $C_2=i(c_1-c_2),$ the general solution is

$y(x)=e^{\alpha x}\left(C_1\cos(\beta x)+C_2\sin(\beta x)\right).$

Example 9:

Solve $\dfrac{d^2y}{dx^2}-3\dfrac{dy}{dx}+2y=0;\quad y(0)=1;\quad y'(0)=0.$

Assuming a solution of $y=e^{rx},$ we have:

$r^2-3r+2=0 \implies (r-1)(r-2)=0 \implies r=1$ or $r=2.$

Thus, $y_1=e^x$ and $y_2=e^{2x}.$ The general solution will be

$y(x)=c_1e^{x}+c_2e^{2x}.$

However, we are given two initial conditions, one for $y(x)$ and one for $y'(x).$ Let us first find $y'(x):$

$y(x)=c_1e^x+2c_2e^{2x}.$

Now apply the initial conditions:

$1=c_1+c_2,$ and

$0=c_1+2c_2.$

We see that $-2c_2=c_1 \implies 1=-c_2\implies c_2=-1.$ Thus, $c_1=2.$

Therefore, the particular solution is:

$\boxed{y(x)=2e^x-e^{2x}}.$

-------------------------------------------------------------------------

I will post more examples later...
• May 15th 2008, 09:15 PM
Chris L T521
Linear Dependence and Linear Independence

Linear Dependence

The $n$-number of functions $f_1,f_2,f_3,...,f_n$ are said to be linearly dependent on the interval $I,$ provided that there exists constants $c_1,c_2,c_3,...,c_n$ not all zero such that
$c_1f_1+c_2f_2+...+c_nf_n=0$ on $I;$ that is, when
$c_1f_1(x)+c_2f_2(x)+...+c_nf_n(x)=0\ \forall \ x\in I.$

Another way that a set of functions can be determined to be linear dependent is when the $n\times n$ Wronksian of $n$-number of functions is exactly equal to zero:

$W= \left|\begin{array}{cccc}f_1 & f_2 & \cdots & f_n \cr
f_{1}' & f_{2}' & \cdots & f_{n}' \cr
\vdots & \vdots & \ddots & \vdots \cr
f_{1}^{(n-1)} & f_{2}^{(n-1)} & \cdots & f_{n}^{(n-1)} \cr
\end{array}\right|\equiv 0.$

Example 10:

Show that the functions $y_1=\sin(2x),\; y_2=\sin(x)\cos(x),\;\text{and}\; y_3=e^x$ are linearly dependent.

We will go about it two ways: finding the constants $c_1, c_2, c_3$ such that $c_1y_1+c_2y_2+c_3y_3=0.$ The second way will be by using the Wronskian.

It is alright for one of the constants to be zero, as long as all of the constants aren't zero. If we choose $c_3=0,$ we are left with $c_1\sin(2x)+c_2\sin(x)\cos(x).$ Noting that $\sin(2x)=2\sin(x)\cos(x),$ we can pick the remaining constants such that $c_1\sin(2x)+c_2\sin(x)\cos(x)=0.$ If we choose $c_1=1 \;\text{and}\; c_2=-2,$ we have

$\sin(2x)-2\sin(x)\cos(x)=\sin(2x)-\sin(2x)=\boxed{0}.$

The alternative way is by using the Wronskian:

$W= \left|\begin{array}{ccc}
\sin(2x) & \sin(x)\cos(x) & e^{x} \\
2\cos(2x) & \cos(2x) & e^{x} \\
-4\sin(2x) & -2\sin(2x) & e^{x}
\end{array}\right|=
\sin(2x)\left|
\begin{array}{cc}
\cos(2x) & e^x \\
-2\sin(2x) & e^{x}
\end{array} \right|$

$-\dfrac{1}{2}\,\sin(2x) \left|
\begin{array}{cc}
2\cos(2x) & e^{x} \\
-4\sin(2x) & e^{x}
\end{array} \right|+e^x \left|
\begin{array}{cc}
2\cos(2x) & \cos(2x) \\
-4\sin(2x) & -2\sin(2x)
\end{array} \right|$

$=e^{x}\sin(2x)(\cos(2x)+2\sin(2x))-e^{x}\sin(2x)(\cos(2x)+2\sin(2x))+0=\boxed{0}.$

Since $W\equiv 0$, this set of functions is linearly dependent.

Linear Independence

A function is linearly independent when the $n\times n$ Wronskian of $n$-number of functions is not equal to zero:

$W= \left|\begin{array}{cccc}
f_1 & f_2 & \cdots & f_n \\
f_{1}' & f_{2}' & \cdots & f_{n}'\\
\vdots & \vdots & \ddots & \vdots\\
f_{1}^{(n-1)} & f_{2}^{(n-1)} & \cdots & f_{n}^{(n-1)}
\end{array}\right|\neq 0.$

Example 11:

Show that the functions $y_1=e^{-3x},\;y_2=\cos(2x),\;\text{and}\; y_3=\sin(2x)$ are linearly independent.

Find the Wronskian:

$W= \left|\begin{array}{ccc}
e^{-3x} & \cos(2x) & \sin(2x) \\
-3e^{-3x} & -2\sin(2x) & 2\cos(2x) \\
9e^{-3x} & -4\cos(2x) & -4\sin(2x)
\end{array}\right|=e^{-3x}\left|
\begin{array}{cc}
-2\sin(2x) & 2\cos(2x) \\
-4\cos(2x) & -4\sin(2x)
\end{array} \right|$

$+3e^{-3x} \left|
\begin{array}{cc}
\cos(2x) & \sin(2x) \\
-4\cos(2x) & -4\sin(2x)
\end{array} \right|+9e^{-3x} \left|
\begin{array}{cc}
\cos(2x) & \sin(2x) \\
-2\sin(2x) & 2\cos(2x)
\end{array} \right|$

$=8e^{-3x}+0+18e^{-3x}=\boxed{26e^{-3x} \neq 0 \ \forall \ x \in \mathbb{R}}.$

Since $W\neq 0$, this set of functions is linearly independent.

-------------------------------------------------------------------------------------------------------

Reduction of Order

When solving a homogeneous DE, we noted there were three cases:

1) Real and Distinct roots
2) Real repeated roots
3) Complex conjugate roots

Let us re-examine the second case.

We said that if we had real repeated roots, then the solutions would have the form $y_1=e^{rx}$ and $y_2=xe^{rx}$. We will now see from where the $x$ comes.

We want the solutions to be linearly independent. In other words,

$y_2\neq cy_1$ or $y_1\neq cy_2$. Let $y_2=u(x)y_1$ where $u(x)$ is not a constant.

In solving $y''+P(x)y'+Q(x)y=0,$ we will assume that $y_2=u(x)y_1$ is a solution to this DE.

$y_2=u(x)y_1$

$y_{2}'=u'(x)y_1+u(x)y_{1}'$

$y_{2}''=u''(x)y_1+2u'(x)y_{1}'+u(x)y_{1}''.$

Substitute these values into the differential equation:

$u''(x)y_1+2u'(x)y_{1}'+u(x)y_{1}''+P(x)(u'(x)y_1+u (x)y_{1}')+Q(x)u(x)y_1=0.$

Rewrite the DE so it's in terms of $u$ (i.e., $au''+bu'+cu=0$):

$u''y_1+u'(2y_{1}'+P(x)y_1)+u(\underbrace{y_{1}''+P (x)y_{1}'+Q(x)y_1}}_{=0})=0.$

The part indicated by the underbrace is equal to zero since $y_1$ is a solution to the DE.

Thus, we are left with:

$u''y_1+u'(2y_{1}'+P(x)y_1)=0.$

If we let $w=u' \implies w'=u''$, we get a first order DE:

$w'y_1+w(2y_{1}'+P(x)y_1)=0 \implies w'y_1=-w(2y_{1}'+P(x)y_1).$

Separate the variables:

$\displaystyle \frac{dw}{w}=-\left(\frac{2y_{1}'+P(x)y_1}{y_1}\right)\,dx$

$\displaystyle \frac{dw}{w}=-\left(\frac{2y_{1}'}{y_1}+\frac{P(x)y_1}{y_1}\righ t)\,dx$

$\displaystyle \frac{dw}{w}=-\left(\frac{2}{y_1}\frac{dy_1}{dx}+P(x)\right)\,dx$

$\displaystyle \int\frac{dw}{w}=-\int\left(\frac{2}{y_1}\frac{dy_1}{dx}+P(x)\right) \,dx$

$\displaystyle \ln\left|w\right|=-2\ln\left|y_1\right|-\int P(x)\,dx$

$\displaystyle w=e^{-2\ln\left|y_1\right|-\int P(x)\,dx}$

$\displaystyle w=y_{1}^{-2}e^{-\int P(x)\,dx}.$

Since $w=u'(x)$,

$\displaystyle u'=\frac{e^{-\int P(x)\,dx}}{y_{1}^{2}}$

$\therefore \boxed{u=\int \left[\frac{e^{-\int P(x)\,dx}}{y_{1}^{2}}\right]\,dx}$

$\therefore \boxed{y_2=\left(\int \left[\frac{e^{-\int P(x)\,dx}}{y_{1}^{2}}\right]\,dx\right)y_1}.$

Example 12:

Solve $y''-2y'+y=0.$

Assuming a solution of the form $y=e^{rx},$ we have:

$r^2-2r+1=0 \implies r=1$ with a multiplicity of 2 (Thus, we have repeated roots).

The solutions will thus have the form $y_1=e^x$ and $y_2=u(x)e^x$ where

$\displaystyle u=\int \left[\frac{e^{-\int P(x)\,dx}}{y_{1}^{2}}\right]\,dx.$

Find $u(x):$

$\displaystyle u(x)=\int \left[\frac{e^{\int 2\,dx}}{(e^x)^{2}}\right]\,dx=\int\frac{e^{2x}}{e^{2x}}\,dx=\int\,dx=\boxed {x}.$

Therefore, $\boxed{y_2=xe^x}.$

Therefore, $\boxed{y(x)=c_1e^x+c_2xe^x}.$

-------------------------------------------------------------------------------------------------------

Will post more when I'm done with finals... :D
• May 22nd 2008, 08:25 PM
Chris L T521
Cauchy-Euler Equations:

A second order homogeneous Cauchy-Euler Equation takes the form:

$\displaystyle ax^2\frac{d^2y}{dx^2}+bx\frac{dy}{dx}+cy=0.$

This time, we assume that a solution to the equation has the form $y=x^r.$ Substituting this in for $y$, we get the new equation

$ax^2\left[r(r-1)x^{r-2}\right]+bx\left[rx^{r-1}\right]+cx^r=0.$

Simplifying, we get:

$a(r^2-r)x^{r}+brx^{r}+cx^{r}=0.$

Pulling out a common factor of $x^r$, we get:

$\left(a(r^2-r)+br+c\right)x^{r}=0.$

Assuming that $x^r\neq 0$, we divide both sides by $x^r$ and get:

$ar^2-ar+br+c=0 \implies ar^2+(b-a)r+c=0.$

This is the characteristic equation for the Cauchy-Euler Equation.

Again, just with the second order homogeneous DE with constant coefficients, there are three general cases:

1) Real distinct roots.
2) Real repeated roots.
3) Complex conjugate roots.

Case 1:

If we have two real and distinct roots $r=r_1\;\text{and}\; r=r_2$, then the solutions to the DE are $y_1=x^{r_1}\;\text{and}\; y_2=x^{r_2}.$ Thus the general solution would be:

$\boxed{y=c_1x^{r_1}+c_2x^{r_2}}.$

Example 13:

Solve $\displaystyle x^2\frac{d^2y}{dx^2}+7x\frac{dy}{dx}+5y=0.$

Assuming a solution of $y=x^r,$ we get the characteristic equation

$r^2+(7-1)r+5=0 \implies r^2+6r+5=0 \implies (r+1)(r+5)=0 \implies r=-1\;\text{or}\; r=-5.$

Therefore, $y_1=x^{-1}\;\text{and}\;y_2=x^{-5}.$

$\boxed{\therefore y=c_1x^{-1}+c_2x^{-5}}.$

Case 2:

If we have real repeated roots, then $r=r_1=r_2.$ Thus, the solutions take the form $y_1=x^{r}\;\text{and}\; y_2=u(x)x^{r},$ where

$\displaystyle u(x)=\int\frac{e^{-\int P(x)\,dx}}{y_{1}^{2}}\,dx.$

This is the case because $y_1\;\text{and}\;y_2$ must be linearly independent solutions. To use the reduction of order formula, we need to manipulate the original DE:

$\displaystyle ax^2\frac{d^2y}{dx^2}+bx\frac{dy}{dx}+cy=0 \implies \frac{d^2y}{dx^2}+\frac{b}{ax}\frac{dy}{dx}+\frac{ c}{ax^2}=0.$

Now apply Reduction of Order:

$\displaystyle u(x)=\int\frac{e^{\int \frac{b}{ax} \,dx}}{x^{2r}}\,dx,$ where

$\displaystyle r=\frac{-(b-a)}{2a}.$

Thus, we get:

$\displaystyle u(x)=\int\frac{e^{-\int \frac{b}{ax} \,dx}}{x^{2\frac{a-b}{2a}}}\,dx=\int\frac{x^{-\frac{b}{a}}}{x^{1}x^{-\frac{b}{a}}}\,dx=\int\frac{1}{x}\,dx=\boxed{\ln(x )}.$

Thus, the solutions are $y_1=x^r\;\text{and}\; y_2=x^r \ln(x).$

Therefore, the general solution is:

$\boxed{y=c_1x^r+c_2x^r \ln(x)}.$

Example 14:

Solve $\displaystyle x^2\frac{d^2y}{dx^2}-3x\frac{dy}{dx}+4y=0.$

Assuming a solution of $y=x^r,$ we get

$r^2+(-3-1)r+4=0 \implies r^2-4r+4=0 \implies (r-2)^2=0$

$\implies r=2\;\text{with multiplicity}\;2.$

Thus, the solutions are $y_1=x^2\;\text{and}\;y_2=x^2 \ln(x).$

Therefore, the general solution is:

$\boxed{y=c_1x^2+c_2x^2 \ln(x)}.$

Case 3:

Whenever we have complex conjugate roots $r = \alpha \pm i\beta$, we see that our two solutions to the DE take on the form:

$y_1 = x^{\alpha + i\beta}\;\text{and}\;y_2 = x^{\alpha - i\beta}.$

However, it doesn't look pleasant with complex numbers in the solution. To take care of this, we will use Euler's Formula, which states that:

$e^{i\theta } = \cos(\theta) + i\sin(\theta).$

Since $x^r=e^{r\ln(x)},$ we can say that

$
\begin{gathered}
y_1 = e^{r_1 \ln(x)} = e^{\left( {\alpha + i\beta} \right)\ln(x)} = e^{\alpha \ln(x)} e^{i\beta \ln(x)} \hfill \\
\text{and } \hfill \\
y_2 = e^{r_2 \ln(x)} = e^{\left( {\alpha - i\beta} \right)\ln(x)} = e^{\alpha \ln(x)} e^{ - i\beta \ln(x)}. \hfill \\
\end{gathered}
$

Now applying Euler's Formula, we get:

$
\begin{gathered}
e^{i\beta \ln(x)} = \cos \left( \beta \ln(x) \right) + i\sin \left( \beta \ln(x) \right) \hfill \\
e^{ - i\left( \beta \ln(x) \right)} = \cos \left( -\beta\ln(x) \right) + i\sin \left( - \beta \ln(x) \right). \hfill \\
\end{gathered}
$

Due to the even and odd properties of cosine and sine, we get that

$
e^{ - i\beta \ln(x)} = \cos \left( \beta \ln(x) \right) - i\sin \left( \beta \ln(x) \right).
$

Thus, the general solution in this case would be:

$
y = c_1 y_1 + c_2 y_2 = x^{\alpha} \left[ {c_1 \left( {\cos \left( \beta \ln(x) \right) + i\sin \left( {\beta \ln(x)} \right)} \right) + c_2 \left( {\cos \left( {\beta \ln(x)} \right) - i\sin \left( {\beta \ln(x)} \right)} \right)} \right]
$

$
\Rightarrow y = x^{\alpha} \left[ {\left( {c_1 + c_2 } \right)\cos \left( {\beta \ln(x)} \right) + i\left( {c_1 - c_2 } \right)\sin \left( {\beta \ln(x)} \right)} \right].
$

Letting $\left( {c_1 + c_2 } \right) = C_1$ and $i\left( {c_1 - c_2 } \right) = C_2,$ we have the general solution:

$\boxed{y = x^{\alpha} \left[ {C_1 \cos \left( {\beta \ln(x)} \right) + C_2 \sin \left( {\beta \ln(x)} \right)} \right]}.$

Example 15:

Solve $\displaystyle x^2 \frac{{d^2 y}}{{dx^2 }} + 2x\frac{{dy}}{{dx}} + y= 0.$

Assuming a solution of the form $y=x^r$, we get the characteristic equation:

$\displaystyle r^2 + r + 1 = 0 \Rightarrow r = \frac{{ - 1 \pm \sqrt {1 - 4} }}
{2} \Rightarrow r = - \frac{1}{2} \pm \frac{i\sqrt{3}}{2}.$

$\displaystyle \boxed{\therefore y = x^{ - \frac{1}{2}} \left[ {c_1 \cos \left( {\frac{{\sqrt 3 }}{2}\ln(x)} \right) + c_2 \sin \left( {\frac{{\sqrt 3 }}{2}\ln(x)} \right)} \right]}.$
• March 15th 2010, 12:44 PM
bkarpuz
Euler-Cauchy equations
Thanks to Chris L T521 for this nice tutorial.
I would like to give a different way for solving Euler-Cauchy equations.

Let us consider the second-order Cauchy-Euler differential equation
$
$

where $a_{0},a_{1},a_{2}\in\mathbb{R}$ with $a_{0},a_{2}\neq0$, and $x_{1}>x_{0}>0$.
In (1), we assume that $f$ is a good function,
i.e., allows us to do all the operations in the sequel.
Now, let $r_{1}\in\mathbb{C}$ and multiply (1) with $x^{-(r_{1}+1)}$ to get
$
$

Suppose now that the left-hand side of (2) satisfies
$
$

for some suitable $b_{0},b_{1}\in\mathbb{C}$.
Expanding the left-hand side of (3), we get
$
b_{0}x^{-r_{1}+1}y^{\prime\prime}+\big(b_{0}(-r_{1}+1)+b_{1}\big)x^{-r_{1}}y^{\prime}-r_{1}b_{1}x^{-r_{1}}y=a_{0}x^{-r_{1}+1}y^{\prime\prime}+a_{1}x^{-r_{1}}y^{\prime}+a_{2}x^{-(r_{1}+1)}y.\notag
$

Hence if $r_{1},b_{0},b_{1}\in\mathbb{C}$ satisfy the following system
$
\begin{cases}
b_{0}=a_{0}\\
b_{0}(-r_{1}+1)+b_{1}=a_{1}\\
-r_{1}b_{1}=a_{2},
\end{cases}\notag
$

which yields
$
\begin{cases}
b_{0}=a_{0}\\
b_{1}=a_{1}+(r_{1}-1)a_{0},
$

and thus
$
r_{1}(r_{1}-1)a_{0}+r_{1}a_{1}+a_{2}=0.\notag
$

Hence if $r_{1}\in\mathbb{C}$ is a solution to the characteristic equation
$
$

then we may use (4) to find $b_{0},b_{1}\in\mathbb{C}$.
Hence, from (2) and (3), we obtain
$
\big(b_{0}x^{-r_{1}+1}y^{\prime}+b_{1}x^{-r_{1}}y\big)^{\prime}=x^{-(r_{1}+1)}f(x)\notag
$

or equivalently
$
$

which is a first-order linear differential equation whose solution is given by
$y=c_{2}x^{r_{2}}+c_{1}x^{r_{2}}\int_{x_{0}}^{x}\ze ta^{-(r_{1}+r_{2}+1)}\mathrm{d}\zeta$ $+\frac{1}{b_{0}}x^{r_{2}}\int_{x_{0}}^{x}\zeta^{-(r_{1}+r_{2}+1)}\int_{x_{0}}^{\zeta}\eta^{-(r_{1}+1)}f(\eta)\mathrm{d}\eta\mathrm{d}\zeta,\qq uad(7)$
where $r_{2}:=-b_{1}/b_{0}$.
Note that $r_{2}\in\mathbb{C}$ solves the characteristic equation $\phi_{b}(r):=b_{0}r+b_{1}=0$,
which emerges if we apply similar steps as above for the order reduction of (6).
Therefore (7) is the solution of (1) if $r_{1}\in\mathbb{C}$ solves (5) and $b_{0},b_{1}\in\mathbb{C}$ are determined by (4).
In (7), we may group the real and the imaginary parts of the solution to obtain the real valued solution of (1).
Also in the double-integral of (7), we may change the order of the integration and compute that
$y=c_{2}x^{r_{2}}+c_{1}x^{r_{2}}\int_{x_{0}}^{x}\ze ta^{-(r_{1}+r_{2}+1)}\mathrm{d}\zeta$ $+\frac{1}{b_{0}}$ $x^{r_{2}}\int_{x_{0}}^{x}\eta^{-(r_{1}+1)}f(\eta)\int_{\eta}^{x}\zeta^{-(r_{1}+r_{2}+1)}\mathrm{d}\zeta\mathrm{d}\eta.\not ag$
... $=c_{2}x^{r_{2}}+c_{1}x^{r_{2}}\int_{x_{0}}^{x}\zet a^{-(r_{1}+r_{2}+1)}\mathrm{d}\zeta$ $+\frac{1}{b_{0}}$ $x^{r_{2}}\int_{x_{0}}^{x}\eta^{-(r_{1}+1)}f(\eta)\left\{
\begin{array}{cc}
\dfrac{\eta^{-(r_{1}+r_{2})}-x^{-(r_{1}+r_{2})}}{r_{1}+r_{2}},&r_{1}+r_{2}\neq0 \\
\log\bigg(\dfrac{\eta}{x}\bigg),&r_{1}+r_{2}=0 \\
\end{array}
\right\}\mathrm{d}\eta.\notag$

This method can be used for order reduction of higher-order Cauchy-Euler equations given in the form

$\sum_{k=0}^{n}a_{n-k}x^{k}y^{(k)}=f(x)\quad\text{for}\ x\in(x_{0},x_{1}).\notag$

The method employed above can also make you think of some special kinds of integrating-factors if
the coefficients of the equations let you to do so.