You paid $2,000 in margin interest. You earned $3,000 in net investment income. You can deduct the full $2,000 on Schedule A (if you itemize).