# If f(x)=f(x-1)+5x and f(1)=2 then how to find f(20)?

#### AlphaCentauri

##### New member
If f(x)=f(x-1)+5x and f(1)=2 then how to find f(20)?

#### Subhotosh Khan

##### Super Moderator
Staff member
If f(x)=f(x-1)+5x and f(1)=2 then how to find f(20)?
Easy but long way:

f(2) = f(1) + 5 * 2 = 12 ........ [edited .... Thanks Jeff]

f(3) = f(2) + 5 * 3 = ?

and continue.....

There are other methods - what method have you been taught?

Last edited:

#### MarkFL

##### Super Moderator
Staff member
I would treat it as a linear inhomogeneous difference equation to get the closed form for $$\displaystyle f(x)$$.

#### MarkFL

##### Super Moderator
Staff member
Another method would be to observe:

$$\displaystyle \displaystyle f(x)=f(1)+5\sum_{k=2}^{x}(k)=5\sum_{k=1}^{x}(k)+(f(1)-5)=\,?$$

#### TomHE

##### New member
I would treat it as a linear inhomogeneous difference equation to get the closed form for $$\displaystyle f(x)$$.
Expanding on MarkFL's suggestion, $$\displaystyle f(x) = f(x-1) + 5x, \; f(1)=2$$ yields the recursively defined sequence:
$$\displaystyle a_n = a_{n-1} + 5n$$ whose first term is $$\displaystyle a_1 = 2$$. Note that $$\displaystyle f(n) = a_n$$ when $$\displaystyle n$$ is a natural number.
With the goal of finding a closed form formula for $$\displaystyle a_n$$ in mind, the first few terms are:
$$\displaystyle a_1 = 2$$
$$\displaystyle a_2 = a_1 + 5 \cdot 2$$
$$\displaystyle a_3 = a_2 + 5 \cdot 3 = (a_1 + 5 \cdot 2) + 5 \cdot 3 = a_1 + 5(2 +3)$$
$$\displaystyle a_4 = a_3 + 5 \cdot 4 = (a_1 + 5(2 +3)) + 5 \cdot 4 = a_1 + 5(2+3+4)$$
By inspection, a formula (whose validity can be proved by an induction argument) for $$\displaystyle a_n$$ in terms of $$\displaystyle a_1$$ and $$\displaystyle n$$ is:
$$\displaystyle a_n = a_1 + 5(2 + 3 + \cdots + n)$$
A closed form formula for $$\displaystyle a_n$$ can be derived from the identity $$\displaystyle 1+2+\cdots+n=\frac{n(n+1)}2$$ and the fact that $$\displaystyle a_1 = 2$$.