We have defined function as a set:

By definition,

and

It means that is the unique solution of

where and

To compute , we solve for as follows:

Integrate from to gives

Therefore,

That is,

To obtain , we numerically evaluate , using function ‘quad_qags’.

Fig. 1

The result is visually validated in Fig. 2.

Fig. 2

Note: ‘romberg’, another function that computes the numerical integration by Romberg’s method will not work since it evaluates at

Fig. 3

An alternate approach is to solve as an initial-value problem of ODE using ‘rk’ , the function that implements the classic Runge-Kutta algorithm.

Fig. 4 for

Fig. 5

Putting the results together, we have

Fig. 6

However, we cannot solve using ‘rk’:

Fig. 7

*Exercise-1* Compute for .

*Exercise-2* Explain why ‘rk’ cannot solve .