#### A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /var/www/html/cnasolution/application/views/question.php

Line: 191

Function: _error_handler

File: /var/www/html/cnasolution/application/controllers/Questions.php

Line: 419

Function: view

File: /var/www/html/cnasolution/index.php

Line: 315

Function: require_once

## solving definite integral: $\int_{10^{-14}}^{1.0} (0.4-0.5*a)/a da$ in C [closed]

I am struggling to solve the following definite integral in C: $int_{a1}^1 (0.4-0.5*a)/a da$, where the lower limit is very small a1=1e-14, upper limit is 1.0.

I know I can solve this analytically, but in general I have to solve for similar functions which do not have analytical integration result. I chose this function here because I can get the results (12.394...) analytically for error estimation.

I used many methods in C, like the Romberg method, but could not get the correct result. Interestingly, in python, `scipy.integrate.quad`

gives very good result (error~1e-8) very quickly. But I need the routine in C, also it has to be very fast (comparable to `scipy.integrate.quad`

). Can anyone help me finding the solution numerically in C? Thanks in advance.