What is a differential equation?

What does it mean to solve them? (What is the difference between the **general solution** and a **particular solution**)

We can already solve DEs of the for y’=f(y)g(x)

What if we get something like xy’+y=x?

We can’t expect to always find DEs looking like the product rule. What about y’+3y=e^{-3x}?

Any first order DE that is linear in y can be rewritten as y’+f(x)y=g(x).

We want the LHS to be in the form: u’v+uv’. To get it in this form we simply need to multiply through **the whole equation** by the **integrating factor** I(x)=e^{∫f(x)dx}

Why does it work?

- y’+f(x)y=g(x)
- => I.y’ +f(x).I.y = I.g(x)
- By picking I = e
^{∫f(x)dx}, we have I’=f(x).I, - => (1/I).I’=f(x)
- => ∫1/I dI = ∫f(x) dx
- => ln(I)= ∫f(x) dx
- => I=e
^{∫f(x) dx}

This method was developed by Leonard Euler around 1730 (the separating variables method had previously been developed by his teacher, Johann Bernoulli).

**Worked Examples**

- Find the general solution of the differential equation:
- Find the general solution of the differential equation: for x≠0
- Solve the differential equation for x≠0
- Find the particular solution of that satisfies the condition y=1 when x=2.

**Exercise**

**Answers**

**Second Order ODEs**

Consider ay’’+by’+cy=0

It is a linear combination of multiples of a function, its first derivative and its second derivative.

For these terms to all cancel out, we need a function whose first derivative and second derivative has the same form as the function itself. Which functions are suitable?

Putting in suitable constants, we take the function: y=Ae^{tx}

So y’=Ate^{tx} and y’’=At^{2}e^{tx}

So ay’’+by’+cy = aAt^{2}e^{tx}+bAte^{tx}+cAe^{tx} = 0

Notice that Ae^{tx }factors out, so we have at^{2}+bt+c=0. We call this the **auxiliary equation** for the ODE and its solutions give us the ODE’s solutions

How many solutions can there be to the auxiliary equation at^{2}+bt+c=0?

- Suppose there are two solutions, t
_{1}and t_{2}. Then both the solutions y=Ae^{t1x }and y=Be^{t1x}(for arbitrary constants A and B) are solutions to the ODE. We can say in general that the linear combination of these: y=Ae^{t1x }+ Be^{t1x }is the general solution to the ODE. - Suppose there is one repeated solution, t
_{0}. Then y=(A+Bx)e^{t0x }is the general solution to the ODE.

Why is the solution in this form?

Consider y’’-4y’+4y=0, with AE: (t-2)^{2}=0.

Clearly y=Ae^{2x} is one solution. We know there should be another solution (and another arbitrary constant, so we can write y=f(x)e^{2x} and try to find out the function f(x))

- y = fe
^{2x } - => y’= f’e
^{2x}+2fe^{2x } - => y’’=f’’e
^{2x}+2f’e^{2x}+2f’e^{2x}+4fe^{2x }= f’’e^{2x}+4f’e^{2x}+4fe^{2x} - If we substitute these into our ODE, y’’-4y’+4y=0, we get:
- y’’-4y’+4y=0
- (f’’e
^{2x}+4f’e^{2x}+4fe^{2x}) – 4(f’e^{2x}+2fe^{2x })+4fe^{2x}=0 - =>f’’=0
- => f’=c
- => f=cx+b. Which is why we use this form
- This method was derived by D’Alembert around 1750.

But what if the solution is complex?

Then y=Ae^{(a+bi)x}+Be^{(a-bi)x}

So y=e^{ax}(Ae^{(bi)x}+Be^{(-bi)x})

y=e^{ax}(Ae^{(bi)x}+Be^{(-bi)x})

We can simplify this using Euler’s Formula: e^{ix}=cosx+isinx

So y=e^{ax}(Ae^{b}(cosx+isinx)+Be^{b}(cosx-isinx))

Gathering the cosines and sines together, we have: y=e^{ax}((cosx(Ae^{b}+Be^{-b})+sinx(Ae^{b}i-Be^{-b}i))

Which is simply y=e^{ax}(Pcosx+Qsinx)

So, in general, we use the ODE to form the **auxiliary equation** and solve the auxiliary equation to find the **general solution** from the above.

We can then use **initial conditions** or **boundary conditions** to find out the **particular solution **(i.e. without any arbitrary constants)

**Worked Examples**

- Find the particular solution of subject to the conditions y=0 and when x=0
- Find the particular solution of the equation subject to the conditions z = 0 and when t=0
- Find the particular solution of the differential equation which satisfies the initial conditions y=0 and when x=0

**Exercise**

**Answers**

**Homegeniety**

Have you noticed that for all of our second order differential equations, the right hand side of the equation was equal to zero?

What should we do if this isn’t the case? i.e. if the equation is **non-homogenous**?

First we should note that adding the general solution to the related homogenous equation to our solution will not change the solution (because it gives zero when put in the equation).

So our general solution to a non-homogenous equation will be of the form GS=CF+PI, where the solution to the related non-homogenous equation is called the **complementary function**.

We find the **particular integral** relevant to the RHS of the equation by using a **trial function**, which is essentially a guess at the solution in the correct form, with constants in to be determined.

**How to find the Particular Integral**

Note that we need both trigonometric functions in our trial function because of the way differentiation cycles through these functions.

**Special cases**

In some differential equations the function on the right-hand-side has the same form as one of the complementary functions. For example, the complementary function of the differential equation is and e^{3x} occurs on the right hand side. In this situation it is no good using the trial function ae^{3x}, since upon substituting y=ae^{3x}, and into the differential equation, you obtain 9ae^{3x}-5(3ae^{3x})+6(ae^{3x})=4e^{3x} => 0=4e^{3x} and so clearly this trial function doesn’t work. Instead we use as a trial function.

This illustrates a general rule. If the function on the right-hand-side of the differential equation has exactly the same form as one of the complementary functions, you multiply the usual trial function by the independent variable to give a new trial function. In order to recognise these special cases when they arise, it is worth getting into the habit of finding the complementary function before the particular integral.

**Worked Example**

- Find the particular integral of the differential equation ;
- Find the general solution of the differential equation

**Exercise** (Do questions 1-3 and 5-9)

**Solutions**

**Substitution methods for ODEs. Form: f(y/x)**

If an ODE is of the form y’=f(y/x) we can use the substitution y=ux, which replaces y/x with u and y’ with u’x+x, giving an equation in separable form.

**Worked Example**

Solve the differential equation

**Substitution methods for second order ODEs**

We can often use a substitution u=yx (where y is a function of x, to simplify a second order ODE (exam questions may give a specific alternate substitution).

If u=yx, then u’ = y’x+y and u’’=y’’x+2y’. We can rearrange these to put y in terms of u before substitution into an equation.

**Worked Example**

Solve xy’’+2(1-x)y’-(2+3x)y=e^{2x,} by using the substitution u=yx

**Substitutions which introduce a new variable**

We can solve x^{2}y’’+4xy’+2y=lnx by introducing x=e^{t}

Then we use the fact that

And that

**Exercise**

**Notes for exams**

With substitutions suggested in an exam, there is normally one way to have the substitution that is easier to differentiate (normally it is given in this form). After differentiating it the easy way, algebra can be used to rearrange it into the form needed to substitute.

**General Exercise**

**Answers**