Passing a numerical solution of an integral to NIntegrate?

Hello everyone,

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 and further explanation of the problem.

Alex

Not working.nb (9.13 KB)

The first integral returns a function:

In[1]:= P = Integrate[b*(1 - c*g)*Exp[-a*u] + b*(1 - c*g)*g*(1 - Exp[-a*u]) - b*Exp[-a*u], {u, 50, t}]
Out[1]=-15.7623 + 13.5 E^(-0.03 t) + 0.255 t

Whereas the NIntegrate calculation returns a number:

In[2]:= P = NIntegrate[b*(1 - c*g)*Exp[-a*u] + b*(1 - c*g)*g*(1 - Exp[-a*u]) - b*Exp[-a*u], {u, 50, 1000}]
Out[2]:= 467.562

For this reason, your final numerical integration involving P are different from each other.