# What's wrong in this method of solving a difference equation?

Consider:

$$y_{n+1} = 2y_n + 1$$

To solve this I think I need to find "any" one particular solution and add it to a homogeneous solution.

A homogeneous solution is $2^ny_0$

For a particular solution, if I substitute $y_n = an$, $$a(n+1) = 2an + 1 > \implies a = \dfrac{1}{1-n}$$

This gives the complete solution as $$y_n = \color{red}{\dfrac{n}{1-n}}+2^ny_0$$

However for a particular solution, if I substitute $y_n=b$, I get $$b=2b+1 \implies b=-1$$

This gives the complete solution as $$y_n=\color{red}{-1}+2^ny_0$$

These two solutions seem to be very different. I don't see where I've made an error.

Any particular solution will work in the complete solution, right?

If so, why the the two particular solutions above gave seemingly different general solutions?

There's no particular solution of the form $y_n = an$, since, assuming $a$ is constant, you found that $a$ must satisfy $a=1/(1-n)$, contrary to the assumption that $a$ is constant.

Note that $a=1/(1-n)$ is not constant so there is no particular solution of the form $y_n=an$. On the other hand there is one of the form $y_n=b$ with $b=-1$ (which does not depend on $n$).

• Oh so the error was that $a$ became a function of $n$, contradicting my starting assumption. I somewhat get this.. I wonder if this is like dividing by $0$ sort of mistake... I'll think a bit and get back. Thanks to both of you :) – rsadhvika Jun 21 '18 at 8:48
• Yes, exactly. I don't think that this error is so bad as dividing by 0. ;-) – Robert Z Jun 21 '18 at 8:53
• But still $y_n=-1+2^n y_0$ is not correct, e.g. for $n=0$. – Miguel Jun 21 '18 at 18:13

I think where you really went wrong is this:

You wrote that, if $y_n = an$, then $a = \frac{1}{1 - n}$. But the assumption $y_n = an = \frac{n}{1-n}$ is false to begin with, so the fact that you derived something from a false assumption means nothing.

Now why is the assumption false?

Well1, according to your assumption $y_n = an$ we have $$y_n = \frac{n}{1-n}$$ right? So plug that into the original equation. Does it work?

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

Remember, this is implied by your assumption. But this only holds for $n = -1$.

In other words, it won't work for any other $n$ than $-1$... neither $-2$, nor $0$, nor $1$, etc...

So your assumption that $y_n=an$ holds for all $n$ contradicts itself, hence it cannot be true.

1 Someone else contended that you derived this incorrectly too, but that's a math error separate from what I'm trying to show, which is the mistake in your reasoning. I just assume you did the math right and show where the logic went wrong.

• I don't think this is accurate. If we allow $a$ to depend on $n$, then the assumption doesn't lead to a contradiction (namely set $a=\frac{-1}n$). The mistake is going from $y_n=an$ to $y_{n+1}=a(n+1)$ (with the same $a$). – stewbasic Jun 22 '18 at 1:25
• @stewbasic: The OP's assumption was $a = 1/(1-n)$, not $a=-1/n$. – Mehrdad Jun 22 '18 at 1:27
• The OP's assumption was just $y_n=an$, from which $a=1/(1-n)$ was derived. The other answers interpret the assumption as implicitly including "where $a$ is independent of $n$" (in which case the assumption leads to a contradiction). If we interpret the assumption as "$y_n=an$, where $a$ may depend on $n$", this does not lead to a contradiction, but the derivation of $a=1/(1-n)$ is faulty. – stewbasic Jun 22 '18 at 1:30
• @stewbasic: I guess you're trying to find the mistake in his solution (i.e. "if he had wanted to solve it, what should he have done?") whereas I'm trying to find the mistake in his logic (i.e. take whatever he said as true and show that it contradicts itself). I figured the latter was more appropriate since he asked what is wrong with this solution method (I took that to be different from "why isn't this the correct solution") but you can always post another answer regarding that aspect if you want and see if he finds that more helpful... – Mehrdad Jun 22 '18 at 1:39
• @stewbasic: I updated my answer though, to make it less confusing. Thanks for the feedback. – Mehrdad Jun 22 '18 at 1:44

Homogeneous solution is $2^ny_0$

No, the general homogeneous solution is $\,C \cdot 2^n\,$ for some constant $\,C\,$.

This gives the complete solution as $\quad y_n=\color{red}{-1}+2^ny_0$

Except this doesn't work if you try it for $\,n=0\,$ or $\,n=1\,$. See note above why.

Instead, you should get that $\,y_n = -1 + C \cdot 2^n\,$, where the constant $\,C\,$ is determined from the initial condition $\,y_0 = -1 + C \cdot 2^0 \iff C = y_0+1\,$

To solve this I think I need find "any" one particular soln and add it to homogeneous solution.

Alternatively, you can solve it directly by rewriting the recurrence as $\,y_{n+1}+1=2\left(y_n+1\right)\,$. It follows that $\,y_n+1\,$ is a geometric progression, and therefore $\,y_n+1 = 2^n(y_0+1)\,$, so $\,y_n=\ldots\,$

The problem is that $a$ is a function of n:

$$y_n = a_nn$$ $$a_{n+1}(n+1) = 2a_nn + 1$$ $$a_{n+1}n+a_{n+1} = 2a_nn + 1$$ $$a_{n+1}n-2a_nn+a_{n+1}=1$$ $$(a_{n+1}-2a_n)n+a_{n+1}=1$$

From here, you can't combine $a_{n+1}-2a_n$ into just $-a$.