If you haven't done integration by parts before, this one can be pretty tricky.
Write your equation as [tex]q(t)=10\int_0^t e^{-30t}\ \sin(40t)\ dt[/tex]
To avoid messing around with a lot of coefficients, let's evaluate the indefinite integral:
[tex]\int e^{at}\ \sin(bt)\,dt[/tex]
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.
[tex]\text{Let } u=\sin(bt)\ \ \to\ \ du=b\,\cos(bt)\,dt\,.[/tex]
[tex]\text{Let } dv=e^{at}dt\ \ \to\ \ v=\int e^{at}dt={{1}\over{a}}\ e^{at}\,.[/tex]
So according to integration by parts:
[tex]\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}[/tex]
To evaluate the resulting integral, [tex]int e^{at}\ \cos(bt)\,dt\,,[/tex] do a similar integration by parts. This time:
[tex]\text{Let } u=\cos(bt)\ \ \to\ \ du=-b\,\sin(bt)\,dt\,.[/tex]
[tex]\text{Let } dv=e^{at}dt\ \ \to\ \ v={{1}\over{a}}\ e^{at}\,,\text{ (as before).}[/tex]
According to integration by parts:
[tex]\int e^{at}\ \cos(bt)\,dt={{1}\over{a}}\ e^{at}\ \cos(bt)\,-\,{{-b}\over{a}}\int e^{at}\,\sin(bt)\,dt\,[/tex]
[tex]={{1}\over{a}}\ e^{at}\ \cos(bt)+{{b}\over{a}}\int e^{at}\,\sin(bt)\,dt\,.[/tex]
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.
[tex].[/tex]