Let $f(x)$ be a continuous function defined on the interval $[0,a]$. In this work, we apply the neutrix limit to generalize the $q$-integral $$ \int^a_0x^{\alpha-1}ln^rxf(x)d_qx,\quad r\in\Bbb N $$ for all values of $\alpha\in\Bbb R$. We use our results to extend the definition of the $q$-beta function $B_q(a,b)$ and its derivatives for all values of $b$ and $a\neq0,-1,-2,\dots$. Some results for the $q$-gamma function are derived.