Using a simply supported beam model,

Using a cantilever beam model,

Using integration,