speed in still water:x
speed upstream: (x-2)
speed downstream: (x+2)
time upstream: t
time downstream: (3-t)
distance=speed*time
8=(x-2)t
8=(x+2)(3-t)
solve the system of equation by replace t with x: t=8/(x-2)
8=(x+2)[3-8/(x-2)]
8=(x+2)[

]
8=(x+2)(
(x+2)(3x-14)=8(x-2)
3x^2-16x-12=0
x=6 or -2/3 (impossible because it is negative)
so the speed in still water is 6 miles per hour
check to see if it makes sense: upstream speed 4 miles per hours for a total of 8 miles, so that is 2 hours
downstream at speed 8 miles per hour for a distance of 8 miles, that's 1 hour
the total time is 3 hours