I need a general formula for f(x) = x + x/y + x/y^2 ... x/y^n but have no idea how to do this kind of problem. Would really appreciate help
Step 1: Factor out an $x$:
$f(x) = x\left(1+\dfrac{1}{y}+\dfrac{1}{y^2}+\ldots + \dfrac{1}{y^n}\right) =$
Step 2: Notice the following: $(1-r)(1+r+r^2+\ldots + r^n) = (1+r+r^2+\ldots + r^n)-(r+r^2+r^3+\ldots + r^{n+1}) = 1 +\cancel{r-r} +\cancel{r^2-r^2}+ \ldots + \cancel{r^n-r^n}-r^{n+1} = 1-r^{n+1}$
Dividing both sides by $1-r$ gives: $1+r+r^2+\ldots + r^n = \dfrac{1-r^{n+1}}{1-r}$
Step 3: Use step 2 to simplify by setting $r = \dfrac{1}{y}$.
$$f(x) = x\left(\dfrac{1-\dfrac{1}{y^{n+1}}}{1-\dfrac{1}{y}}\right) = \dfrac{x}{y^n}\cdot \dfrac{y^{n+1}-1}{y-1}$$