$EI \, y'' = \dfrac{M}{L}x - M \, \langle \, x - a \, \rangle^0$
$EI \, y' = \dfrac{M}{2L}x^2 - M \, \langle \, x - a \, \rangle + C_1$
$EI \, y = \dfrac{M}{6L}x^3 - \frac{1}{2}M \, \langle \, x - a \, \rangle^2 + C_1x + C_2$
At x = 0, y = 0, therefore C2 = 0
At x = L, y = 0
$0 = \frac{1}{6}ML^2 - \frac{1}{2}M(L - a)^2 + C_1L$
$0 = \frac{1}{6}ML^2 - \frac{1}{2}M(L^2 - 2La + a^2) + C_1L$
$0 = \frac{1}{6}ML^2 - \frac{1}{2}ML^2 + MLa - \frac{1}{2}Ma^2 + C_1L$
$0 = -\frac{1}{3}ML^2 + MLa - \frac{1}{2}Ma^2 + C_1L$
$C_1L = \frac{1}{3}ML^2 - MLa + \frac{1}{2}Ma^2$
$C_1 = \frac{1}{3}ML - Ma + \dfrac{Ma^2}{2L}$
Therefore,
$EI \, y = \dfrac{M}{6L}x^3 - \frac{1}{2}M \, \langle \, x - a \, \rangle^2 + \left( \frac{1}{3}ML - Ma + \dfrac{Ma^2}{2L} \right)x$ answer
At x = a
$EI \, y = \dfrac{Ma^3}{6L} + \left( \frac{1}{3}ML - Ma + \dfrac{Ma^2}{2L} \right)a$
$EI \, y = \dfrac{2Ma^3}{3L} + \frac{1}{3}MLa - Ma^2$
$EI \, y = \dfrac{Ma}{3L} (2a^2 + L^2 - 3La)$
$EI \, y = \dfrac{Ma}{3L} (L^2 - 3La + 2a^2)$ answer
When a = 0 (moment load is at the left support):
$EI \, y = \dfrac{M}{6L}x^3 - \frac{1}{2}M \, \langle \, x - a \, \rangle^2 + \left( \frac{1}{3}ML - Ma + \dfrac{Ma^2}{2L} \right)x$
$EI \, y = \dfrac{M}{6L}x^3 - \frac{1}{2}Mx^2 + \frac{1}{3}MLx$
$EI \, y = \dfrac{Mx}{6L}(x^2 - 3Lx + 2L^2)$
$EI \, y = \dfrac{Mx}{6L}(2L^2 - 3Lx + x^2)$
$EI \, y = \dfrac{Mx}{6L}(L - x)(2L - x)$ answer
When a = L (moment load is at the right support):
$EI \, y = \dfrac{M}{6L}x^3 - \frac{1}{2}M \, \langle \, x - a \, \rangle^2 + \left( \frac{1}{3}ML - Ma + \dfrac{Ma^2}{2L} \right)x$
$EI \, y = \dfrac{M}{6L}x^3 + \left( \frac{1}{3}ML - ML + \frac{1}{2}ML \right)x$
$EI \, y = \dfrac{M}{6L}x^3 - \frac{1}{6}MLx$
$EI \, y = \dfrac{Mx^3 - ML^2x}{6L}$
$EI \, y = \dfrac{-Mx (-x^2 + L^2)}{6L}$
$EI \, y = \dfrac{-MLx (L^2 - x^2)}{6L^2}$
$EI \, y = -\dfrac{MLx}{6L^2}(L^2 - x^2)$
$EI \, y = -\dfrac{MLx}{6}\left( 1 - \dfrac{x^2}{L^2} \right)$ answer