So wait, F_t and R don't depend on i? What is I_p and I_r?
If those things don't depend on i you can pull them out of the sum.
Regardless, you can treat the entire thing as a function of R. (f(R)=.... Summation on right side.)
You can imagine that as you change the value of R, the value of f changes as well. It's hard to get an idea of what this function may look like if you plotted it, but the point is to find \frac{\partial f}{\partial R} and set it equal to zero.
F_t is a constant that depends on your choice of R and depends on the already defined constant F_{t-1}. Since you are taking the derivative w.r.t R, you first want to replace F_t in the sum with its definition. You may have to do something similar with I_p and I_r, depending on what they are defined as. However, once you have the entire thing expressed explicitly in terms of R, (i.e. all values that depend on R are written out in full), then you can take \frac{\partial}{\partial R}. It's important to remember that the differentiation operator \frac{\partial}{\partial R} can be moved inside the sum and you can take the derivative of each term of the sum independently.
Once you have taken the derivative w.r.t R, (i.e. you've found \frac{\partial f}{\partial R},) you must set it equal to zero and solve like a normal optimization problem. Hopefully there is only one solution to the resulting equation, telling you the desired value of R. It is possible however that there may be multiple places were \frac{\partial f}{\partial R} is equal to zero, in this case you have to do a little bit of investigating to determine which value of R really maximizes the sum.
I hope I am understanding your question right and I hope this helps in some way. Good luck