Ordinary Differential Equations/Non Homogenous 1

From testwiki
Revision as of 14:56, 23 December 2022 by imported>JackBot (Formatting, Special:UncategorizedPages)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

[[../Higher Order|Higher Order Differential Equations]]

Non-Homogeneous Equations

A non-homogeneous equation of constant coefficients is an equation of the form

dnydxn+c1dn1ydxn1++cny=f(x)

where ci are all constants and f(x) is not 0.

Complementary Function

Every non-homogeneous equation has a complementary function (CF), which can be found by replacing the f(x) with 0, and solving for the [[../Homogenous_1 | homogeneous solution]]. For example, the CF of

d2ydx23dydx+4y=2sinxx2

is the solution to the differential equation

d2ydx23dydx+4y=0

Superposition Principle

The superposition principle makes solving a non-homogeneous equation fairly simple. The final solution is the sum of the solutions to the complementary function, and the solution due to f(x), called the particular integral (PI). In other words,

General Solution = CF + PI

Method of Undetermined Coefficients

The method of undetermined coefficients is an easy shortcut to find the particular integral for some f(x). The method works only if a finite number of derivatives of f(x) eventually reduces to 0, or if the derivatives eventually fall into a pattern in a finite number of derivatives. If this is true, we then know part of the PI - the sum of all derivatives before we hit 0 (or all the derivatives in the pattern) multiplied by arbitrary constants. This is the trial PI. We can then plug our trial PI into the original equation to solve it fully.

As we will see, we may need to alter this trial PI depending on the CF. If the trial PI contains a term that is also present in the CF, then the PI will be absorbed by the arbitrary constant in the CF, and therefore we will not have a full solution to the problem.

f(x) = Constant

The simplest case is when f(x) is constant, for example

d2ydx2+dydx6y=3.

The solution to the CF is

y=Ae2x+Be3x

We now need to find a trial PI. When we differentiate y=3, we get zero. Therefore, our trial PI is the sum of a functions of y before this, that is, 3 multiplied by an arbitrary constant, which gives another arbitrary constant, K.

We now set y equal to the PI and find the derivatives up to the order of the DE (here, the second).

y=K
dydx=0
d2ydx2=0

We can now substitute these into the original DE:

0+06K=3
K=12

By summing the CF and the PI, we can get the general solution to the DE:

y=Ae2x+Be3x12

f(x) = Polynomial

This is the general method which includes the above example. A polynomial of order n reduces to 0 in exactly n+1 derivatives (so 1 for a constant as above, three for a quadratic, and so on). So we know that our PI is

y=C1xn+C2xn1+...+Cnx+Cn+1.

For an example, lets take

d2ydx2+5dydx+6y=3x4+7x2.

First off, we know that our PI is

y=Ax4+Bx3+Cx2+Dx+E.

In order to plug in, we need to calculate the first two derivatives of this:

dydx=4Ax3+3Bx2+2Cx+D
d2ydx2=12Ax2+6Bx+2C

Plugging in we get:

12Ax2+6Bx+2C+5(4Ax3+3Bx2+2Cx+D)+6(Ax4+Bx3+Cx2+Dx+E)=3x4+7x2
6Ax4+(6B+20A)x3+(6C+15B+12A)x2+(6D+10C+6B)x+6E+5D+2C=3x4+7x2
6A=3
6B+20A=0
6C+15B+12A=7
(6D+10C+6B)=0
6E+5D+2C=0

Solving gives us

A=12 B=53 C=133 D=509 E=8627

So, our PI is

y=12x4+53x3+133x2+509x+8627

However, we need to get the complementary function as well. To get that, set f(x) to 0 and solve just like we did in the last section. For this equation, the roots are -3 and -2. So that makes our CF

y=Ae3x+Be2x

Summing gives us our general solution:

y=Ae3x+Be2x+12x453x3+133x2509x+8627

f(x) = Power of e

Powers of e don't ever reduce to 0, but they do become a pattern. In fact it does so in only 1 differentiation, since it's its own derivative. So we know

