# DE of second order

1. Jan 9, 2014

### YassinA

Reading my first calculus course at my first semester as an "Computer Engineer". In Sweden it's called "Single Variable Calculus".

I have my first exams next week and i have been solving differents of DE's.

y'-3y'+2y = 2ex

But now i have encountered a problem in my "partikulär lösning", z'' -z' = 2.
Before when i just had z'' = 2, i could integrate it twice and get my solution.

Sorry for my ignorance, im totally new and i hope i have formulated my question good.

2. Jan 9, 2014

### vanhees71

I guess, you want to solve the differential equation
$$z''-z'=2?$$
For the other one above open another thread. It's easier to just follow one question at once :-).

This is a 2nd-order linear differential equation with constant coefficients. There's a theorem telling you that its general solution is given by the sum of one special solution of the inhomogeneous equation and the general solution of the homogeneous one. Usually one starts with the latter, i.e.,
$$z''-z'=0.$$
The standard ansatz for such equations is
$$z(x)=C \exp(\lambda x).$$
Plugging this into the equation, you get
$$C \exp(\lambda x) (\lambda^2-\lambda)=0.$$
If $C \neq 0$ we must have
$$\lambda^2-\lambda=0 \; \Rightarrow \; \lambda_1=0, \quad \lambda_2=1.$$
Thus the general solution of the homogeneous equation is
$$z(x)=C_1+C_2 \exp x.$$
Then you need a special solution of the inhomogeneous equation.

To that end we first integrate it once, leading to
$$z'-z=2x.$$
Here we don't need to add a constant in integrating, because it's enough to find just one solution, and we don't need the most general one.

The next idea is that a solution of this equation should be of the form
$$z(x)=A x + B$$
since the right-hand side of the equation looks like it (ansatz of the type of the right-hand side). Plugging this ansatz in, we get
$$A-(A x +B)=2x$$
Comparing the coefficients of powers of $x$ on both sides, gives
$$A=-2, \quad A-B=0 \; \Rightarrow B=A=-2.$$
Thus the general solution of the inhomogeneous equation is given by is given by
$$z(x)=-2x + C_1 + C_2 \exp x.$$
Here, I've lumped the constant part $-2$ of the particular solution of the homogeneous equation into the general integration constant $C_1$.

3. Jan 9, 2014

### YassinA

vanhees71, thanks for your reply. I maybe formulated my question wrong, concerning the first question above. I needed to find an "general solution for y'-3y'+2y = 2ex".

And this general solution do i get by the theorom "the sum of "the sum of one special solution of the inhomogeneous equation and the general solution of the homogeneous one".

But in my notes it stands that i get the general solution by the sum of the homogeneous and the "particulate"(partikulär in swedish). Is the "particulate" the same as the inhomogeneous but used as different correspondings??

And if i have an equation z′′−z = C or an variable, should i always integrate it once before i can see which solution i might have?

4. Jan 9, 2014

### HallsofIvy

Staff Emeritus
You have twice written "$y'- 3y'+ 2y= 2e^x$" but that can't be right. If that were what you meant, you would have written -2y' rather than "y'- 3y'". Besides, this is titled "DE of second order". I suspect you meant $y''- 3y'+ 3y= 2e^x$.

A "particular" solution (a "particulate solution" is a chemical solution that has little particles in it!) is any one function that satisfies the entire equation. That, added to the general function of the associated homogeneous equation gives the general solution to the entire equation.

Here, using the method vanhees71 gives, you would get the "characteristic equation" $r^2- 3r+ 2= (r- 1)(r- 2)= 0$ so that r= 1 and 2 and the general solution to the homogenous solution is $Ce^x+ De^{2x}$.

Now it is generally true that if the "right hand side" (here, $2e^x$ is of the form we expect for a solution of a homogenous equation (exponentials, sine and cosine, powers of x, and products of those) then a "particular solution" will be of the same kind. (If right hand side is NOT of that form, say is $\sqrt{x}$, tan(x), or log(x)) we would have to use a more general, and typically harder method, "variation of parameters".)

So we would look for a solution of the form $y= Ae^x$. But that is already a solution to the homogeneous equation so will give 0 no matter what A is. Instead we try $y= Axe^x$. Then $y'= Ae^x+ Axe^x$ and $y''= 2Ae^x+ Axe^x$. Putting those into the equation, we have $2Ae^x+ Axe^x- 3Ae^x- 3Axe^x+ 2Axe^x= -2Ae^x= 2e^x$ (notice that all terms of the form $xe^x$ cancel. That is precisely because $e^x$ itself satisfies the homogenous equation.) so that A= -1. The "specific solution" is $y= -xe^x$ and the general solution to the entire equation is $y= Ce^x+ De^{2x}- xe^x$.

5. Jan 9, 2014

### vanhees71

I see. The other equation is solved in the same way as the example before. In German we also say "partikuläre Lösung", which just is a synonymon for "special solution".

So for a linear differential equation you get the general solution always as the sum of a special solution of the inhomogeneous equation and the general solution of the homogeneous one.

The solutions of the homogeneous equation build a vector space of functions with the dimension given by the order of the linear differential equation. Thus for a 2nd-order equation you need to linearly independent solutions.

So let's solve also this example. I guess the correct equation is
$$y''-3 y' + 2y=2 \exp x,$$
because you said it's a 2nd order ODE.

Start with the homogeneous equation. Since it's an equation with constant coefficients we make the standard ansatz (which ansatz to use you have to learn by doing a lot of examples):
$$y(x)=C \exp(\lambda x).$$
Putting this into the homogeneous equation gives after some algebra
$$\lambda^2-3 \lambda + 2 =0.$$
The two solutions of this equation are
$$\lambda_{1,2}=\frac{3}{2} \pm \sqrt{\frac{9}{4}-1}=\frac{3}{2} \pm \frac{1}{2},$$
i.e.,
$$\lambda_1=2, \quad \lambda_2=1.$$
These are two different roots, and thus the ansatz gives two linearely independent solutions. The general solution of the homogeneous equation thus is
$$y(x)=C_1 \exp(2 x)+C_2 \exp x.$$
Now we need a special solution of the inhomogeneous equation.

Here we make the ansatz
$$y(x)=z(x) \exp x,$$
because the right-hand side is proportional to $\exp x$, but since this is a solution of the homogeneous equation, you cannot simply make this ansatz. So we introduce an additional unknown function as a factor ("variation of the constant"). Plugging this into the inhomogeneous equation gives after some algebra
$$z''(x)-z'(x)=2,$$
and this was the equation we solved before. Again we only need one solution, which is
$$z(x)=-2x,$$
as I've shown in the previous posting.

So finally the general solution of the inhomogeneous equation is
$$y(x)=-2x \exp x + C_1 \exp x+C_2 \exp(2 x).$$

Now, after I've solved two examples for you, I recommend to post further questions on such problems to the homework section, where you don't get simply the solution but some guidance towards finding it yourself, which is much better to learn the techniques!

6. Jan 9, 2014

### YassinA

Hallsofly, vanhees71, thanks for the replies and making it much easier to understand what i am doing!