If you haven't done integration by parts before, this one can be pretty tricky.
Write your equation as q(t)=10\int_0^t e^{-30t}\ \sin(40t)\ dt
To avoid messing around with a lot of coefficients, let's evaluate the indefinite integral:
\int e^{at}\ \sin(bt)\,dt
This will require two applications of integration by parts. The result will look as if we've gotten nowhere, but a little algebra will cure that.
Integration by parts will proceed similar to the way you were doing it.
\text{Let } u=\sin(bt)\ \ \to\ \ du=b\,\cos(bt)\,dt\,.
\text{Let } dv=e^{at}dt\ \ \to\ \ v=\int e^{at}dt={{1}\over{a}}\ e^{at}\,.
So according to integration by parts:
\int e^{at}\ \sin(bt)\,dt={{1}\over{a}}\ e^{at}\ \sin(bt)\,-\,{{b}\over{a}}\int e^{at}\ \cos(bt)\,dt\,.\quad\quad\quad\text{Eq. 1}
To evaluate the resulting integral, int e^{at}\ \cos(bt)\,dt\,, do a similar integration by parts. This time:
\text{Let } u=\cos(bt)\ \ \to\ \ du=-b\,\sin(bt)\,dt\,.
\text{Let } dv=e^{at}dt\ \ \to\ \ v={{1}\over{a}}\ e^{at}\,,\text{ (as before).}
According to integration by parts:
\int e^{at}\ \cos(bt)\,dt={{1}\over{a}}\ e^{at}\ \cos(bt)\,-\,{{-b}\over{a}}\int e^{at}\,\sin(bt)\,dt\,
={{1}\over{a}}\ e^{at}\ \cos(bt)+{{b}\over{a}}\int e^{at}\,\sin(bt)\,dt\,.
Plug this result in for the integral on the R.H.S. of Eq. 1, then solve for the integral which appears on both sides of the resulting equation.
.