yp=Kepx,

where K is our constant and p is the power of e givin in the original DE.

For example, consider

d2ydx2+5dydx+6y=5e2x+6e7x.

We make our trial PI

yp=Ae2x+Be7x.

Which then gives

dydx=2Ae2x7Be7x
d2ydx2=4Ae2x+49Be7x

Plugging in, we get

4Ae2x+49Be7x+5(2Ae2x7Be7x)+6(Ae2x+Be7x)
=5e2x+6e7x
20Ae2x+20Be7x=5e2x+6e7x
A=14
B=310
yp=14e2x+310e7x

That's the particular integral. We found the CF earlier. So the general solution is

y=Ae3x+Be2x+14e2x+310e7x


f(x) = Polynomial × Power of e

Polynomials multiplied by powers of e also form a loop, in n derivatives (where n is the highest power of x in the polynomial). So we know that our trial PI is

yp=Cnxnepx+Cn1xn1epx+...+C0epx,

where C is a constant and p is the power of e in the equation.

For example, lets try

d2ydx2+5dydx+6y=3xe2x

We can now set our PI to

yp=Axe2x+Be2x.
dypdx=2Axe2x+Ae2x+2Be2x
d2ypdx2=4Axe2x+4Ae2x+4Be2x

Plugging in, we get

4Axe2x+4Ae2x+4Be2x+5(2Axe2x+Ae2x+2Be2x)+6(Axe2x+Be2x)=3xe2x
20A=3
9A+20B=0
A=320
B=27400
yp=320xe2x27400e2x

Thats the particular solution. We found the homogeneous solution earlier. So the total solution is

y=Ae3x+Be2x+320xe2x27400e2x

f(x) = Trigonometric Functions

Trig functions don't reduce to 0 either. But they do have a loop of 2 derivatives - the derivative of sin x is cos x, and the derivative of cos x is -sin x. So we put our PI as

yp=Asin(px)+Bcos(px),

where C is a constant and p is the term inside the trig. function in the original DE.

For example, lets try

d2ydx2+5dydx+6y=cos3x.

We set our PI to

yp=Asin3x+Bcos3x
dypdx=3Acos3x3Bsin3x
d2ypdx2=9Asin3x9Bcos3x

Plugging in, we get

9Asin3x9Bcos3x+5(3Acos3x3Bsin3x)
+6(Asin3x+Bcos3x)=cos3x
15A3B=1
3A15B=0
A=578
B=178
yp=578sin3x178cos3x

Thats the particular solution. We found the homogeneous solution earlier. So the total solution is

y=Ae3x+Be2x+578sin3x178cos3x

f(x) = A Mixture

Not only are any of the above solvable by the method of undetermined coefficients, so is the sum of one or more of the above. This is because the sum of two things whose derivatives either go to 0 or loop must also have a derivative that goes to 0 or loops. The yp would be the sum of the individual yp functions.

If the Trial PI shares terms with the CF

When dealing with ex, or sometimes with polynomials (if the homogeneous equation has roots of 0) as f(x), you may get the same term in both the trial PI and the CF. If this happens, the PI will be absorbed into the arbitrary constants of the CF, which will not result in a full solution. To overcome this, multiply the affected terms by x as many times as needed until it no longer appears in the CF.

As an example, let's take

d3ydx3+d2ydx2=2x.

First, solve the homogeneous equation to get the CF.

d3ydx3+d2ydx2=0.

The auxiliary polynomial is

m3+m2=0

Find the roots of the auxiliary polynomial. In this case, they are

m=0, 0, 1

The CF is

y=Ae0x+Bxe0x+Cex=A+Bx+Cex

Now for the particular integral. Since f(x) is a polynomial of degree 1, we would normally use Ax+B. However, since both a term in x and a constant appear in the CF, we need to multiply by x² and use

yp=Ax3+Bx2.

We solve this as we normally do for A and B.

