# Thread: Second-Order Linear Non Homogeneous ODE with Constant Coefficients

1. ## [SOLVED] Second-Order Linear Non Homogeneous ODE with Constant Coefficients

Here it is:
$
\frac{d^2y}{dx^2}+6\frac{dy}{dx}+25y=-292sin(4x)
$

So the auxiliary/characteristic equation will look like:
$
r^2+6r+25=0
$

Solving that gives:
$
r^2+6r+25=0
$

$
r = 3\pm4i
$

And so we'll get the following general homogeneous solution:
$
GS(H) = e^{3x}(Acos(4x)+Bsin(4x))
$

So now I try to find the particular non homogeneous solution, trying:
$
y_P = \alpha xcos(4x)+\beta xsin(4x)
$

Finding the first and second derivative of y particular:
$
y_P' = \alpha cos(4x) - 4\alpha xsin(4x) + \beta sin(4x) + 4\beta xcos(4x)
$

$
y_P'' = -8\alpha sin(4x) + 8\beta cos(4x) - 16\alpha xcos(4x) - 16\beta xsin(4x)
$

Then, when I try to compile all of this, to then equate coefficients and solve for alpha and beta, I realise that the x terms do not cancel out (as they should) and I cannot go any further (I don't think).

It will eventually look like this:
$
-8\alpha sin(4x) + 8\beta cos(4x) - 16\alpha xcos(4x) - 16\beta xsin(4x)
$

$
+ 6\alpha cos(4x) - 24\alpha xsin(4x) + 6\beta sin(4x) + 24\beta xcos(4x)
$

$
+ 25\alpha xcos(4x) + 25\beta xsin(4x) = -292sin(4x)
$

Have I made an error somewhere?

Any help is appreciated.

NB: It may/may not help, but in the previous part of the question we've already proved that when:
$
x=0, \frac{dy}{dx}=-2
$

2. Originally Posted by yianni
Here it is:
$
\frac{d^2y}{dx^2}+6\frac{dy}{dx}+25y=-292sin(4x)
$

So the auxiliary/characteristic equation will look like:
$
r^2+6r+25=0
$

Solving that gives:
$
r^2+6r+25=0
$

$
r = 3\pm4i
$

And so we'll get the following general homogeneous solution:
$
GS(H) = e^{3x}(Acos(4x)+Bsin(4x))
$

So now I try to find the particular non homogeneous solution, trying:
$
y_P = \alpha xcos(4x)+\beta xsin(4x)
$
Why is the trial particular solution not:

$y_P = \alpha \cos(4x)+\beta \sin(4x)$

CB

3. Originally Posted by yianni
Here it is:
$
\frac{d^2y}{dx^2}+6\frac{dy}{dx}+25y=-292sin(4x)
$

So the auxiliary/characteristic equation will look like:
$
r^2+6r+25=0
$

Solving that gives:
$
r^2+6r+25=0
$

$
r = 3\pm4i
$

And so we'll get the following general homogeneous solution:
$
GS(H) = e^{3x}(Acos(4x)+Bsin(4x))
$

So now I try to find the particular non homogeneous solution, trying:
$
y_P = \alpha xcos(4x)+\beta xsin(4x)
$
I suspect you put that "x" multiplying the sine and cosine in because you saw "(A cos(4x)+ Bsin(4x))" in the homogeneous solution. However, you really have $e^{3x}cos(4x)$ and $e^{3x}sin(4x)$ which are NOT equivalent to "cos(4x)" and "sin(4x)". More simply, the solutions to you characteristic equation are 3+ 4i and 3- 4i while just sin(4x) and cos(4x) correspond to 4i and -4i- quite different solutions.

Finding the first and second derivative of y particular:
$
y_P' = \alpha cos(4x) - 4\alpha xsin(4x) + \beta sin(4x) + 4\beta xcos(4x)
$

$
y_P'' = -8\alpha sin(4x) + 8\beta cos(4x) - 16\alpha xcos(4x) - 16\beta xsin(4x)
$

Then, when I try to compile all of this, to then equate coefficients and solve for alpha and beta, I realise that the x terms do not cancel out (as they should) and I cannot go any further (I don't think).

It will eventually look like this:
$
-8\alpha sin(4x) + 8\beta cos(4x) - 16\alpha xcos(4x) - 16\beta xsin(4x)
$

$
+ 6\alpha cos(4x) - 24\alpha xsin(4x) + 6\beta sin(4x) + 24\beta xcos(4x)
$

$
+ 25\alpha xcos(4x) + 25\beta xsin(4x) = -292sin(4x)
$

Have I made an error somewhere?

Any help is appreciated.

NB: It may/may not help, but in the previous part of the question we've already proved that when:
$
x=0, \frac{dy}{dx}=-2
$

4. Ah, I see my mistake.

Thanks guys; solved.