I'd like to define a function by way of the output of a definite integral with symbolic bounds. For instance, F[m_,k_] := Integrate[x,{x,m,k}]
would define F[m_,k_] := (1/2)(k^2 - m^2)
This seems to work fine for simple examples, but I've run into the cases where the evaluation takes much longer than the indefinite integral. For instance running
Integrate[r/((p - z)^2 + r^2)^(3/2), {z, 0, L}]
takes several minutes to compute and seems to give different output sometimes. However running the indefinite integral
Integrate[r/((p - z)^2 + r^2)^(3/2), z]
returns almost immediately. How can I use an indefinite integral to generate a function for me? I've tried syntax along the form
F[r_, z_] := Integrate[r/((p - z)^2 + r^2)^(3/2), z]
F[r, L] - F[r, 0]`
but that just takes the indefinite integral of a variable called L and runs in to trouble with the number (it outputs some integral with respect to 0).