dypdx=3Ax2+2Bx
d2ypdx2=6Ax+2B
d3ypdx3=6A
6A+6Ax+2B=2x
6A=2
6A+2B=0
A=13
B=1
yp=13x3x2

So the total solution is

y=A+Bx+Cex+13x3x2

Variation of Parameters

Variation of parameters is a method for finding a particular solution to the equation y+p(x)y+q(x)y=f(x) if the general solution for the corresponding homogeneous equation y+p(x)y+q(x)y=0 is known. We will now derive this general method.

We already know the general solution of the homogenous equation: it is of the form c1y1+c2y2. We will look for a particular solution of the non-homogenous equation of the form ψ=uy1+vy2, with u and v functions of the independent variable x. Differentiating this we get

uy1+uy1+vy2+vy2

Now notice that there is currently only one condition on ψ, namely that ψ+p(x)ψ+q(x)ψ=f(x). We now impose another condition, that

uy1+vy2=0

This means that ψ will have no second derivatives of u and v. Thus, these new parameters (hence the name "variation of parameters") will be the solutions to some first order differential equation, which can be solved. Let us finish the problem:

ψ=uy1+uy1+vy2+vy2

and

ψ+p(x)ψ+q(x)ψ=f(x)

uy1+vy2+uy1+vy2+p(x)(uy1+vy2)+q(x)(uy1+vy2)=f(x)

uy1+vy2+u(y1+p(x)y1+q(x)y1)+v(y2+p(x)y2+q(x)y2)=f(x)

uy1+vy2=f(x),

where the last step follows from the fact that y1 and y2 are solutions of the homogeneous equation.

Therefore, we have uy1+vy2=0 and uy1+vy2=f(x). Multiplying the first equation by y2 and the second by y2 and adding gives

uy1y2uy1y2=f(x)y2

u=f(x)y2y1y2y1y2

A similar procedure gives

v=f(x)y1y1y2y1y2.

Now it is only necessary to evaluate these expressions and integrate them with respect to x to get the functions u and v, and then we have our particular solution ψ=uy1+vy2. The general solution to the differential equation y+p(x)y+q(x)y=f(x) is therefore c1y1+c2y2+uy1+vy2.

Note that the main difficulty with this method is that the integrals involved are often extremely complicated. If the integral does not work out well, it is best to use the method of undetermined coefficients instead.

The quantity that appears in the denominator of the expressions for u and v is called the Wronskian of y1 and y2.


Laplace Transforms

The Laplace transform is a very useful tool for solving nonhomogenous initial-value problems. It allows us to reduce the problem of solving the differential equation to that of solving an algebraic equation. We begin with some setup.

Definition of the Laplace Transform

The Laplace transform of f(t) is defined as

F(s)=0f(t)estdt.

This can also be written as {f(t)}. When writing this on paper, you may write a cursive capital "L" and it will be generally understood. There is also an inverse Laplace transform 1{F(s)}=f(t), but calculating it requires an integration with respect to a complex variable. Luckily, it is frequently possible to find 1{F(s)} without resorting to this integration, using a variety of tricks which will be described later. However, it is first necessary to prove some facts about the Laplace transform.

Two Properties of the Laplace Transform

Property 1. The Laplace transform is a linear operator; that is, {c1f(t)+c2g(t)}=c1{f(t)}+c2{g(t)}.

The proof of this property follows immediately from the definition of the Laplace transform and is left to the reader.

Property 2. If F(s)={f(t)}, then {f(t)}=sF(s)f(0)

Proof:
{f(t)}=0f(t)estdt
=limCestf(t)|0C0Csf(t)estdt (integrating by parts)
=f(0)+slimC0Cf(t)estdt
=s{f(t)}f(0)
=sF(s)f(0)

It is property 2 that makes the Laplace transform a useful tool for solving differential equations. As a corollary of property 2, note that {f(t)}=s2F(s)sf(0)f(0).

Laplace Transforms of Simple Functions

{1}=1s

{eat}=1sa

{cosωt}=ss2+ω2

{sinωt}=ωs2+ω2

