Since he paid p dollars for each of the x shares, and also paid a 2% commission, he spent:
And since he sold that all for r dollars and paid a flat fee of $10, he earned in this sale:
Now, his net proceeds are given by subtracting the spendings from the earnings: