One way to write volume charge densities without using piecewise functions is to use step \((\Theta)\) or \(\delta\) functions. If you need to review this, see the following link in the math-physics book: https://paradigms.oregonstate.eduhttps://books.physics.oregonstate.edu/GMM/step.html
Consider a spherical shell with charge density \(\rho (\vec{r})=\alpha3e^{(k r)^3}\) between the inner radius \(a\) and the outer radius \(b\). The charge density is zero everywhere else. Use step functions to write this charge density as a single function valid everywhere in space.