The integral is studied in <A HREF="http://onlinelibrary.wiley.com/doi/10.1002/sapm1958371157/abstract">On Certain Indefinite Integrals Involving Bessel Functions</A> (1958).    
<sub>(The $i=0$ integral is $g(a,0,x)$ in the notation of that paper, and as Robert Israel points out, the $i=1$ integral is simply related.)</sub>   
The paper is behind a paywall, so I don't know if it provides much help, but at least it is an entry point to the literature (it includes several references where integrals of this type appeared).