I am trying to integrate one function (integrand A) and subsequently use that result as part of the integrand (integrand B) for another integral that is to be numerically solved. When I integrate function A analytically, I achieve my goal no problem. But, when I try to numerically integrate function A and subsequently use that solution in the second integral, my numerical solution is wrong. I was wondering if someone could help me make the second approach (the fully numerical approach) work? Attached is my code.