I found a better way to solve this problem by using singularity functions. Not only is the solution simple and elegant, one equation can be written for the entire beam! Also, the format for each equation is similar, so it is easy to copy the formula in a spreadsheet or program for one result (such as for the shear) and revise the equation for other results (such as the displacement) -- just change the multiplier and exponent. Furthermore, you do not need to calculate all of the variables (shear, moment, slope) to calculate any of the the other equations (such as displacement).
Not to go into too much detail, but singularity functions are like a switch to turn a load on. 7
Furthermore, they can be integrated just like a normal equation. The singularity functions work as follow:
$$ \begin{align} \langle x-a \rangle ^{-1} &= \begin{cases} 0, & x \neq a \ 1, & x=a \end{cases} \ \langle x-a \rangle ^0 &= \begin{cases} 0, & x \neq a \ 1, & x=a \end{cases} \ \text{if n>0, } \langle x-a \rangle ^n &= \begin{cases} 0, & \text{xa} \end{cases} \ \end{align} $$
$$ \begin{align} & \int \langle x-a \rangle ^{-1} dx = \langle x-a \rangle ^0 \ & \int \langle x-a \rangle ^0 dx = \langle x-a \rangle ^1 \ & \int \langle x-a \rangle ^n dx = \frac{1}{n+1} \langle x-a \rangle ^{(n+1)} \end{align} $$
(https://www.colorado.edu/engineering/CAS/courses.d/Structures.d/IAST.Lect12.d/IAST.Lect12.pdf is a good example of using singularity functions to solve beam deflections.)
Using the singularity functions, the beam to solve
is represented as follows:
where $slope=(Q_C-Q_B)/(x_C-x_B)$, the load beginning with $Q_B$ continues for the remaining length, and the load beginning with $Q_C$ turns the load "off". (The singularity function turns a load on but not off, so any load that ends before the end of the beam requires a second load and singularity function to remove the load. 262