A Model of Investment Gearing

I have made up by myself a mathematical model of gearing that is supposed to help me decide whether I should gear or not. I am still young and not a finance PhD, so I would like someone to see whether my model is correct or whether I have made some serious errors.

Gearing means borrowing to invest. If I borrow to invest, then my profit from gearing is

where L is the amount you loan from the bank, r is the annual rate of growth of your investment, T is the duration of your loan, and R is the *yearly* interest repayment.

The first term is the value of your investment after T years and the second term is the opportunity cost of your investment because you could have invested without borrowing.

Solving the integral, we get,

To see whether you should gear, find out whether . If it is, borrow to invest. Otherwise, don't.

By looking at the formula we can see that gearing is a better option if L (the loan amount) is high and R (the interest repayments) is low.