1. ## Secondorder Differential equation

Aloha!

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

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

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

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

Which gives $x = 0.5$

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

Correct so far?

Any help is greatly appriciated!

2. Originally Posted by jokke22
Aloha!

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

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

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

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

Which gives $x = 0.5$

$X_{n} = C \frac{1}{2}^n+Dn \frac{1}{2}^2 = \color{red}{\frac{1}{2}C+ \frac{1}{2}nD}$ where $C,D$ $\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.

$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 $X_n = an + b$ and see if you can find an $a$ and $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.

$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 $X_n = an + b$ and see if you can find an $a$ and $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:
$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.

$X_n = an+b$

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

Which I get to be
$
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

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

Gives the Characteristic equation as

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

Which gives $x = 0.5$

Which gives

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

Which again gives by $X_n = an + b$

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

= $
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

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

Gives the Characteristic equation as

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

Which gives $x = 0.5$

Which gives

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

Which again gives by $X_n = an + b$

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

= $
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

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

expanding gives

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

so comparing the n terms gives that $a = 4$ and the remaining terms that $a - \frac{3b}{4} = 4$ so $b = 0$ so $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

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

expanding gives

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

so comparing the n terms gives that $a = 4$ and the remaining terms that $a - \frac{3b}{4} = 4$ so $b = 0$ so $Xp_n = 4n$.
Thanks for clearing things up, as you mention the $-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:
$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.

$X_n = an+b$

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

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

This is then wrong and should be:

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

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

Correct?

8. Originally Posted by jokke22
Thanks for clearing things up, as you mention the $-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:
$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.

$X_n = an+b$

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

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

This is then wrong and should be:

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

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

Correct?
Yep and if the problem was

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

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

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

Hope that helps.

9. Thanks a bunch!

It helps a LOT!

To verify.

The general solution would then be:

$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
$x_o = 0, x_1 = 5$

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

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

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

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

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

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

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