Question: Using the solution to dsolve (numeric) in a subsequent integral

Hi. I have solved numerical an ODE and want to use the solution in the integrand of a subsequent integral. I'm being frustrated by my lack of knowledge and the internet isn't helping! I hope someone can put me's the relevant part of code.

dsysA := {diff(r(s), s) = sqrt((g*r(s) + h)^2 - 1 + 1/r(s)), r(0) = rinit};
dsnA := dsolve(dsysA, numeric, abserr = 10^(-6));

               [s = 0.1, r(s) = 1.51303353884965]

rA := s -> rhs(dsnA(s)[2]):


tA := s -> tinit + int((g*rA(p) + h)/(1 - 1/rA(p)), p = 0 .. s):

Error, (in rA) invalid input: rhs received dsnA(p)[2], which is not valid for its 1st argument, expr

Please Wait...