Laplace integral - Integration by parts

The algorithm performs repeatedly integration by parts on 
        I (x) = 
      (∫_a^b) f[t] (e^(x ϕ[t])) dt ,  
    as described (for one step)  in Bender & Orszag pp 258
         - 259.

Applicability

The integration by parts-approach is somewhat limited. Requirements include (but are not limited to)
   -   ϕ[t] taking its maximum at  a or b (with non-zero derivative there), and
   -   f[t] being Taylor-expandable at this point
Failures to meet the requirements typically show up in failure of the approach to give terms in decreasing powers of x, so careful pre-analysis is usually unnecessary.

Test problem

We consider the integral above in the case of  (∫_0^10) ((e^( - x t))/(1 + t)) 
            dt

a = 0  ;  b = 10   ;  f[t_] := 1/(1 + t) ;  
    ϕ[t_] := -t

(Same example as given on page 262 in B&O; it is there solved in a different way)

Algorithm

One new term is produced each time the following line is executed, so repeat it as many times as desired

\(t1[t_] = f[t]/\(ϕ'\)[t]\ ; \ \ t2[t_] = t1[t]*Exp[x*ϕ[t]]/x; 
    
f[t_]\ \  = \(-\(t1'\)[t]\)/x\ \ \ \ ; \ term\  = \ 0\ ; 
\ \ \ \ \ \ 
    If\ [ϕ[a] >= ϕ[b], \ term\  -= \((t2[t] /. t -> a)\)]\ ; 

    \ \ \ \ \ \ 
    If\ [ϕ[a] <= ϕ[b], \ term\  += \((t2[t] /. t -> b)\)]\ ; \ \ 
    term\)

(Note that we must use "=", not ":="in at least one of the first three function definitions t[1t_]=f[t]/... ;  t2[t_]=t1[t]*...; f[t_]  =-t1'[t]/...;  else this sequence becomes a recursive definition for f[t] ).