In a traditional Algebra 1 class, an equation would be presented to students first, like so:
where m is the months of occupancy, x is the monthly savings of owning over renting, y is the monthly interest on the downpayment, f is the final sale price, i is the initial price, and n is the net profit. Got that? No? Who cares - here's 10 problems, plug in the numbers and go. I fail to see the point of it.
A better way to do it
Basically, let the students build the equation.
There are two things to consider, both related to opportunity costs. The first is the monthly cost to own a house - the mortgage, insurance, and property taxes - compared to monthly cost to rent. Utilities would be the same, so both columns of the ledger should ignore utilities. Let's define this as x, where x = monthly rental cost minus monthly cost to own. Students could work with some specific examples and determine what the sign of x indicates. This is knowledge students in Algebra 1 are still reinforcing. (A positive x indicates that it is cheaper to own. A negative x indicates that it is cheaper to rent.)
The second thing to consider is that buying a house necessarily entails tying up a down payment that could have been an investment. Call the monthly return on this investment y, the opportunity cost of not investing the money elsewhere. If the down payment is $50,000 and the interest rate one can get in a safe account is 3%, then y is about $125 per month. This variable is, of course, always positive. In Algebra 1, students wouldn't know how to calculate the monthly interest, but it is worth them knowing where that variable is coming from.
Next, I would ask students to think about the true monthly benefit to owning, giving them several different examples. After that, I would ask them to write a general expression for it (the true monthly benefit to owning is x - y) and ask them to explain what the sign of this quantity shows them. If this quantity is positive, the homeowner is saving money each month. If it's negative, the renter is saving money each month. This quantity needs to multiplied by the period of occupancy to come up with total savings or total costs to the homeowner.
Now onto sale price.
There are four possibilities. There are the two trivial-to-understand ones: (a) the homeowner both makes money on the sale AND saves money each month by owning, in which case the person clearly had made money by owning; and (b) the homeowner both loses money on the sale and on the monthly cost compared to renting, in which case the person has clearly lost money by owning.
The other possibilities are more tricky to understand: (c) the sale price is negative but the monthly cost is positive, and (d) the sale price is positive but the monthly cost is negative. In both cases, it depends on the specific amounts. Let's have the students work with some specific numbers to make sure that they see what's going on.
Let's say the homeowner is saving $400 a month on the mortgage compared to renting. The downpayment was $50,000, so that's $125 per month in foregone interest, so the actual monthly benefit to owning is $275. Now let's say the person lives in the house for 7 years. Perhaps the loss on the sale of the house is $20,000. (Don't forget to multiply the final sale price by 0.94 because of the real estate transaction fees when calculating the net profit or loss!) Did this homeowner come out ahead?
Just barely, but yes. In this case, the positive quantity of monthly savings (times months) is greater than the one-time sale loss.
As another example, consider someone losing $200 a month on the mortgage compared to renting (it's a very cheap rental market!). With a $50,000 downpayment, the actual monthly loss is $325. Let's say the person lives in the house for 5 years and realizes a profit of $15,000. In this case:
This is a net loss overall. The monthly loss (times months) is greater than the one-time profit realized on the sale.
At this point, students would be ready to write the equation after working with several examples. Furthermore, why not have students write equations with long variable names?
This is an equation they would actually understand, because they built it themselves, working with examples first, confirming what the signs of each part mean, and because it's verbose. Now they have some algebra knowledge and some real-world knowledge.
Here's the New York Times' rent vs buy calculator. And here's Vox on the matter, raising the good point that buying a home can force people to "save" in paying off the principal of the loan.