The last two can be easily calculated using Euler's formula eiωt=cosωt+isinωt.

In order to find more Laplace transforms, in particular the transform of tn, we will derive two more properties of the transform.

Two More Properties of the Laplace Transform

Property 3. If {f(t)}=F(s), then {tf(t)}=F(s).

Property 4. If {f(t)}=F(s), then {eatf(t)}=F(sa).

The proofs are straightforward and are left to the reader.

Now we can easily see that {t}={(t)(1)}=ddt{1}=1s2 . Applying Property 3 multiple times, we can find that {tn}=n!sn+1. At last we are ready to solve a differential equation using Laplace transforms.

Using Laplace Transforms to Solve Non-Homogeneous Initial-Value Problems

In general, we solve a second-order linear non-homogeneous initial-value problem as follows: First, we take the Laplace transform of both sides. This immediately reduces the differential equation to an algebraic one. We then solve for F(s). Finally, we take the inverse transform of both sides to find y.

Let's begin by using this technique to solve the problem

y4y+3y=et;y(0)=0,y(0)=1.

We begin by taking the Laplace transform of both sides and using property 1 (linearity):

s2F(s)sy(0)y(0)4[sF(s)y(0)]+3F(s)=1s+1
(s24s+3)F(s)1=1s+1 (using the initial conditions)

Now we isolate F(s):

F(s)=1(s3)(s1)+1(s3)(s1)(s+1)

Here we have factored s24s+3 in preparation for the next step. We now attempt to take the inverse transform of both sides; in order to do this, we will have to break down the right hand side into partial fractions.

F(s)=A(s3)+B(s1)+C(s3)+D(s+1)+E(s1)

The first two fractions imply that A(s1)+B(s3)=1. Setting s=3 gives A=12, while setting s=1 gives B=12. The other three fractions similarly give C=D=18 and E=14. Therefore:

F(s)=12(s3)12(s1)+18(s3)+18(s+1)14(s1)
=58(s3)34(s1)+18(s+1)
=58{e3t}34{et}+18{et}

And finally we can take the inverse transform (by inspection, of course) to get

y=58e3t34et+18et.

The convolution is a method of combining two functions to yield a third function. The convolution has applications in probability, statistics, and many other fields because it represents the "overlap" between the functions. We are not concerned with this property here; for us the convolution is useful as a quick method for calculating inverse Laplace transforms.

Definition. The convolution (f*g)(t) is defined as 0tf(u)g(tu)du.

The convolution has several useful properties, which are stated below:

Property 1. ((f*g)*h)(t)=(f*(g*h))(t) (Associativity)

Property 2. (f*g)(t)=(g*f)(t) (Commutativity)

Property 3. (f*(g+h))(t)=(f*g)(t)+(f*h)(t) (Distribution over addition)

We now prove the result that makes the convolution useful for calculating inverse Laplace transforms.

Theorem. {(f*g)(t)}={f(t)}{g(t)}

Proof:
{(f*g)(t)}
=0(f*g)(t)estdt
=0[0tf(u)g(tu)du]estdt
=00testf(u)g(tu)dudt
=0uestf(u)g(tu)dtdu (changing order of integration)
=0f(u)[uestg(tu)dt]du
Now let v=tu.
=0f(u)[0es(u+v)g(v)dv]du
=0esuf(u)[0esvg(v)dv]du
={f(t)}{g(t)}

Let's solve another differential equation:

y+y=sint;y(0)=0,y(0)=0

Taking Laplace transforms of both sides gives

s2F(s)+F(s)=1s2+1
F(s)=1(s2+1)2

We now have to find 1{F(s)}. To do this, we notice that 1(s2+1)2=[{sint}]2, so F(s)={sint*sint} by the Theorem above. Thus, the solution to our differential equation is the convolution of sine with itself. We proceed to calculate this:

sint*sint
=0tsin(u)sin(tu)du
=0tcos(2ut)cos(t)2du
=12sint12tcost

Therefore, the solution to the original equation is

y=12sint12tcost.

{{}}

Template:BookCat