From the MIT exercise book (2E-7):
A trough is filled with water at a rate of $1$ cubic meter per second. The trough has a trapezoidal cross section with the lower base of length half a meter and one meter sides opening outwards at an angle of $45$ degrees from the base. The length of the trough is $4$ meters. What is the rate at which the water level $h$ is rising when $h$ is one half meter?
There is a solution here, but omits a lot of details that I couldn't follow.
My main question is how to come up with the volume of the trough.
It is not the best diagram but hopefully explains better. From the first diagram,
$BCFE$ is the base of the trough. $ABCD$ and $EFHG$ are standing vertical to the base.
$ABEG$ and $CDHF$ are walls that are making $135^0 ( = 90^0 + 45^0)$ to the base.
From the second diagram which is the cross section, if the water has filled till height $h$, $AM = ND = h,$ as the angle is $\frac{\pi}{4}$.
The volume of water, $V$ = length of trough $\times$ area of cross section
$ = 4 \times Area \, (\triangle ABM + \square MBCN + \triangle CDN)$
$ = 4 \times (\frac{1}{2}h^2 + \frac{1}{2} h + \frac{1}{2}h^2) = 4h^2 + 2h$
$\frac{dV}{dt} = \frac{dV}{dh} \times \frac{dh}{dt} = (8h + 2)\frac{dh}{dt}$
Also note when the trough is completely full, $AB = 1 \,$ so $h_{max} = \frac{1}{\sqrt2}$.