Hey guys, I used to post here under emttim or something to that effect, but anyway I'm actually posed to use the calculus I learned back in college...the only problem is I always sucked at setting up problems. I haven't much improved on that since being out of school.

Here is what I am trying to do. Me and my wife are planning to buy a condo, so we're going to have a condo loan. I also have a student loan. The question is what combination of early payments to each loan will maximize our interest savings. It's going to be simple enough to derivate that and set the derivative equal to zero to find the maximum, however, I do need to figure out how to create the formula to derive in the first place.

The way I figure it is that I have two, possibly three variables. I have created amortization tables for both loans and I can compute in Excel what my savings will be with various combinations. Here's a couple examples:

If I contribute $400 to the mortgage loan, let's call that variable M, and $100 to the student loan, let's call that variable S, then the total interest savings will be $95,783.44. When M=425 and S=75, the total interest savings is $96,785.67, etc. I'm not sure if this is a simple enough formula, or if it would just be a nightmare due to have to have equalities, etc. I also don't know if you would need to designate the total combined payment as a separate variable. Anyway, let me know what you guys think...I'm curious to see if this is possible. It'd definitely be nice to apply some calculus to a real problem. Thanks!