Are you familiar with the Dirac delta function, Heaviside step function and the Ramp function?
You could use Laplace Transforms together with those three handy functions:
Dirac Delta function
$$\delta(x)= \left{\begin{array}{l}+\infty\qquad&x=0\0&x\neq0\end{array}\right. $$ The Dirac Delta function is equal to infinity, at $x=0$, and $0$ everywhere else. Respectively $\delta(x-a)=+\infty$ if $x=a$.
With the Euler-Bernoulli beam theory, where $$ EI\frac{d^4w}{dx^4}=q(x) $$ a static interpretation of the Dirac function is, that a point load $Q$ at point a represents a distributed load with infinite density, thus can be written as $q(x)=Q\cdot \delta(a-x)$
Heaviside step function
The step function is the integral of the Dirac Delta function $$ H(x)=\int_{-\infty}^x\delta(s)ds $$ or $$ H(x)= \left{\begin{array}{l}1\qquad&x\geq0\0&x<0\end{array}\right. $$ Thus, a distributen load, with magniuted $q$, between $x=a$ and $x=b$ can be written as $q(x)=q\left[ H(x-a)-H(x-b) \right]$
Ramp function
The ramp function again is the integral of the Heaviside function. 916
$$ R(x)= \left{\begin{array}{l}x\qquad&x\geq0\0&x<0\end{array}\right. $$ Thus, a distributied load , starting at $x=a$, with a slope $m$ can be written as $ q(x)=m\cdot R(x-a) $
The following distributed load, for example:
This load can be written as: $$ q(x)=\frac{q}{b-a}\left[R(x-a)-R(x-b)\right]-\frac{q}{d-c}\left[R(x-c)-R(x-d)\right] $$ please see attached file for the derivation
Further explanation of the Dirac Delta function
Take, for example the point force $Q$. That force can be approximated by a distributed load $Q=q\cdot dx$, therefore $q=\frac{Q}{dx}.$ Now, as a point load acts on an interval $dx\to0$, we can say $\lim_{dx\to0} q=+\infty$
This is also represented, if you look at a shear force diagram. We know, that $V'(X)=q(x)$, and we know that a point load $Q$ (external force or support) at point $a$ causes a "jump" in the shear force diagram, according to its magnitude, this can be represented by the Heaviside function. $V=Q\cdot H(x-a)$, now $$V'(x)=q(x)=(Q\cdot H(x-a))'=Q\cdot H'(x-a)$$ As explained above, the derivative of the Heaviside function is the Dirac delta function, therefore $$ q(x)=Q\cdot \delta(x-a) $$ 916