1. ## Secondorder Differential equation

Aloha!

I have given an inhomogen DE as:
$\displaystyle n>=1$

$\displaystyle X_{n+2}-X_{n+1}+\frac{1}{4}X_{n} = n+4$

Trying to find the general $\displaystyle X^h_{n}$ solution to the associated homogen DE and the special solution $\displaystyle X^s_{n}$ which satisfies the inhomogen DE

The general $\displaystyle X^h_{n}$:
Characteristic eqation is
$\displaystyle r^2-r+\frac{1}{4}$

Which gives $\displaystyle x = 0.5$

$\displaystyle X_{n} = C \frac{1}{2}^n+Dn \frac{1}{2}^2 = \frac{1}{2}C+ \frac{1}{2}nD$ where $\displaystyle C,D$ ∈ $\displaystyle \mathbb{R}$

Correct so far?

Any help is greatly appriciated!

2. Originally Posted by jokke22
Aloha!

I have given an inhomogen DE as:
$\displaystyle n>=1$

$\displaystyle X_{n+2}-X_{n+1}+\frac{1}{4}X_{n} = n+4$

Trying to find the general $\displaystyle X^h_{n}$ solution to the associated homogen DE and the special solution $\displaystyle X^s_{n}$ which satisfies the inhomogen DE

The general $\displaystyle X^h_{n}$:
Characteristic eqation is
$\displaystyle r^2-r+\frac{1}{4}$

Which gives $\displaystyle x = 0.5$

$\displaystyle X_{n} = C \frac{1}{2}^n+Dn \frac{1}{2}^2 = \color{red}{\frac{1}{2}C+ \frac{1}{2}nD}$ where $\displaystyle C,D$ ∈ $\displaystyle \mathbb{R}$

Correct so far?

Any help is greatly appriciated!
A couple of things - first off, these are difference equations not differential equations. Second, your particluar solution is correct, i.e.

