Say I have some test function, which evaluates an integral, such as
test[a_, b_] :=
Integrate[Exp[-(a^2/2) x^2]*Sqrt[x^2 + b^2], {x, 0, \[Infinity]},
Assumptions -> a > 0 && b > 0]
and in this case returns a confluent hypergeometric function
$$\mathrm{test}(a, b) = \frac{\sqrt{\pi}}{a^2} U \left( -\frac{1}{2}, 0, \frac{a^2 b^2}{2} \right) \, .$$
I would like to plot the result as a function of $b$ for some value of $a$, e.g. I set $a=1$ and try to plot with
Plot[test[1, b], {b, 0, 1}, AxesLabel -> {"b", "test"},
PlotRange -> All, ImageSize -> 480]
but this takes a very long time to evaluate since Mathematica is repeatedly solving the integral.
This can easily be solved by wrapping an Evaluate around my test function. But now, if I want to manipulate the parameter $a$, things evaluate much slower than if I had just substituted the result, i.e.
Manipulate[
Plot[Evaluate[test[a, b]], {b, 0, 1}, AxesLabel -> {"b", "test"},
PlotRange -> All, ImageSize -> 480], {{a, 0.5, "a"}, 0.0001, 1,
Appearance -> {"Labeled", "Open"}}]
is slower than
Manipulate[
Plot[(Sqrt[\[Pi]] HypergeometricU[-(1/2), 0, (a^2 b^2)/2])/
a^2, {b, 0, 1}, AxesLabel -> {"b", "test"}, PlotRange -> All,
ImageSize -> 480], {{a, 0.5, "a"}, 0.0001, 1,
Appearance -> {"Labeled", "Open"}}]
Is there a fast way to plot and manipulate the test function without having to substitute the resulting expression by hand?