I know that the average velocity is given by the ratio
$$ \frac{\text{total distance}}{\text{total time}}
$$ It should be easy to figure out from a linear displacement-time graph, but what about when only part of it is curved? Here is the graph I have: 
I thought that the total distance on the left part is $(25-5) = 20$, and distance on the right part is $(25 - 10) = 15. 20 +15 = 35 = \text{total distance}$. Total time $= 8s$, so I thought avg velocity should be $35/8 - 4.375$, which is the wrong answer.
Where am I going wrong? How do I find total distance when there's a curved graph?
Let $d(t)$ be the displacement function, in terms of $t$. The average velocity over the time span $0$ to $8$ seconds is given by the following ratio: $$ \frac{d(8)-d(0)}{8-0}=\frac{10-5}{8-0}=\frac{5}{8} $$