Recursive to Explicit form: $f(1) = 40, f(n) = 3 × f(n − 1) − 90$ So here I have a problem that appeared on my homework recently. The task was to find the value of the function at 10, but I really didn't want to do that(too tedious). I tried to find a method to convert it into an explicit so that I could solve it easier but to no avail. My school taught me a formula to use to form explicit functions($f(1)=A, f(n)=f(n-1)+B \text{, then, }f(n)=A+B(n-1)$), but nowhere could I find a way to solve with a coefficient(I was also very tired). In the end, I gave in and solved it by hand, but the question still remained. If anyone could help me understand(ideally at a middle school level lol), that'd be great!
 A: Define $g(n)=f(n)-45$. You have:
$$f(n)=3f(n-1)-90=3f(n-1)-135+45$$
$$f(n)-45=3(f(n-1)-45) \implies g(n)=3g(n-1)$$
Now, can you find $g(1)$? Can you find $g(10)$? What about $f(10)$?
A: Let $f(1)=a$ and $f(n)=bf(n-1)+c$.
Then $f(2)=ab+c \implies f(3)=b(ab+c)+c=b^2 a+(b+1)c \implies f(4)= b^3 a +(b^2+b+1)c$.
Therefore we can say that $f(n)=b^{n-1}a+(1+b+b^2+\cdots+b^{n-2})c$.
$\therefore f(n)=b^{n-1}a+\left(\displaystyle\frac{b^{n-1}-1}{b-1}\right)c$.
Now put $a=40,b=3,c=-90$.
A: I'll solve the general form:(I am fond of writing $a_n$ in recurrence relations, so I will write $a_n$ instead of $f(n)$)
$$a_1=A,\quad a_n=Ba_{n-1}+C$$
First, expand $a_n$:
\begin{align}
a_n=Ba_{n-1}+C&=B^2a_{n-2}+BC+C\\
&=B^3a_{n-3}+B^2C+BC+C\\
&=B^4a_{n-4}+B^3C+B^2C+BC+C\\
&=B^5a_{n-5}+B^4C+B^3C+B^2C+BC+C\\
&=\dots
\end{align}
In general, the expansion at the $k$th step is:
$$a_n=B^ka_{n-k}+C(B^{k-1}+B^{k-2}+...+B^2+B+1)$$
You would probably know that(if you don't know, mention in the comments, I will edit the question and mention the proof):
$$B^{k-1}+B^{k-2}+...+B^2+B+1=\frac{B^k-1}{B-1}$$
So:
$$a_n=B^ka_{n-k}+\frac{C(B^k-1)}{B-1}$$
Substituting $k=n-1$ yields:
$$a_n=B^{n-1}a_1+\frac{C(B^{n-1}-1)}{B-1}=B^{n-1}A+\frac{C(B^{n-1}-1)}{B-1}$$
In your case, $A=40,B=3$ and $C=-90$, so
$$f(n)=40\cdot3^{n-1}-\frac{90(3^{n-1}-1)}{2}$$
this simplifies to
$$f(n)=-\frac{5}{3}(3^n-27)$$
If any doubts, ask in the comments.
A: You have
$$a_n=3a_{n-1}-90$$ If the constant was not here, the problem would be very simple.
To get rid of it, let $a_n=b_n+k$ and replace
$$b_n+k=3b_{n-1}+3k-90$$ Make $k=3k-90 \implies k= ??$, solve the problem for $b_n$ and, when done, go back to $a_n$.
A: $$
f(n)=3f(n-1)-90=3[3f(n-2)-90]-90=...=3^{n-1}f(1)-90\sum_{k=0}^{n-1}3^k\\
=3^{n-1}f(1)-45(3^n-1) 
$$
