How to install an app on iPhone from a second machine?
For most users, the headache free method is preserving the iTunes folder in its entirety and bringing it over to the other computer. You would then sign into the account you obtain the app with on that computer, and authorize it.
If you're simply without the first computer and want to get the app back, then you would simply re-download from the App Store for free (assuming it hasn't been removed).
I seem to remember this question being asked before, but the link eludes me at this moment.
In short, you can't. iPhone syncing is on a per iTunes-installation basis. Plugging the phone into a different machine and trying to sync will result in iTunes asking if you want to wipe the data and re-sync from the new iTunes repository.