$\displaystyle X_{n} = C \left(\frac{1}{2}\right)^n+Dn \left(\frac{1}{2}\right)^n$ (I'm assuming a typo on the second power) but not the second part, in red.

As for a particular solution, try $\displaystyle X_n = an + b$ and see if you can find an $\displaystyle a$ and $\displaystyle b$ to recover the RHS.

3. Originally Posted by danny arrigo
A couple of things - first off, these are difference equations not differential equations. Second, your particluar solution is correct, i.e.

$\displaystyle X_{n} = C \left(\frac{1}{2}\right)^n+Dn \left(\frac{1}{2}\right)^n$ (I'm assuming a typo on the second power) but not the second part, in red.

As for a particular solution, try $\displaystyle X_n = an + b$ and see if you can find an $\displaystyle a$ and $\displaystyle b$ to recover the RHS.
Yeah, I see it now! Good of you to clear that up!
Will do and see what I come up with!

Yeah, I sometimes mess up the right word since its not in english and use similar but not similar in english! Thanks for the correction though!

Appriciate the help!

4. A bit late answer here but If you Danny or someone else could help me out it would be great...

This is what I've got:
$\displaystyle X_{n} = C \left(\frac{1}{2}\right)^n+Dn \left(\frac{1}{2}\right)^n$ (I'm assuming a typo on the second power) but not the second part, in red.

$\displaystyle X_n = an+b$

$\displaystyle = A(n+2)+B-\frac{1}{2}(A(n+1)+B)+\frac{1}{2}(An+B)$

Which I get to be
$\displaystyle An+ 1.5A + B$

Solving this equation would give me? Confused since I think I've done it wrong...

Appreciate all the help I can get!

5. As for a difference equation given at

$\displaystyle Y''-Y'+\frac{1}{4}Y = x-4$

Gives the Characteristic equation as

$\displaystyle r^2-r+\frac{1}{4}$

Which gives $\displaystyle x = 0.5$

Which gives

$\displaystyle Y_{n} = C \left(\frac{1}{2}\right)^n+Dn \left(\frac{1}{2}\right)^n$

Which again gives by $\displaystyle X_n = an + b$

$\displaystyle = A(n+2)+B-\frac{1}{2}(A(n+1)+B)+\frac{1}{2}(An+B)$

= $\displaystyle An+ 1.5A + B$

Just the same except when I'm going to find the solution which combines the general and special solution?

6. Originally Posted by jokke22
As for a difference equation given at

$\displaystyle Y''-Y'+\frac{1}{4}Y = x\color{red}{-4}$

Gives the Characteristic equation as

$\displaystyle r^2-r+\frac{1}{4}$

Which gives $\displaystyle x = 0.5$

Which gives

$\displaystyle Y_{n} = C \left(\frac{1}{2}\right)^n+Dn \left(\frac{1}{2}\right)^n$

Which again gives by $\displaystyle X_n = an + b$

$\displaystyle = A(n+2)+B - \frac{1}{2} (A(n+1)+B)+\frac{1}{2}(An+B) \;\color{blue}{*}$

= $\displaystyle An+ 1.5A + B$

Just the same except when I'm going to find the solution which combines the general and special solution?
Not sure of the red term - the - 4. Your earlier post had a +4. Not sure why you have the 1/2's *. Picking it up here

$\displaystyle a(n+2)+b -\left(a(n+1)+b\right) - \frac{1}{4}(an+b) = n+4$

expanding gives

$\displaystyle \frac{a n}{4} + a - \frac{3b}{4} = n+4$

so comparing the n terms gives that $\displaystyle a = 4$ and the remaining terms that $\displaystyle a - \frac{3b}{4} = 4$ so $\displaystyle b = 0$ so $\displaystyle Xp_n = 4n$.

7. Originally Posted by danny arrigo
Not sure of the red term - the - 4. Your earlier post had a +4. Not sure why you have the 1/2's *. Picking it up here

$\displaystyle a(n+2)+b -\left(a(n+1)+b\right) - \frac{1}{4}(an+b) = n+4$

expanding gives

$\displaystyle \frac{a n}{4} + a - \frac{3b}{4} = n+4$

so comparing the n terms gives that $\displaystyle a = 4$ and the remaining terms that $\displaystyle a - \frac{3b}{4} = 4$ so $\displaystyle b = 0$ so $\displaystyle Xp_n = 4n$.
Thanks for clearing things up, as you mention the $\displaystyle -4$ is there because its a different equation than the original one... Sorry for mixing things up, will post new If I can't get it right.

As for the original
This is what I've got:
$\displaystyle X_{n} = C \left(\frac{1}{2}\right)^n+Dn \left(\frac{1}{2}\right)^n$ (I'm assuming a typo on the second power) but not the second part, in red.

$\displaystyle X_n = an+b$

$\displaystyle = A(n+2)+B-\frac{1}{2}(A(n+1)+B)+\frac{1}{2}(An+B)$

Which I get to be
$\displaystyle An+ 1.5A + B$

This is then wrong and should be:

$\displaystyle \frac{a n}{4} + a - \frac{3b}{4} = n+4$

$\displaystyle a = 4$ and the remaining terms that $\displaystyle a - \frac{3b}{4} = 4$ so $\displaystyle b = 0$ so $\displaystyle Xp_n = 4n$

Correct?

8. Originally Posted by jokke22
Thanks for clearing things up, as you mention the $\displaystyle -4$ is there because its a different equation than the original one... Sorry for mixing things up, will post new If I can't get it right.

As for the original
This is what I've got:
$\displaystyle X_{n} = C \left(\frac{1}{2}\right)^n+Dn \left(\frac{1}{2}\right)^n$ (I'm assuming a typo on the second power) but not the second part, in red.

$\displaystyle X_n = an+b$

$\displaystyle = A(n+2)+B-\frac{1}{2}(A(n+1)+B)+\frac{1}{2}(An+B)$

Which I get to be
$\displaystyle An+ 1.5A + B$

This is then wrong and should be:

$\displaystyle \frac{a n}{4} + a - \frac{3b}{4} = n+4$

$\displaystyle a = 4$ and the remaining terms that $\displaystyle a - \frac{3b}{4} = 4$ so $\displaystyle b = 0$ so $\displaystyle Xp_n = 4n$

Correct?
Yep and if the problem was

$\displaystyle x_{n+2} + x_{n+1} - \frac{1}{4} x_n = n - 4$ as you said then

$\displaystyle \frac{a n}{4} + a - \frac{3b}{4} = n-4$

so $\displaystyle a = 4$ still but $\displaystyle a - \frac{3b}{4} = - 4$ which would give a diffferent $\displaystyle b$.

Hope that helps.

9. Thanks a bunch!

It helps a LOT!

To verify.

The general solution would then be:

$\displaystyle X_{n} = C \left(\frac{1}{2}\right)^n+Dn \left(\frac{1}{2}\right)^n +4_n$

And if you were to give these initial condition as
$\displaystyle x_o = 0, x_1 = 5$

Just replace $\displaystyle X_0$ and $\displaystyle X_1$ with $\displaystyle _n$ and calculate?

10. Originally Posted by danny arrigo
Yep and if the problem was

$\displaystyle x_{n+2} + x_{n+1} - \frac{1}{4} x_n = n - 4$ as you said then

$\displaystyle \frac{a n}{4} + a - \frac{3b}{4} = n-4$

so $\displaystyle a = 4$ still but $\displaystyle a - \frac{3b}{4} = - 4$ which would give a diffferent $\displaystyle b$.

Hope that helps.
What would the $\displaystyle b$ actually be in this case?

11. Originally Posted by jokke22
What would the $\displaystyle b$ actually be in this case?
Just substitute $\displaystyle a = 4$ into $\displaystyle a - \frac{3b}{4} = -4$ and solve for b
Spoiler:
$\displaystyle b = \frac{32}{3}$