Let's say the number of aerobics classes is x.
For members, the cost is the membership fee plus $4 for each class:
Cost for members = $10 + $4x
For nonmembers, the cost is $5 for each class:
Cost for nonmembers = $5x
We need to find the value of x for which the cost for members and nonmembers is the same:
$10 + $4x = $5x
Rearranging the equation:
$4x - $5x = -$10
-$x = -$10
x = 10
Therefore, for 10 aerobics classes, the cost for members and nonmembers will be the same.