Through the centroid $G$ of a triangle $ABC$, a secant line is drawn, cutting sides $AB$ and $BC$. On the straight line a point $E$ is considered. Calculate the area of the triangle $EBG$ if the areas of the triangles $ECG$ and $AEG$ are $20$ and $30$ respectively. (Answer: $50$)
My progress:
I can't develop much..sorry.
I know $G$ is centroid : $\therefore S_{\triangle ABG} = S_{\triangle AGC} = S_{\triangle BGC}.$
Also $\triangle AEG, \triangle EGC, \triangle BEG$ have the same base.
I don't see similarity of triangles.
The heights are different...
I didn't understand the function of the line
????

Let $D$ be the midpoint of $AC$. Drop the perpendicular lines from $A,$ $B,$ $C$ and $D$ to $\overleftrightarrow{EG}$.
Since $DD'$ is the midline of trapezium $AA'C'C$,
$$DD'=\frac{AA'+CC'}2.$$
As $G$ is the centroid,
$$\frac{BB'}{DD'}=\frac{BG}{GD}=\frac21.$$
Therefore, $BB'=AA'+CC'.$
Thus, $[\triangle BEG]=[\triangle AEG]+[\triangle CEG].$