Alvin can go upstream at a rate of 6 miles per hour and downstream at a rate of 12 miles per hour. One day while Alvin was on the river, he received a call telling him he needs to turn around and come home. So he turned around and went back to his starting point. If his entire trip took 6 hours, how far did he travel on the river?

since time = distance/speed,

d/12 + d/6 = 6

To solve this problem, we can use the formula: distance = rate * time.

Let's assume the distance from Alvin's starting point to his destination is 'D' miles.

When Alvin is going upstream, his rate is 6 miles per hour. So the time taken while going upstream is D/6 hours.

When Alvin is going downstream, his rate is 12 miles per hour. So the time taken while going downstream is D/12 hours.

Since we know that the entire trip took 6 hours, we can write the equation:
D/6 + D/12 = 6.

To solve this equation, we can first simplify it by finding a common denominator of 12:
2D/12 + D/12 = 6.

Combining the terms on the left side of the equation:
3D/12 = 6.

Next, we can multiply both sides of the equation by 12 to isolate the variable:
3D = 72.

Finally, we divide both sides of the equation by 3 to solve for D:
D = 24.

Therefore, Alvin traveled a distance of 24 miles on the river.